Changeset 169189 in webkit
- Timestamp:
- May 21, 2014 11:12:34 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r169178 r169189 1 2014-05-21 Antti Koivisto <antti@apple.com> 2 3 REGRESSION(r167870): Crash in simple line layout code with :after 4 https://bugs.webkit.org/show_bug.cgi?id=133155 5 6 Reviewed by Darin Adler. 7 8 * fast/text/simple-lines-hover-after-expected.html: Added. 9 * fast/text/simple-lines-hover-after.html: Added. 10 1 11 2014-05-21 Zalan Bujtas <zalan@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r169183 r169189 1 2014-05-21 Antti Koivisto <antti@apple.com> 2 3 REGRESSION(r167870): Crash in simple line layout code with :after 4 https://bugs.webkit.org/show_bug.cgi?id=133155 5 <rdar://problem/16977696> 6 7 Reviewed by Darin Adler. 8 9 Fix https://bugs.webkit.org/show_bug.cgi?id=132241 in a safer way. 10 The underline behavior is tested by the existing fast/text/simple-lines-hover-underline.html 11 12 Test: fast/text/simple-lines-hover-after.html 13 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::invalidateLineLayoutPath): Deleted. 16 17 Move to RenderBlockFlow. 18 19 * rendering/RenderBlock.h: 20 (WebCore::RenderBlock::invalidateLineLayoutPath): 21 * rendering/RenderBlockFlow.cpp: 22 (WebCore::RenderBlockFlow::styleDidChange): 23 24 Invalidate layout if style changes in a manner that makes us ineligible to use the simple line layout path. 25 26 (WebCore::RenderBlockFlow::invalidateLineLayoutPath): 27 28 Drop the simple line layout on path invalidation if it exists. It may not be valid anymore. 29 Also invalidate the layout if this happens so we'll reconstruct the lines later. 30 31 (WebCore::RenderBlockFlow::simpleLineLayout): Deleted. 32 (WebCore::RenderBlockFlow::ensureLineBoxes): 33 (WebCore::RenderBlockFlow::createLineBoxes): Deleted. 34 35 Revert some of the changes made it r167870. 36 37 * rendering/RenderBlockFlow.h: 38 (WebCore::RenderBlockFlow::simpleLineLayout): 39 40 Add strong validity assert. 41 1 42 2014-05-21 Eric Carlson <eric.carlson@apple.com> 2 43 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r169128 r169189 625 625 if (AXObjectCache* cache = document().existingAXObjectCache()) 626 626 cache->recomputeIsIgnored(this); 627 }628 629 void RenderBlock::invalidateLineLayoutPath()630 {631 if (m_lineLayoutPath == ForceLineBoxesPath)632 return;633 m_lineLayoutPath = UndeterminedPath;634 627 } 635 628 -
trunk/Source/WebCore/rendering/RenderBlock.h
r169128 r169189 82 82 virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0); 83 83 84 v oid invalidateLineLayoutPath();84 virtual void invalidateLineLayoutPath() { } 85 85 86 86 void insertPositionedObject(RenderBox&); -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r169128 r169189 1963 1963 fragment->setStyle(RenderNamedFlowFragment::createStyle(style())); 1964 1964 1965 if (diff >= StyleDifferenceRepaint) 1966 invalidateLineLayoutPath(); 1967 1965 if (diff >= StyleDifferenceRepaint) { 1966 // FIXME: This could use a cheaper style-only test instead of SimpleLineLayout::canUseFor. 1967 if (selfNeedsLayout() || !m_simpleLineLayout || !SimpleLineLayout::canUseFor(*this)) 1968 invalidateLineLayoutPath(); 1969 } 1970 1968 1971 if (multiColumnFlowThread()) { 1969 1972 for (auto child = firstChildBox(); … … 3391 3394 } 3392 3395 3396 void RenderBlockFlow::invalidateLineLayoutPath() 3397 { 3398 switch (m_lineLayoutPath) { 3399 case UndeterminedPath: 3400 case ForceLineBoxesPath: 3401 ASSERT(!m_simpleLineLayout); 3402 return; 3403 case LineBoxesPath: 3404 ASSERT(!m_simpleLineLayout); 3405 m_lineLayoutPath = UndeterminedPath; 3406 return; 3407 case SimpleLinesPath: 3408 // The simple line layout may have become invalid. 3409 m_simpleLineLayout = nullptr; 3410 setNeedsLayout(); 3411 m_lineLayoutPath = UndeterminedPath; 3412 return; 3413 } 3414 ASSERT_NOT_REACHED(); 3415 } 3416 3393 3417 void RenderBlockFlow::layoutSimpleLines(LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom) 3394 3418 { … … 3413 3437 } 3414 3438 3415 const SimpleLineLayout::Layout* RenderBlockFlow::simpleLineLayout() const3416 {3417 if (m_lineLayoutPath == UndeterminedPath)3418 const_cast<RenderBlockFlow&>(*this).m_lineLayoutPath = SimpleLineLayout::canUseFor(*this) ? SimpleLinesPath : LineBoxesPath;3419 3420 if (m_lineLayoutPath == SimpleLinesPath)3421 return m_simpleLineLayout.get();3422 3423 const_cast<RenderBlockFlow&>(*this).createLineBoxes();3424 return nullptr;3425 }3426 3427 3439 void RenderBlockFlow::ensureLineBoxes() 3428 3440 { 3429 3441 m_lineLayoutPath = ForceLineBoxesPath; 3430 createLineBoxes();3431 }3432 3433 void RenderBlockFlow::createLineBoxes()3434 {3435 ASSERT(m_lineLayoutPath == LineBoxesPath || m_lineLayoutPath == ForceLineBoxesPath);3436 3437 3442 if (!m_simpleLineLayout) 3438 3443 return; -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r169110 r169189 348 348 349 349 virtual bool hasLines() const override final; 350 virtual void invalidateLineLayoutPath() override final; 350 351 351 352 // Helper methods for computing line counts and heights for line counts. … … 525 526 virtual VisiblePosition positionForPointWithInlineChildren(const LayoutPoint& pointInLogicalContents, const RenderRegion*) override; 526 527 virtual void addFocusRingRectsForInlineChildren(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject*) override; 527 528 void createLineBoxes();529 528 530 529 // FIXME-BLOCKFLOW: These methods have implementations in … … 630 629 } 631 630 631 inline const SimpleLineLayout::Layout* RenderBlockFlow::simpleLineLayout() const 632 { 633 ASSERT(m_lineLayoutPath == SimpleLinesPath || !m_simpleLineLayout); 634 return m_simpleLineLayout.get(); 635 } 636 632 637 } // namespace WebCore 633 638
Note: See TracChangeset
for help on using the changeset viewer.