Add styleDuration, layoutDuration, forcedStyleDuration, and forcedLayoutDuration#30
Add styleDuration, layoutDuration, forcedStyleDuration, and forcedLayoutDuration#30
Conversation
|
|
||
| The {{PerformanceScriptTiming/forcedStyleDuration}} attribute's getter step is to return an [=implementation-defined=] value that represents time spent performing style recalculation synchronously (without layout), e.g. by calling {{Window/getComputedStyle()}}. | ||
|
|
||
| Issue: Find a way to make this interoperable/normative. |
There was a problem hiding this comment.
Hmm need a bit more to go on here.
There was a problem hiding this comment.
Thoughts on how we can do that, given the vagueness of the load-bearing "resolved value computed" in https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle?
|
@yoavweiss This would be a bit weird, I think, with some of the new features that interleave style and layout, right? E.g., consider a container query. Should the layout we need to do to figure out the container size be counted as style or layout? Similarly, should the styling we do as a result of a container resize be counted as style or layout? |
I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/34JZ4Z_XPXk Spec PR: w3c/long-animation-frames#30 Change-Id: I7017e3c1ca1443239f19110e708b9841424f666c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7487373 Reviewed-by: Noam Rosenthal <nrosenthal@google.com> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1577858}
I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/34JZ4Z_XPXk Spec PR: w3c/long-animation-frames#30 Change-Id: I7017e3c1ca1443239f19110e708b9841424f666c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7487373 Reviewed-by: Noam Rosenthal <nrosenthal@google.com> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1577858}
I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/34JZ4Z_XPXk Spec PR: w3c/long-animation-frames#30 Change-Id: I7017e3c1ca1443239f19110e708b9841424f666c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7487373 Reviewed-by: Noam Rosenthal <nrosenthal@google.com> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1577858}
…uration, a=testonly Automatic update from web-platform-tests LoAF: add styleDuration and forcedStyleDuration I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/34JZ4Z_XPXk Spec PR: w3c/long-animation-frames#30 Change-Id: I7017e3c1ca1443239f19110e708b9841424f666c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7487373 Reviewed-by: Noam Rosenthal <nrosenthal@google.com> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1577858} -- wpt-commits: 5f73ca676a8df682982723228050896bf8167f84 wpt-pr: 57474
Following a WG discussion on w3c/long-animation-frames#30 The feedback was that layoutDuration exposure is also warranted. This CL implements that. I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/34JZ4Z_XPXk Change-Id: I0b60908e53a394540307a63fb14b7b36eb53fc46 Bug: 476826067 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7544978 Reviewed-by: Scott Haseley <shaseley@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1594478}
Following a WG discussion on w3c/long-animation-frames#30 The feedback was that layoutDuration exposure is also warranted. This CL implements that. I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/34JZ4Z_XPXk Change-Id: I0b60908e53a394540307a63fb14b7b36eb53fc46 Bug: 476826067 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7544978 Reviewed-by: Scott Haseley <shaseley@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1594478}
Following a WG discussion on w3c/long-animation-frames#30 The feedback was that layoutDuration exposure is also warranted. This CL implements that. I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/34JZ4Z_XPXk Change-Id: I0b60908e53a394540307a63fb14b7b36eb53fc46 Bug: 476826067 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7544978 Reviewed-by: Scott Haseley <shaseley@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1594478}
Following a WG discussion on w3c/long-animation-frames#30 The feedback was that layoutDuration exposure is also warranted. This CL implements that. I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/34JZ4Z_XPXk Change-Id: I0b60908e53a394540307a63fb14b7b36eb53fc46 Bug: 476826067 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7544978 Reviewed-by: Scott Haseley <shaseley@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1594478}
I think it should count as layout. If we increased the duration of layout (e.g. by introducing more complex styling outside the container), this number is likely to go up. Therefore it should be accounted for as "layout".
It should count as style, with similar reasoning. |
…nd forcedLayoutDuration, a=testonly Automatic update from web-platform-tests LongAnimationFrame: add layoutDuration and forcedLayoutDuration Following a WG discussion on w3c/long-animation-frames#30 The feedback was that layoutDuration exposure is also warranted. This CL implements that. I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/34JZ4Z_XPXk Change-Id: I0b60908e53a394540307a63fb14b7b36eb53fc46 Bug: 476826067 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7544978 Reviewed-by: Scott Haseley <shaseley@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1594478} -- wpt-commits: b6587948af46aba88921f95e87ddb3622eef40f8 wpt-pr: 58279
This PR adds the
styleDurationandlayoutDurationattributes to PerformanceLongAnimationFrameTiming and theforcedStyleDurationandforcedLayoutDurationattributes to PerformanceScriptTiming.This would enable developers to distinguish between the style calculation times and their layout times, which typically have very distinct reasons, and therefore different solutions.
It also includes a couple of tiny unrelated bikeshed fixes.
Currently developers can collect their overall style+layout costs using something like the following:
This feature will enable developers to collect their overall style calculation time and layout time separately, using:
That would enable them to evaluate e.g. if they need to opt in for cheaper/simpler CSS selectors and reduce their overall number of delivered rules (high style costs), or simplify their DOM structure and
reduce layout-triggering property usage (high layout costs).
Preview | Diff