[CSSTransition] Do not list up all properties for transition: all#18054
Conversation
cdumez
left a comment
There was a problem hiding this comment.
Not familiar enough with this code to know if this change is OK.
Source/WebCore/dom/Element.cpp
Outdated
There was a problem hiding this comment.
nit: could be a one liner:
return hasRareData() && elementRareData()->hasAnimations()
Source/WebCore/style/Styleable.cpp
Outdated
|
EWS run on previous version of this PR (hash 793a450) Details
|
793a450 to
0ac729e
Compare
|
EWS run on previous version of this PR (hash 0ac729e) Details
|
|
Still testing. |
0ac729e to
c9ad8e4
Compare
|
EWS run on previous version of this PR (hash c9ad8e4) Details
|
c9ad8e4 to
ed190dd
Compare
|
EWS run on previous version of this PR (hash ed190dd) Details
|
ed190dd to
6e9008f
Compare
|
EWS run on previous version of this PR (hash 6e9008f) Details
|
6e9008f to
fc23ce9
Compare
|
EWS run on previous version of this PR (hash fc23ce9) Details
|
|
I should add transition specific property collector like RenderStyle::diff. And also set KeyframeEffect. So then we can filter out affected ones. |
fc23ce9 to
c44d5bf
Compare
|
EWS run on previous version of this PR (hash c44d5bf) Details
|
7253507 to
2cc1a97
Compare
|
EWS run on previous version of this PR (hash 2cc1a97) Details
|
2cc1a97 to
8298c9b
Compare
|
EWS run on previous version of this PR (hash 8298c9b) Details
|
8298c9b to
4ac71ae
Compare
4ac71ae to
44e015f
Compare
|
EWS run on previous version of this PR (hash 44e015f) Details
|
|
EWS run on previous version of this PR (hash 4ac71ae) Details
|
44e015f to
088b81b
Compare
|
EWS run on previous version of this PR (hash 088b81b) Details
|
There was a problem hiding this comment.
Does this really need a class (struct?) rather than using CSSPropertiesBitSet = WTF::BitSet<numCSSProperties>?
There was a problem hiding this comment.
The reason of this is not adding CSSPropertyNames.h dependency from RenderStyle.h, since numCSSProperties is defined in that header.
There was a problem hiding this comment.
numCSSProperties could be generated to a header of its own.
There was a problem hiding this comment.
Please at least make this a struct and use struct style member naming (withou m_ prefix).
There was a problem hiding this comment.
Thanks, I've changed it to struct for now.
There was a problem hiding this comment.
How does it answer the first question negatively? What happens then?
This really does seem like something that should be autogenerated from CSSProperties.json. It will be difficult to keep it up to date when new properties are added.
There was a problem hiding this comment.
Now, this patch covers all the cases, and removed the fast path. So (1) should be removed, it is always handled in this code.
This really does seem like something that should be autogenerated from CSSProperties.json. It will be difficult to keep it up to date when new properties are added.
It is ideal. But right now, we do not have a mechanism to generate data structures, and RenderStyle::diff is also not doing it. So for now, this patch is aligning the approach to RenderStyle::diff. When introducing a mechanism to solve RenderStyle::diff etc. too, this probably can be organized in the same way.
There was a problem hiding this comment.
Affected how? I think this is more like collectChangedProperties or conservativelyCollectChangedProperties
But I suppose this currently limited to animatable properties so conservativelyCollectChangedAnimatableProperties or something.
There was a problem hiding this comment.
Sounds good. Changed it to conservativelyCollectChangedAnimatableProperties.
There was a problem hiding this comment.
As far as I can tell any missing property here will just fail to animate?
There was a problem hiding this comment.
Yes, for transition all case.
088b81b to
e8ac477
Compare
|
EWS run on previous version of this PR (hash e8ac477) Details
|
e8ac477 to
3e52d82
Compare
|
EWS run on previous version of this PR (hash 3e52d82) Details
|
There was a problem hiding this comment.
please add a FIXME about autogenerating all this.
3e52d82 to
d68e508
Compare
|
EWS run on previous version of this PR (hash d68e508) Details
|
d68e508 to
a6f45ad
Compare
|
EWS run on current version of this PR (hash a6f45ad) Details |
https://bugs.webkit.org/show_bug.cgi?id=261917 rdar://115861030 Reviewed by Antti Koivisto. When `transition: all ...` CSS rule is applied, we end up listing all animatable properties. This is incredibly costly since there are so many CSS properties. And all properties are queried, checked equality via very slow virtual function. Many hash table lookups etc. We found that we are using massive amount of time in this transitioning in Speedometer3/NewsSite-Next / NewsSite-Nuxt. But in almost all cases, almost all properties are not related at all. In this patch, we do RenderStyle comparison and collect all affected CSS properties candidate which needs to be visited in updateCSSTransitions. We can conservatively say "this property needs to be visited". But if we know that this is totally equal, then we can skip that. We cannot use RenderStyle::diff for this purpose. It is highly tailored to rendering purpose. And a lof of properties changes are not reported when it is unrelated to layout (but it is necessary for updateCSSTransitions). Example is `top` / `left`. So instead, we have more tailored path collecting necessary properties in this patch. With this patch, we always collect all possible affected properties. So we no longer need to list up all animatable properties. It results in 0.7% progression in Speedometer3. * Source/WebCore/dom/Element.cpp: (WebCore::Element::hasAnimations const): * Source/WebCore/dom/Element.h: * Source/WebCore/dom/ElementRareData.h: (WebCore::ElementRareData::hasAnimations const): * Source/WebCore/style/Styleable.cpp: (WebCore::Styleable::updateCSSTransitions const): Canonical link: https://commits.webkit.org/268412@main
a6f45ad to
66eb8a0
Compare
|
Committed 268412@main (66eb8a0): https://commits.webkit.org/268412@main Reviewed commits have been landed. Closing PR #18054 and removing active labels. |
66eb8a0
a6f45ad