Bug 234872

Summary: Refactor computed style code for transition-property and the transition shorthand
Product: WebKit Reporter: Antoine Quint <graouts>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, dino, esprehn+autocc, ews-watchlist, glenn, graouts, gyuyoung.kim, koivisto, macpherson, menard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=237920
Attachments:
Description Flags
Patch
koivisto: review+, ews-feeder: commit-queue-
Patch for landing none

Description Antoine Quint 2022-01-05 01:20:55 PST
Refactor computed style code for transition-property and the transition shorthand
Comment 1 Antoine Quint 2022-01-05 01:22:17 PST
Created attachment 448366 [details]
Patch
Comment 2 Antti Koivisto 2022-01-05 02:48:23 PST
Comment on attachment 448366 [details]
Patch

looks like some rebasing is needed
Comment 3 Antoine Quint 2022-01-05 05:41:31 PST
Created attachment 448382 [details]
Patch for landing
Comment 4 Darin Adler 2022-01-05 12:57:42 PST
Comment on attachment 448382 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=448382&action=review

> LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:35
> -FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "all 0s ease 0s" but got "transform 1s ease 0s"
> +FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "" but got "transform 1s ease 0s"

Does this change make sense? Why did the *expected* value change?
Comment 5 Antoine Quint 2022-01-05 13:44:19 PST
(In reply to Darin Adler from comment #4)
> Comment on attachment 448382 [details]
> Patch for landing
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448382&action=review
> 
> > LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:35
> > -FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "all 0s ease 0s" but got "transform 1s ease 0s"
> > +FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "" but got "transform 1s ease 0s"
> 
> Does this change make sense? Why did the *expected* value change?

I'll double check, but I think the expected string is created dynamically by getting the computed style of a non-pseudo element, which would explain this behavior.
Comment 6 Antoine Quint 2022-01-05 13:48:52 PST
(In reply to Antoine Quint from comment #5)
> (In reply to Darin Adler from comment #4)
> > Comment on attachment 448382 [details]
> > Patch for landing
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=448382&action=review
> > 
> > > LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:35
> > > -FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "all 0s ease 0s" but got "transform 1s ease 0s"
> > > +FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "" but got "transform 1s ease 0s"
> > 
> > Does this change make sense? Why did the *expected* value change?
> 
> I'll double check, but I think the expected string is created dynamically by
> getting the computed style of a non-pseudo element, which would explain this
> behavior.

Precisely:

    const target = document.querySelector("#target");
    var defaultComputedStyle = getComputedStyle(target);

I'll take a look at making this test pass as well.
Comment 7 EWS 2022-01-05 18:56:27 PST
Committed r287669 (245766@main): <https://commits.webkit.org/245766@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448382 [details].
Comment 8 Radar WebKit Bug Importer 2022-01-05 18:57:19 PST
<rdar://problem/87176839>
Comment 9 Antoine Quint 2022-03-17 10:53:52 PDT
(In reply to Antoine Quint from comment #6)
> (In reply to Antoine Quint from comment #5)
> > (In reply to Darin Adler from comment #4)
> > > Comment on attachment 448382 [details]
> > > Patch for landing
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=448382&action=review
> > > 
> > > > LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:35
> > > > -FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "all 0s ease 0s" but got "transform 1s ease 0s"
> > > > +FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "" but got "transform 1s ease 0s"
> > > 
> > > Does this change make sense? Why did the *expected* value change?
> > 
> > I'll double check, but I think the expected string is created dynamically by
> > getting the computed style of a non-pseudo element, which would explain this
> > behavior.
> 
> Precisely:
> 
>     const target = document.querySelector("#target");
>     var defaultComputedStyle = getComputedStyle(target);
> 
> I'll take a look at making this test pass as well.

So this actually caused a regression in iOS 15.4 (bug 237920), all because I wasn't thorough enough in my analysis of why this test's failing output changed. I added some more explicit WPT coverage so we don't end up in this kind of situation again.