Changeset 250776 in webkit
- Timestamp:
- Oct 7, 2019 10:28:28 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r250774 r250776 1 2019-10-07 Zalan Bujtas <zalan@apple.com> 2 3 [LFC] Add const version of LayoutState::displayBoxForLayoutBox 4 https://bugs.webkit.org/show_bug.cgi?id=202623 5 <rdar://problem/56025259> 6 7 Reviewed by Antti Koivisto. 8 9 * layout/LayoutState.cpp: 10 (WebCore::Layout::LayoutState::displayBoxForLayoutBox): 11 (WebCore::Layout::LayoutState::displayBoxForLayoutBox const): 12 * layout/LayoutState.h: 13 * layout/layouttree/LayoutTreeBuilder.cpp: 14 (WebCore::Layout::outputLayoutTree): 15 1 16 2019-10-07 youenn fablet <youenn@apple.com> 2 17 -
trunk/Source/WebCore/layout/LayoutState.cpp
r250769 r250776 46 46 } 47 47 48 Display::Box& LayoutState::displayBoxForLayoutBox(const Box& layoutBox) const48 Display::Box& LayoutState::displayBoxForLayoutBox(const Box& layoutBox) 49 49 { 50 50 return *m_layoutToDisplayBox.ensure(&layoutBox, [&layoutBox] { 51 51 return makeUnique<Display::Box>(layoutBox.style()); 52 52 }).iterator->value; 53 } 54 55 const Display::Box& LayoutState::displayBoxForLayoutBox(const Box& layoutBox) const 56 { 57 ASSERT(hasDisplayBox(layoutBox)); 58 return *m_layoutToDisplayBox.get(&layoutBox); 53 59 } 54 60 -
trunk/Source/WebCore/layout/LayoutState.h
r250769 r250776 61 61 #endif 62 62 63 Display::Box& displayBoxForLayoutBox(const Box& layoutBox) const; 63 Display::Box& displayBoxForLayoutBox(const Box& layoutBox); 64 const Display::Box& displayBoxForLayoutBox(const Box& layoutBox) const; 64 65 bool hasDisplayBox(const Box& layoutBox) const { return m_layoutToDisplayBox.contains(&layoutBox); } 65 66 … … 78 79 HashSet<const FormattingContext*> m_formattingContextList; 79 80 #endif 80 mutableHashMap<const Box*, std::unique_ptr<Display::Box>> m_layoutToDisplayBox;81 HashMap<const Box*, std::unique_ptr<Display::Box>> m_layoutToDisplayBox; 81 82 QuirksMode m_quirksMode { QuirksMode::No }; 82 83 }; -
trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp
r250769 r250776 327 327 { 328 328 for (auto& child : childrenOfType<Box>(rootContainer)) { 329 Display::Box* displayBox = nullptr;330 // Not all boxes generate display boxes.331 if (layoutState &&layoutState->hasDisplayBox(child))332 displayBox = &layoutState->displayBoxForLayoutBox(child);333 334 outputLayoutBox(stream, child, displayBox, depth);335 if (layoutState && child.establishesInlineFormattingContext())336 output InlineRuns(stream, *layoutState, downcast<Container>(child), depth + 1);329 if (layoutState) { 330 // Not all boxes generate display boxes. 331 if (layoutState->hasDisplayBox(child)) 332 outputLayoutBox(stream, child, &layoutState->displayBoxForLayoutBox(child), depth); 333 if (child.establishesInlineFormattingContext()) 334 outputInlineRuns(stream, *layoutState, downcast<Container>(child), depth + 1); 335 } else 336 outputLayoutBox(stream, child, nullptr, depth); 337 337 338 338 if (is<Container>(child))
Note: See TracChangeset
for help on using the changeset viewer.