[Webkit-unassigned] [Bug 259576] New: Set logical top and height of table rows and cells in the first layout pass.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 27 13:58:09 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=259576

            Bug ID: 259576
           Summary: Set logical top and height of table rows and cells in
                    the first layout pass.
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Keywords: BrowserCompat
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ahmad.saleem792 at gmail.com
                CC: bfulgham at webkit.org, simon.fraser at apple.com,
                    zalan at apple.com

Hi Team,

While going through Blink's commits, I came across another failing test in Safari Technology Preview 174:

Test Case: https://jsfiddle.net/vpxzfscu/

Blink Commit: https://chromium.googlesource.com/chromium/src.git/+/0f36142505fcc4bc9b2f3518649befd2b5cbc63f

WebKit Changes:

In 'void RenderTableRow::layout()':

.
.
 for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell()) {
+        cell->setLogicalTop(logicalTop());
        if (!cell->needsLayout() && paginated && (layoutState->pageLogicalHeightChanged()
.
.

In 'void RenderTableSection::layout()'

.
.
const Vector<LayoutUnit>& columnPos = table()->columnPositions();
+    LayoutUnit rowLogicalTop;

    for (unsigned r = 0; r < m_grid.size(); ++r) {
        Row& row = m_grid[r].row;
.
.

and

 if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) {
            if (paginated) {
                rowRenderer->setLogicalTop(rowLogicalTop);
                if (rowRenderer->needsLayout())
                    rowRenderer->setChildNeedsLayout(MarkOnlyThis);
            }
            rowRenderer->layoutIfNeeded();
            if (paginated) {
                rowRenderer->setLogicalTop(LayoutUnit(logicalHeightForRow(*rowRenderer)));
                rowLogicalTop = rowRenderer->logicalBottom();
                rowLogicalTop += LayoutUnit(table()->vBorderSpacing());
            }
        }

and

int RenderTableSection::logicalHeightForRow(const RenderTableRow& rowObject) const
{
    unsigned rowIndex = rowObject.rowIndex();
    int logicalHeight = 0;
    const auto& row = m_grid[rowIndex].row;
    unsigned cols = row.size();
    for (unsigned colIndex = 0; colIndex < cols; colIndex++) {
        const auto& cellStruct = cellAt(rowIndex, colIndex);
        const auto* cell = cellStruct.primaryCell();
        if (!cell || cellStruct.inColSpan)
            continue;
        if (cell->rowSpan() == 1) {
            logicalHeight = std::max<int>(logicalHeight, cell->logicalHeightForRowSizing());
        }
        }
    return logicalHeight;
}

___

In 'Source/WebCore/rendering/RenderTableSection.h'

int logicalHeightForRow(const RenderTableRow&) const;

______

Just wanted to raise to get feedback, whether it is right approach or not.

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230727/2c97cbc9/attachment.htm>


More information about the webkit-unassigned mailing list