diff options
| author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-17 16:21:14 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-17 16:21:14 +0200 |
| commit | 8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch) | |
| tree | 17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebCore/rendering/RenderRegion.cpp | |
| parent | b9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff) | |
| download | qtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz | |
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well
as the previously cherry-picked changes
Diffstat (limited to 'Source/WebCore/rendering/RenderRegion.cpp')
| -rw-r--r-- | Source/WebCore/rendering/RenderRegion.cpp | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/Source/WebCore/rendering/RenderRegion.cpp b/Source/WebCore/rendering/RenderRegion.cpp index 8a7487d7c..11d5aff74 100644 --- a/Source/WebCore/rendering/RenderRegion.cpp +++ b/Source/WebCore/rendering/RenderRegion.cpp @@ -336,7 +336,7 @@ RenderBoxRegionInfo* RenderRegion::setRenderBoxRegionInfo(const RenderBox* box, if (!m_isValid || !m_flowThread) return 0; - OwnPtr<RenderBoxRegionInfo>& boxInfo = m_renderBoxRegionInfo.add(box, nullptr).iterator->second; + OwnPtr<RenderBoxRegionInfo>& boxInfo = m_renderBoxRegionInfo.add(box, nullptr).iterator->value; if (boxInfo) *boxInfo = RenderBoxRegionInfo(logicalLeftInset, logicalRightInset, containingBlockChainIsInset); else @@ -401,8 +401,8 @@ void RenderRegion::setRegionObjectsRegionStyle() RefPtr<RenderStyle> objectStyleInRegion; bool objectRegionStyleCached = false; if (it != m_renderObjectRegionStyle.end()) { - objectStyleInRegion = it->second.style; - ASSERT(it->second.cached); + objectStyleInRegion = it->value.style; + ASSERT(it->value.cached); objectRegionStyleCached = true; } else objectStyleInRegion = computeStyleInRegion(object); @@ -420,12 +420,12 @@ void RenderRegion::restoreRegionObjectsOriginalStyle() RenderObjectRegionStyleMap temp; for (RenderObjectRegionStyleMap::iterator iter = m_renderObjectRegionStyle.begin(), end = m_renderObjectRegionStyle.end(); iter != end; ++iter) { - RenderObject* object = const_cast<RenderObject*>(iter->first); + RenderObject* object = const_cast<RenderObject*>(iter->key); RefPtr<RenderStyle> objectRegionStyle = object->style(); - RefPtr<RenderStyle> objectOriginalStyle = iter->second.style; + RefPtr<RenderStyle> objectOriginalStyle = iter->value.style; object->setStyleInternal(objectOriginalStyle); - bool shouldCacheRegionStyle = iter->second.cached; + bool shouldCacheRegionStyle = iter->value.cached; if (!shouldCacheRegionStyle) { // Check whether we should cache the computed style in region. unsigned changedContextSensitiveProperties = ContextSensitivePropertyNone; @@ -472,7 +472,7 @@ PassRefPtr<RenderStyle> RenderRegion::computeStyleInRegion(const RenderObject* o return renderObjectRegionStyle.release(); } - + void RenderRegion::computeChildrenStyleInRegion(const RenderObject* object) { for (RenderObject* child = object->firstChild(); child; child = child->nextSibling()) { @@ -482,7 +482,7 @@ void RenderRegion::computeChildrenStyleInRegion(const RenderObject* object) RefPtr<RenderStyle> childStyleInRegion; bool objectRegionStyleCached = false; if (it != m_renderObjectRegionStyle.end()) { - childStyleInRegion = it->second.style; + childStyleInRegion = it->value.style; objectRegionStyleCached = true; } else { if (child->isAnonymous()) @@ -498,7 +498,7 @@ void RenderRegion::computeChildrenStyleInRegion(const RenderObject* object) computeChildrenStyleInRegion(child); } } - + void RenderRegion::setObjectStyleInRegion(RenderObject* object, PassRefPtr<RenderStyle> styleInRegion, bool objectRegionStyleCached) { ASSERT(object->inRenderFlowThread()); @@ -522,7 +522,7 @@ void RenderRegion::setObjectStyleInRegion(RenderObject* object, PassRefPtr<Rende styleInfo.cached = objectRegionStyleCached; m_renderObjectRegionStyle.set(object, styleInfo); } - + void RenderRegion::clearObjectStyleInRegion(const RenderObject* object) { ASSERT(object); @@ -579,4 +579,34 @@ void RenderRegion::getRanges(Vector<RefPtr<Range> >& rangeObjects) const namedFlow->getRanges(rangeObjects, this); } +void RenderRegion::updateLogicalHeight() +{ + RenderReplaced::updateLogicalHeight(); + + if (!hasAutoLogicalHeight()) + return; + + // We want to update the logical height based on the computed override logical + // content height only if the view is in the layout phase + // in which all the auto logical height regions have their override logical height set. + if (view()->normalLayoutPhase()) + return; + + // There may be regions with auto logical height that during the prerequisite layout phase + // did not have the chance to layout flow thread content. Because of that, these regions do not + // have an overrideLogicalContentHeight computed and they will not be able to fragment any flow + // thread content. + if (!hasOverrideHeight()) + return; + + LayoutUnit newLogicalHeight = overrideLogicalContentHeight() + borderAndPaddingLogicalHeight(); + if (newLogicalHeight > logicalHeight()) + setLogicalHeight(newLogicalHeight); +} + +bool RenderRegion::needsOverrideLogicalContentHeightComputation() const +{ + return hasAutoLogicalHeight() && view()->normalLayoutPhase() && !hasOverrideHeight(); +} + } // namespace WebCore |
