Bug 263327 - [content-visibility] Optimize lazy layout
Summary: [content-visibility] Optimize lazy layout
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-18 11:37 PDT by Tim Nguyen (:ntim)
Modified: 2024-02-12 14:13 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.