Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Issue 2895913002: blink/css: Read animation keyframe rules in UA sheets for shadow DOM. (Closed)

Created:
3 years, 7 months ago by Khushal
Modified:
3 years, 6 months ago
Reviewers:
kochi, rune
CC:
chromium-reviews, blink-reviews-style_chromium.org, blink-reviews-css, dglazkov+blink, apavlov+blink_chromium.org, darktears, blink-reviews, rwlbuis
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

blink/css: Read animation keyframe rules in UA sheets for shadow DOM. The keyframe rules declared in UA stylesheets parsed by the CSSDefaultStyleSheets are not available in StyleResolver when querying for these rules. Ideally these rules should be added to the Document's ScopedStyleResolver, with the visibility for rules for the shadow DOM limited to UA provided rules. This change is only a temporary fix. BUG=724975

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -0 lines) Patch
M third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp View 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (3 generated)
Khushal
3 years, 7 months ago (2017-05-22 09:49:46 UTC) #2
rune
Animations (with keyframes) are named. Won't adding them to the UA stylesheet pollute the namespace ...
3 years, 7 months ago (2017-05-22 11:54:42 UTC) #4
Khushal
On 2017/05/22 11:54:42, rune wrote: > Animations (with keyframes) are named. Won't adding them to ...
3 years, 7 months ago (2017-05-22 16:55:11 UTC) #5
kochi
As I suggested in private chat (and rune also suggested in the issue tracker), could ...
3 years, 7 months ago (2017-05-24 10:42:01 UTC) #6
rune
On 2017/05/24 10:42:01, kochi wrote: > As I suggested in private chat (and rune also ...
3 years, 7 months ago (2017-05-24 11:32:33 UTC) #7
rune
On 2017/05/24 11:32:33, rune wrote: > On 2017/05/24 10:42:01, kochi wrote: > > As I ...
3 years, 7 months ago (2017-05-24 11:45:56 UTC) #8
Khushal
On 2017/05/24 11:45:56, rune wrote: > On 2017/05/24 11:32:33, rune wrote: > > On 2017/05/24 ...
3 years, 7 months ago (2017-05-25 02:01:23 UTC) #9
kochi
On 2017/05/25 02:01:23, Khushal wrote: > On 2017/05/24 11:45:56, rune wrote: > > On 2017/05/24 ...
3 years, 7 months ago (2017-05-25 05:43:33 UTC) #10
rune
On 2017/05/25 05:43:33, kochi wrote: > On 2017/05/25 02:01:23, Khushal wrote: > > On 2017/05/24 ...
3 years, 7 months ago (2017-05-25 18:43:26 UTC) #11
kochi
On 2017/05/25 18:43:26, rune wrote: > On 2017/05/25 05:43:33, kochi wrote: > > On 2017/05/25 ...
3 years, 7 months ago (2017-05-25 23:18:00 UTC) #12
rune
On 2017/05/25 05:43:33, kochi wrote: > https://codereview.chromium.org/2898543002/diff/80001/third_party/WebKit/Source/modules/media_controls/elements/MediaControlButtonPromoElements.cpp. > > Cool, thanks! > > rune@ - ...
3 years, 7 months ago (2017-05-26 14:27:53 UTC) #13
kochi
3 years, 6 months ago (2017-05-29 11:21:35 UTC) #14
On 2017/05/26 14:27:53, rune wrote:
> On 2017/05/25 05:43:33, kochi wrote:
> 
> >
>
https://codereview.chromium.org/2898543002/diff/80001/third_party/WebKit/Sour....
> > 
> > Cool, thanks!
> > 
> > rune@ - the odd part of it is that ::-webkit-* pseudo element can be styled
> > as usual element via CSS, and using UA shadow for the pseudo element is an
> > implementation detail. So people wonder why @keyframes doesn't apply to
> > such pseudo elements.
> 
> Do you mean that you can do this from an author sheet:
> 
> ::-webkit-* {
>   animation: my-anim
> }
> 
> But it won't pick up this from the same author sheet?:
> 
> @keyframes my-anim {
> }

Right, the reason that "my-anim" isn't picked up is just Blink's
implementation detail that such pseudo element is implemented
via UA shadow. For some other pseudo elements (e.g. ::after),
animation can be applicable.

> > In that standpoint, this change may not be so bad as I initially thought,
> > though code-wise I think the other CL (putting @keyframes in per-shadow
> > <style>) looks much saner for me for now.
> 
> I'm worried
>
https://codereview.chromium.org/2898543002/diff/80001/third_party/WebKit/Sour...
> causes DCHECK fails in
>
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/resol...

Aha, we need more work :)

> > For UA styles, we may move all styles for those pseudo elements into
> > per-shadow scoped stylesheets, but matching author rules using ::-webkit-*
> > against such UA shadows is very hard to deprecate in a short term.
> 
> Yes. I think limiting the ::-webkit-* syntax to the author-piercing and not
use
> it for the UA styling of the UA shadow is a step in the right direction.
> 
> > So even after we move all styles for pseudo elements in per-shadow
stylesheet,
> > I think the C++ code for matching such rules will not get any cleaner.
> > (as far as I understand, but I could be wrong - Rune knows much better).
> 
> You mean because we still need to pull in the ::-webkit-* piercing rules from
> the outer scope?

Yes, for author sheets.

Powered by Google App Engine
This is Rietveld 408576698