Bug 237369

Summary: [content-visibility] Lazily layout children
Product: WebKit Reporter: Rob Buis <rbuis>
Component: CSSAssignee: Rob Buis <rbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: cathiechen, cdumez, changseok, clopez, cmarcelo, dino, esprehn+autocc, ews-watchlist, fmalita, fred.wang, glenn, gyuyoung.kim, kangil.han, kondapallykalyan, mifenton, ntim, pdr, sabouhallawa, schenney, sergio, simon.fraser, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 236238    
Attachments:
Description Flags
Initial implementation
none
Improved patch
none
Rebase
none
Remove ChangeLogs
none
Fixed-forced-layout-test-failures-wip.diff
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch ews-feeder: commit-queue-

Description Rob Buis 2022-03-02 08:18:38 PST
Support forced layout.
Comment 1 Rob Buis 2022-03-02 08:20:38 PST
Created attachment 453614 [details]
Initial implementation

Initial implementation
Comment 2 Rob Buis 2022-03-02 13:56:51 PST
Created attachment 453656 [details]
Improved patch

Improved patch.
Comment 3 Radar WebKit Bug Importer 2022-03-09 08:19:16 PST
<rdar://problem/90032814>
Comment 4 Rob Buis 2022-04-22 03:10:31 PDT
Created attachment 458128 [details]
Rebase

Rebase
Comment 5 Rob Buis 2022-05-18 07:25:04 PDT
Created attachment 459542 [details]
Remove ChangeLogs

Remove ChangeLogs.
Comment 6 cathiechen 2022-05-26 09:50:51 PDT
Comment on attachment 459542 [details]
Remove ChangeLogs

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

I wonder why Element::offsetTop doesn't need Document::ForceLayout::Yes?

> Source/WebCore/dom/Element.cpp:1283
> +    document().updateLayoutIgnorePendingStylesheets(Document::ForceLayout::Yes);

I wonder why Element::offsetLeft doesn't need Document::ForceLayout::Yes?

> Source/WebCore/dom/Element.cpp:1443
> +    document().updateLayoutIgnorePendingStylesheets(Document::ForceLayout::Yes);

And Element::scrollLeft?
Comment 7 Rob Buis 2022-05-26 09:57:33 PDT
Comment on attachment 459542 [details]
Remove ChangeLogs

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

>> Source/WebCore/dom/Element.cpp:1283
>> +    document().updateLayoutIgnorePendingStylesheets(Document::ForceLayout::Yes);
> 
> I wonder why Element::offsetLeft doesn't need Document::ForceLayout::Yes?

It probably needs it as well, checking chromium. I just did the minimum amount to pass the tests.

>> Source/WebCore/dom/Element.cpp:1443
>> +    document().updateLayoutIgnorePendingStylesheets(Document::ForceLayout::Yes);
> 
> And Element::scrollLeft?

Dito.
Comment 8 cathiechen 2022-06-03 08:29:07 PDT
Created attachment 460015 [details]
Fixed-forced-layout-test-failures-wip.diff

To address the forced layout issues, we need to make sure triggering layout when an element becomes a size containment or vice versa.
Looks like there is no need to change isLayoutForced in layoutContext.
Comment 9 Rob Buis 2022-11-01 07:51:11 PDT
Created attachment 463345 [details]
Patch
Comment 10 Rob Buis 2022-11-02 07:24:49 PDT
Created attachment 463361 [details]
Patch
Comment 11 Rob Buis 2022-11-22 07:36:51 PST
Created attachment 463668 [details]
Patch
Comment 12 Rob Buis 2022-11-23 07:31:05 PST
Created attachment 463692 [details]
Patch
Comment 13 cathiechen 2022-11-23 08:44:20 PST
Comment on attachment 463692 [details]
Patch

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

> Source/WebCore/rendering/style/RenderStyle.cpp:811
> +    if (first.contentVisibility != second.contentVisibility)

// content-visibiliy: hidden enabled contain:size
    if ((static_cast<ContentVisibility>(first.contentVisibility) == ContentVisibility::Hidden) != (static_cast<ContentVisibility>(second.contentVisibility) == ContentVisibility::Hidden))
        return true;
Comment 14 Rob Buis 2022-11-23 11:06:51 PST
Created attachment 463695 [details]
Patch
Comment 15 Rob Buis 2022-11-24 13:57:44 PST
Created attachment 463718 [details]
Patch
Comment 16 Rob Buis 2022-11-25 01:58:40 PST
Created attachment 463723 [details]
Patch
Comment 17 Rob Buis 2022-11-25 03:36:08 PST
Created attachment 463727 [details]
Patch
Comment 18 Rob Buis 2022-11-25 10:20:09 PST
Created attachment 463734 [details]
Patch
Comment 19 Rob Buis 2022-12-01 03:10:37 PST
Created attachment 463827 [details]
Patch
Comment 20 Rob Buis 2022-12-16 01:47:52 PST
Created attachment 464073 [details]
Patch
Comment 21 Rob Buis 2023-01-16 03:33:25 PST
Created attachment 464513 [details]
Patch
Comment 22 Rob Buis 2023-01-16 06:47:01 PST
Created attachment 464514 [details]
Patch
Comment 23 Rob Buis 2023-01-17 02:18:05 PST
Created attachment 464524 [details]
Patch
Comment 24 Rob Buis 2023-01-17 12:24:04 PST
Created attachment 464527 [details]
Patch
Comment 25 EWS Watchlist 2023-01-17 12:38:52 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 26 Rob Buis 2023-01-18 04:19:59 PST
Created attachment 464535 [details]
Patch
Comment 27 Rob Buis 2023-01-18 06:37:10 PST
Pull request: https://github.com/WebKit/WebKit/pull/8763
Comment 28 Rob Buis 2023-01-23 01:47:25 PST
Created attachment 464602 [details]
Patch
Comment 29 Rob Buis 2023-01-29 11:54:24 PST
Created attachment 464745 [details]
Patch
Comment 30 Rob Buis 2023-01-30 13:45:39 PST
Created attachment 464762 [details]
Patch
Comment 31 Rob Buis 2023-01-31 09:19:25 PST
Created attachment 464781 [details]
Patch
Comment 32 Rob Buis 2023-02-02 10:39:03 PST
Pull request: https://github.com/WebKit/WebKit/pull/9537
Comment 33 Rob Buis 2023-02-20 09:34:48 PST
Created attachment 465087 [details]
Patch
Comment 34 Rob Buis 2023-02-20 13:31:42 PST
Created attachment 465094 [details]
Patch
Comment 35 Rob Buis 2023-02-21 02:17:58 PST
Created attachment 465106 [details]
Patch
Comment 36 Tim Nguyen (:ntim) 2023-09-21 10:26:44 PDT
Pull Request: https://github.com/WebKit/WebKit/pull/8763
Comment 37 EWS 2023-09-22 06:47:25 PDT
Committed 268310@main (faa0935aebd5): <https://commits.webkit.org/268310@main>

Reviewed commits have been landed. Closing PR #8763 and removing active labels.