WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
240906
Make shouldApplyContainment methods more flexible
https://bugs.webkit.org/show_bug.cgi?id=240906
Summary
Make shouldApplyContainment methods more flexible
Rob Buis
Reported
2022-05-25 06:42:54 PDT
In
r293943
some shouldApplyContainment methods were optimised, however they are not flexible enough to deal with the content-visibility feature, which in certain cases can influence containment. So to be flexible use lambdas that return a bool instead of relying on effectiveContainment().
Attachments
Patch
(13.81 KB, patch)
2022-05-25 07:18 PDT
,
Rob Buis
no flags
Details
Formatted Diff
Diff
Patch
(13.49 KB, patch)
2022-05-26 02:18 PDT
,
Rob Buis
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Rob Buis
Comment 1
2022-05-25 07:18:26 PDT
Created
attachment 459757
[details]
Patch
Simon Fraser (smfr)
Comment 2
2022-05-25 13:31:07 PDT
Comment on
attachment 459757
[details]
Patch These functions are hot because they fall into the "containingBlock" code path. Does this affect performance?
Rob Buis
Comment 3
2022-05-25 14:00:55 PDT
(In reply to Simon Fraser (smfr) from
comment #2
)
> Comment on
attachment 459757
[details]
> Patch > > These functions are hot because they fall into the "containingBlock" code > path. Does this affect performance?
Are you thinking of canContainFixedPositionObjects/canContainAbsolutelyPositionedObjects or more? If the lambda's are nicely inlined the performance should be the same, but I never checked efficiency for that (I guess I could try godbold.org tomorrow). An older patch used bool parameters for shouldApplyLayoutOrPaintContainment/shouldApplySizeOrStyleContainment, to me it does not look as nice as lambdas, but it pretty much guarantees same perf as we have now, and it works to support content-visibility later on, so I do not mind using that instead.
Rob Buis
Comment 4
2022-05-26 02:18:17 PDT
Created
attachment 459779
[details]
Patch
Rob Buis
Comment 5
2022-05-26 08:09:13 PDT
(In reply to Rob Buis from
comment #3
)
> (In reply to Simon Fraser (smfr) from
comment #2
) > > Comment on
attachment 459757
[details]
> > Patch > > > > These functions are hot because they fall into the "containingBlock" code > > path. Does this affect performance? > > Are you thinking of > canContainFixedPositionObjects/canContainAbsolutelyPositionedObjects or more? > If the lambda's are nicely inlined the performance should be the same, but I > never checked efficiency for that (I guess I could try godbold.org > tomorrow). An older patch used bool parameters for > shouldApplyLayoutOrPaintContainment/shouldApplySizeOrStyleContainment, to me > it does not look as nice as lambdas, but it pretty much guarantees same perf > as we have now, and it works to support content-visibility later on, so I do > not mind using that instead.
From checking godbolt.org output the lambdas do seem to generate quite some extra instructions, so I changed the patch to use boolean parameters instead.
Radar WebKit Bug Importer
Comment 6
2022-06-01 06:43:13 PDT
<
rdar://problem/94218126
>
Rob Buis
Comment 7
2022-06-08 05:15:20 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/1373
Rob Buis
Comment 8
2022-06-08 05:18:26 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/1374
Rob Buis
Comment 9
2022-07-29 11:28:03 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/2857
Rob Buis
Comment 10
2022-08-10 01:25:55 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/3182
EWS
Comment 11
2022-08-11 00:40:00 PDT
Committed
253324@main
(6c79952a8e99): <
https://commits.webkit.org/253324@main
> Reviewed commits have been landed. Closing PR #3182 and removing active labels.
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