Changeset 83221 in webkit
- Timestamp:
- Apr 7, 2011 3:33:32 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r83216 r83221 1 2011-04-07 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 https://bugs.webkit.org/show_bug.cgi?id=57736 6 7 Crash on openstreetmap.org while using the map. Fix a bad interaction between the positioned movement layout 8 optimization and the simplified layout optimization that could lead to blocks remaining marked as dirty when 9 layout finished. This would eventually lead to an inability to properly determine the correct layout root and 10 would cause a deleted root to be used later on. 11 12 Added fast/block/positioning/complex-positioned-movement.html. 13 14 * fast/block/positioning/complex-positioned-movement.html: Added. 15 * platform/mac/fast/block/positioning/complex-positioned-movement-expected.checksum: Added. 16 * platform/mac/fast/block/positioning/complex-positioned-movement-expected.png: Added. 17 * platform/mac/fast/block/positioning/complex-positioned-movement-expected.txt: Added. 18 1 19 2011-04-07 Dan Bernstein <mitz@apple.com> 2 20 -
trunk/Source/WebCore/ChangeLog
r83220 r83221 1 2011-04-07 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 https://bugs.webkit.org/show_bug.cgi?id=57736 6 7 Crash on openstreetmap.org while using the map. Fix a bad interaction between the positioned movement layout 8 optimization and the simplified layout optimization that could lead to blocks remaining marked as dirty when 9 layout finished. This would eventually lead to an inability to properly determine the correct layout root and 10 would cause a deleted root to be used later on. 11 12 Added fast/block/positioning/complex-positioned-movement.html. 13 14 * page/FrameView.cpp: 15 (WebCore::FrameView::scheduleRelayoutOfSubtree): 16 Add asserts to catch cases in the future where a layout root is set that has a dirty containing block. 17 18 * rendering/RenderBlock.cpp: 19 (WebCore::RenderBlock::simplifiedLayout): 20 Change simplified layout so that the positioned movement optimization no longer clears the other layout 21 flags. This will ensure that we still lay out our descendants if they need it. 22 23 (WebCore::RenderBlock::layoutPositionedObjects): 24 Changed to clear our layout flags now if the positioned movement is successful, since tryLayoutDoingPositionedMovementOnly 25 no longer does the clear. 26 27 * rendering/RenderBox.h: 28 (WebCore::RenderBox::tryLayoutDoingPositionedMovementOnly): 29 tryLayoutDoingPositionedMovementOnly now returns a boolean indicating success or failure. On success it no longer 30 does setNeedsLayout(false), but instead will let the caller take care of it. This way the caller can still look at 31 the other flags in case other kinds of layout are still needed. 32 33 * rendering/RenderObject.h: 34 (WebCore::RenderObject::setNeedsPositionedMovementLayout): 35 (WebCore::RenderObject::setNeedsSimplifiedNormalFlowLayout): 36 Changed these methods to only set their respective flags and not to try to be clever about avoiding propagation. 37 1 38 2011-04-07 Anna Cavender <annacc@chromium.org> 2 39 -
trunk/Source/WebCore/page/FrameView.cpp
r83022 r83221 1673 1673 // Keep the current root 1674 1674 relayoutRoot->markContainingBlocksForLayout(false, m_layoutRoot); 1675 ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()); 1675 1676 } else if (m_layoutRoot && isObjectAncestorContainerOf(relayoutRoot, m_layoutRoot)) { 1676 1677 // Re-root at relayoutRoot 1677 1678 m_layoutRoot->markContainingBlocksForLayout(false, relayoutRoot); 1678 1679 m_layoutRoot = relayoutRoot; 1680 ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()); 1679 1681 } else { 1680 1682 // Just do a full relayout … … 1688 1690 int delay = m_frame->document()->minimumLayoutDelay(); 1689 1691 m_layoutRoot = relayoutRoot; 1692 ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()); 1690 1693 m_delayedLayout = delay != 0; 1691 1694 m_layoutTimer.startOneShot(delay * 0.001); -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r83099 r83221 2115 2115 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasColumns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode()); 2116 2116 2117 if (needsPositionedMovementLayout()) { 2118 tryLayoutDoingPositionedMovementOnly(); 2119 if (needsLayout()) 2120 return false; 2121 } 2117 if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovementOnly()) 2118 return false; 2122 2119 2123 2120 // Lay out positioned descendants or objects that just need to recompute overflow. … … 2175 2172 // We don't have to do a full layout. We just have to update our position. Try that first. If we have shrink-to-fit width 2176 2173 // and we hit the available width constraint, the layoutIfNeeded() will catch it and do a full layout. 2177 if (r->needsPositionedMovementLayoutOnly() )2178 r-> tryLayoutDoingPositionedMovementOnly();2174 if (r->needsPositionedMovementLayoutOnly() && r->tryLayoutDoingPositionedMovementOnly()) 2175 r->setNeedsLayout(false); 2179 2176 r->layoutIfNeeded(); 2180 2177 } -
trunk/Source/WebCore/rendering/RenderBox.h
r82611 r83221 351 351 // Called when a positioned object moves but doesn't necessarily change size. A simplified layout is attempted 352 352 // that just updates the object's position. If the size does change, the object remains dirty. 353 voidtryLayoutDoingPositionedMovementOnly()353 bool tryLayoutDoingPositionedMovementOnly() 354 354 { 355 355 int oldWidth = width(); … … 357 357 // If we shrink to fit our width may have changed, so we still need full layout. 358 358 if (oldWidth != width()) 359 return ;359 return false; 360 360 computeLogicalHeight(); 361 setNeedsLayout(false);361 return true; 362 362 } 363 363 -
trunk/Source/WebCore/rendering/RenderObject.h
r83038 r83221 960 960 inline void RenderObject::setNeedsPositionedMovementLayout() 961 961 { 962 bool alreadyNeededLayout = needsLayout();962 bool alreadyNeededLayout = m_needsPositionedMovementLayout; 963 963 m_needsPositionedMovementLayout = true; 964 ASSERT(!isSetNeedsLayoutForbidden()); 964 965 if (!alreadyNeededLayout) { 965 966 markContainingBlocksForLayout(); … … 971 972 inline void RenderObject::setNeedsSimplifiedNormalFlowLayout() 972 973 { 973 bool alreadyNeededLayout = needsLayout();974 bool alreadyNeededLayout = m_needsSimplifiedNormalFlowLayout; 974 975 m_needsSimplifiedNormalFlowLayout = true; 976 ASSERT(!isSetNeedsLayoutForbidden()); 975 977 if (!alreadyNeededLayout) { 976 978 markContainingBlocksForLayout();
Note: See TracChangeset
for help on using the changeset viewer.