Changeset 252906 in webkit
- Timestamp:
- Nov 27, 2019 9:01:11 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r252905 r252906 1 2019-11-27 Antti Koivisto <antti@apple.com> 2 3 [LFC][Render tree] RenderBlockFlow::ensureLineBoxes should work with lfc layout 4 https://bugs.webkit.org/show_bug.cgi?id=204633 5 6 Reviewed by Zalan Bujtas. 7 8 We need to be able to switch to linebox layout when needed. 9 10 * rendering/RenderBlockFlow.cpp: 11 (WebCore::RenderBlockFlow::deleteLines): 12 (WebCore::RenderBlockFlow::invalidateLineLayoutPath): 13 (WebCore::RenderBlockFlow::ensureLineBoxes): 14 * rendering/RenderBlockFlow.h: 15 (WebCore::RenderBlockFlow::hasLineLayout const): 16 17 Also switch to using WTF::Monostate as empty state. 18 1 19 2019-11-27 Antti Koivisto <antti@apple.com> 2 20 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r252893 r252906 2122 2122 void RenderBlockFlow::deleteLines() 2123 2123 { 2124 m_lineLayout = nullptr;2124 m_lineLayout = WTF::Monostate(); 2125 2125 2126 2126 RenderBlock::deleteLines(); … … 3634 3634 case SimpleLinesPath: 3635 3635 // The simple line layout may have become invalid. 3636 m_lineLayout = nullptr;3636 m_lineLayout = WTF::Monostate(); 3637 3637 setLineLayoutPath(UndeterminedPath); 3638 3638 if (needsLayout()) … … 3696 3696 setLineLayoutPath(ForceLineBoxesPath); 3697 3697 3698 if ( !simpleLineLayout())3699 return; 3700 3701 auto simpleLineLayout = makeRef (*this->simpleLineLayout());3698 if (complexLineLayout() || !hasLineLayout()) 3699 return; 3700 3701 auto simpleLineLayout = makeRefPtr(this->simpleLineLayout()); 3702 3702 3703 3703 m_lineLayout = makeUnique<ComplexLineLayout>(*this); 3704 3704 3705 if (SimpleLineLayout::canUseForLineBoxTree(*this, simpleLineLayout.get())) { 3706 SimpleLineLayout::generateLineBoxTree(*this, simpleLineLayout.get()); 3707 return; 3705 if (simpleLineLayout) { 3706 if (SimpleLineLayout::canUseForLineBoxTree(*this, *simpleLineLayout)) { 3707 SimpleLineLayout::generateLineBoxTree(*this, *simpleLineLayout); 3708 return; 3709 } 3708 3710 } 3709 3711 … … 3718 3720 LayoutUnit repaintLogicalTop; 3719 3721 LayoutUnit repaintLogicalBottom; 3720 if (simpleLineLayout ->isPaginated()) {3722 if (simpleLineLayout && simpleLineLayout->isPaginated()) { 3721 3723 PaginatedLayoutStateMaintainer state(*this); 3722 3724 complexLineLayout.layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom); -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r252893 r252906 541 541 542 542 private: 543 bool hasLineLayout() const; 543 544 bool hasSimpleLineLayout() const; 544 545 bool hasComplexLineLayout() const; … … 589 590 private: 590 591 Variant< 591 std::nullptr_t,592 WTF::Monostate, 592 593 Ref<SimpleLineLayout::Layout>, 593 594 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) … … 602 603 }; 603 604 605 inline bool RenderBlockFlow::hasLineLayout() const 606 { 607 return !WTF::holds_alternative<WTF::Monostate>(m_lineLayout); 608 } 609 604 610 inline bool RenderBlockFlow::hasComplexLineLayout() const 605 611 {
Note: See TracChangeset
for help on using the changeset viewer.