Changeset 266996 in webkit
- Timestamp:
- Sep 13, 2020 9:46:12 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r266995 r266996 1 2020-09-13 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][Tree building] Table rows may not have any children. 4 https://bugs.webkit.org/show_bug.cgi?id=216456 5 6 Reviewed by Antti Koivisto. 7 8 Cover the case when the table row has no children at all (call numberOfCellsPerRow.append() on evey row when needed). 9 10 * layout/layouttree/LayoutTreeBuilder.cpp: 11 (WebCore::Layout::TreeBuilder::buildTableStructure): 12 1 13 2020-09-13 Zalan Bujtas <zalan@apple.com> 2 14 -
trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp
r266994 r266996 338 338 // Find the max number of columns and fill in the gaps. 339 339 size_t maximumColumns = 0; 340 size_t currentRow = 0; 340 341 Vector<size_t> numberOfCellsPerRow; 341 size_t currentRow = 0;342 342 for (auto& rowBox : childrenOfType<ContainerBox>(tableBody)) { 343 if (numberOfCellsPerRow.size() <= currentRow) { 344 // Ensure we always have a vector entry for the current row -even when the row is empty. 345 numberOfCellsPerRow.append({ }); 346 } 343 347 for (auto& cellBox : childrenOfType<ContainerBox>(rowBox)) { 348 auto numberOfSpannedColumns = cellBox.columnSpan(); 344 349 for (size_t rowSpan = 0; rowSpan < cellBox.rowSpan(); ++rowSpan) { 345 if (numberOfCellsPerRow.size() <= currentRow + rowSpan) 346 numberOfCellsPerRow.append(cellBox.columnSpan()); 347 else 348 numberOfCellsPerRow[currentRow + rowSpan] += cellBox.columnSpan(); 350 auto rowIndexWithSpan = currentRow + rowSpan; 351 if (numberOfCellsPerRow.size() <= rowIndexWithSpan) { 352 // This is where we advance from the current row by having a row spanner. 353 numberOfCellsPerRow.append(numberOfSpannedColumns); 354 continue; 355 } 356 numberOfCellsPerRow[rowIndexWithSpan] += numberOfSpannedColumns; 349 357 } 350 358 }
Note: See TracChangeset
for help on using the changeset viewer.