Bug 263327

Summary: [content-visibility] Optimize lazy layout
Product: WebKit Reporter: Tim Nguyen (:ntim) <ntim>
Component: CSSAssignee: Rob Buis <rbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: rbuis, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Tim Nguyen (:ntim) 2023-10-18 11:37:13 PDT
Lazy layout actually can be slower than normal layout when invoked both on a child and its container at the same time, it invokes 2 or more layouts (or the number of children that layout is queried on + the container). It can be reduced to 1 layout per container at least. I think the code that could be optimized is:

```
	if (context->renderer() && context->renderer()->style().skippedContentReason().has_value())
	    context->renderer()->setNeedsLayout();
```
Comment 1 Radar WebKit Bug Importer 2023-10-18 11:38:05 PDT
<rdar://problem/117149809>
Comment 2 Rob Buis 2023-10-30 04:32:21 PDT
Pull request: https://github.com/WebKit/WebKit/pull/19710
Comment 3 EWS 2024-02-12 14:13:04 PST
Committed 274490@main (58d4460957a8): <https://commits.webkit.org/274490@main>

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