WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
275394
Fallback to full-layout happens when more than 1 subtree layout is pending
https://bugs.webkit.org/show_bug.cgi?id=275394
Summary
Fallback to full-layout happens when more than 1 subtree layout is pending
Pawel Lampe
Reported
2024-06-12 03:00:32 PDT
Created
attachment 471658
[details]
demo In the demo attached, every few seconds, some elements within element with 'contain:strict' are modified. If layout is forced after each modification, then the subtree-layout is called for given element. However, if layout is forced after a bunch of modifications, the fallback to full-screen layout happens (see
https://github.com/WebKit/WebKit/blob/6a650e644b1ccf02a2aa19f07d5ec4bc706ac8ce/Source/WebCore/page/LocalFrameViewLayoutContext.cpp#L465
). This is probably a bug as in latter case the layout should happen just only for the subtrees.
Attachments
demo
(3.63 KB, text/html)
2024-06-12 03:00 PDT
,
Pawel Lampe
no flags
Details
Even smaller reproduction demo
(1.16 KB, text/html)
2024-06-19 05:08 PDT
,
Pawel Lampe
no flags
Details
Performance test
(2.33 KB, text/html)
2024-06-19 06:20 PDT
,
Pawel Lampe
no flags
Details
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2024-06-19 03:01:19 PDT
<
rdar://problem/130142476
>
Pawel Lampe
Comment 2
2024-06-19 05:08:15 PDT
Created
attachment 471704
[details]
Even smaller reproduction demo Adding even simpler reproduction demo.
Pawel Lampe
Comment 3
2024-06-19 06:20:11 PDT
Created
attachment 471706
[details]
Performance test
Pawel Lampe
Comment 4
2024-06-21 05:53:22 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/30000
Simon Fraser (smfr)
Comment 5
2024-06-24 10:03:30 PDT
Is this known to affect any web sites?
Pawel Lampe
Comment 6
2024-06-24 23:51:57 PDT
In embedded area - yes, a proprietary one. On desktop - yes and no i.e. very likely all the websites that use containment aggressively suffer from this issue, but probably no one noticed (no reports so far) as websites still see some improvement due to subtree layouts happening from time to time just by chances (if only 1 subtree layout is pending for layout).
Ahmad Saleem
Comment 7
2025-01-13 07:20:46 PST
JSFiddle -
https://jsfiddle.net/k6bqf08z/
*** WebKit ToT *** Description: Measures performance of getting offsetHeight of a large grid container. Time: values 202.27560050568894, 200.75282308657455, 197.53086419753075, 199.0049751243779, 195.83843329253386, 200, 200, 199.00497512437812, 198.0198019801978, 201.51133501259446, 201.76544766708747, 202.275600505689, 200.5012531328321, 200.00000000000045, 203.30368487928843, 201.76544766708747, 199.99999999999864, 201.51133501259446, 202.02020202020157, 202.78833967046896 runs/s avg 200.49350594395622 runs/s median 200.62703810970334 runs/s stdev 1.9083282659246983 runs/s min 195.83843329253386 runs/s max 203.30368487928843 runs/s *** Firefox Nightly 136 *** Description: Measures performance of getting offsetHeight of a large grid container. Time: values 7328.244274809161, 7346.938775510204, 7375.16005121639, 7403.598971722365, 7337.579617834395, 7619.047619047619, 7461.139896373057, 7629.139072847682, 7608.982826948481, 7549.148099606815, 7490.247074122237, 7588.932806324111, 7490.247074122237, 7578.9473684210525, 7500, 7490.247074122237, 6781.456953642384, 7209.0112640801, 7413.127413127413, 7413.127413127413 runs/s avg 7430.716182350267 runs/s median 7475.693485247647 runs/s stdev 189.92143020776024 runs/s min 6781.456953642384 runs/s max 7629.139072847682 runs/s *** Chrome Canary 134 *** Time: values 339.97085964075603, 344.4034440352294, 347.7828841135333, 351.8914163624566, 346.9210754550937, 352.3342141691991, 362.97640653340005, 345.67901234528154, 345.97800568440215, 343.6847919478777, 352.0241387987485, 354.60992907776324, 343.43186557103394, 361.43023105753105, 306.55256099104076, 333.57159876161194, 348.86618489964474, 340.50833029354317, 344.318740776309, 349.8250874565161 runs/s avg 345.83803889854863 runs/s median 346.4495405697479 runs/s stdev 11.54487934870227 runs/s min 306.55256099104076 runs/s max 362.97640653340005 runs/s
Pawel Lampe
Comment 8
2025-01-13 07:44:12 PST
@Ahmad Saleem can you also check WebKit ToT + my change (
https://github.com/WebKit/WebKit/pull/30000
)? In my local testing my change makes WebKit to be as fast as firefox
Ahmad Saleem
Comment 9
2025-01-13 10:34:19 PST
(In reply to Pawel Lampe from
comment #8
)
> @Ahmad Saleem can you also check WebKit ToT + my change > (
https://github.com/WebKit/WebKit/pull/30000
)? In my local testing my change > makes WebKit to be as fast as firefox
Sure, will apply it on ToT and check later today or tomorrow. :-)
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug