Bug 200654

Summary: [LFC][TFC] Add rowSpan and colSpan to Box
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description zalan 2019-08-12 20:05:42 PDT
they are part of the random DOM things.
Comment 1 Radar WebKit Bug Importer 2019-08-12 20:06:00 PDT
<rdar://problem/54239281>
Comment 2 zalan 2019-08-12 21:08:48 PDT
Created attachment 376135 [details]
Patch
Comment 3 Antti Koivisto 2019-08-13 07:33:11 PDT
Comment on attachment 376135 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=376135&action=review

> Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp:193
> +    if (is<RenderTableCell>(renderer)) {
> +        auto& cellElement = downcast<HTMLTableCellElement>(*renderer.element());
> +        auto rowSpan = cellElement.rowSpan();
> +        if (rowSpan > 1)
> +            childLayoutBox->setRowSpan(rowSpan);
> +
> +        auto columnSpan = cellElement.colSpan();
> +        if (columnSpan > 1)
> +            childLayoutBox->setColumnSpan(columnSpan);
> +    }

You will probably also need invalidation for dynamic changes. See RenderTableCell::colSpanOrRowSpanChanged and callers.
Comment 4 zalan 2019-08-13 07:53:39 PDT
(In reply to Antti Koivisto from comment #3)
> Comment on attachment 376135 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=376135&action=review
> 
> > Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp:193
> > +    if (is<RenderTableCell>(renderer)) {
> > +        auto& cellElement = downcast<HTMLTableCellElement>(*renderer.element());
> > +        auto rowSpan = cellElement.rowSpan();
> > +        if (rowSpan > 1)
> > +            childLayoutBox->setRowSpan(rowSpan);
> > +
> > +        auto columnSpan = cellElement.colSpan();
> > +        if (columnSpan > 1)
> > +            childLayoutBox->setColumnSpan(columnSpan);
> > +    }
> 
> You will probably also need invalidation for dynamic changes. See
> RenderTableCell::colSpanOrRowSpanChanged and callers.
Absolutely. At this point LFC does not deal with incremental changes. Each layout frame starts from scratch.
Comment 5 WebKit Commit Bot 2019-08-13 08:11:59 PDT
Comment on attachment 376135 [details]
Patch

Clearing flags on attachment: 376135

Committed r248594: <https://trac.webkit.org/changeset/248594>
Comment 6 WebKit Commit Bot 2019-08-13 08:12:01 PDT
All reviewed patches have been landed.  Closing bug.