From 8995b83bcbfbb68245f779b64e5517627c6cc6ea Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 17 Oct 2012 16:21:14 +0200 Subject: 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 --- Source/WebCore/rendering/RenderRegion.cpp | 50 ++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 10 deletions(-) (limited to 'Source/WebCore/rendering/RenderRegion.cpp') 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& boxInfo = m_renderBoxRegionInfo.add(box, nullptr).iterator->second; + OwnPtr& boxInfo = m_renderBoxRegionInfo.add(box, nullptr).iterator->value; if (boxInfo) *boxInfo = RenderBoxRegionInfo(logicalLeftInset, logicalRightInset, containingBlockChainIsInset); else @@ -401,8 +401,8 @@ void RenderRegion::setRegionObjectsRegionStyle() RefPtr 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(iter->first); + RenderObject* object = const_cast(iter->key); RefPtr objectRegionStyle = object->style(); - RefPtr objectOriginalStyle = iter->second.style; + RefPtr 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 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 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 styleInRegion, bool objectRegionStyleCached) { ASSERT(object->inRenderFlowThread()); @@ -522,7 +522,7 @@ void RenderRegion::setObjectStyleInRegion(RenderObject* object, PassRefPtr >& 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 -- cgit v1.2.1