Changeset 263639 in webkit
- Timestamp:
- Jun 28, 2020 5:00:58 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r263638 r263639 1 2020-06-28 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][Painting] Use the table section as the paint container for table cells 4 https://bugs.webkit.org/show_bug.cgi?id=213693 5 6 Reviewed by Antti Koivisto. 7 8 The cell's containing block is the table box (skipping both the row and the section), 9 but it's positioned relative to the table section. 10 11 Let's skip the row and go right to the section box when painting the cells. 12 13 * layout/displaytree/DisplayPainter.cpp: 14 (WebCore::Display::absoluteDisplayBox): 15 1 16 2020-06-28 Alexey Shvayka <shvaikalesh@gmail.com> 2 17 -
trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp
r258904 r263639 142 142 } 143 143 144 static Box absoluteDisplayBox(const Layout::LayoutState& layoutState, const Layout::Box& layoutBox )144 static Box absoluteDisplayBox(const Layout::LayoutState& layoutState, const Layout::Box& layoutBoxToPaint) 145 145 { 146 146 // Should never really happen but table code is way too incomplete. 147 if (!layoutState.hasDisplayBox(layoutBox ))147 if (!layoutState.hasDisplayBox(layoutBoxToPaint)) 148 148 return { }; 149 if (is<Layout::InitialContainingBlock>(layoutBox)) 150 return layoutState.displayBoxForLayoutBox(layoutBox); 151 152 auto absoluteBox = Box { layoutState.displayBoxForLayoutBox(layoutBox) }; 153 for (auto* containingBlock = &layoutBox.containingBlock(); !is<Layout::InitialContainingBlock>(*containingBlock); containingBlock = &containingBlock->containingBlock()) 154 absoluteBox.moveBy(layoutState.displayBoxForLayoutBox(*containingBlock).topLeft()); 149 if (is<Layout::InitialContainingBlock>(layoutBoxToPaint)) 150 return layoutState.displayBoxForLayoutBox(layoutBoxToPaint); 151 152 auto paintContainer = [&] (const auto& layoutBox) { 153 if (layoutBox.isTableCell()) { 154 // The table cell's containing block is the table box (skipping both the row and the section), but it's positioned relative to the table section. 155 // Let's skip the row and go right to the section box. 156 return &layoutBox.parent().parent(); 157 } 158 return &layoutBox.containingBlock(); 159 }; 160 auto absoluteBox = Box { layoutState.displayBoxForLayoutBox(layoutBoxToPaint) }; 161 for (auto* container = paintContainer(layoutBoxToPaint); !is<Layout::InitialContainingBlock>(container); container = paintContainer(*container)) 162 absoluteBox.moveBy(layoutState.displayBoxForLayoutBox(*container).topLeft()); 155 163 return absoluteBox; 156 164 }
Note: See TracChangeset
for help on using the changeset viewer.