Changeset 288882 in webkit


Ignore:
Timestamp:
Feb 1, 2022 8:53:24 AM (6 months ago)
Author:
graouts@webkit.org
Message:

Redefining @keyframes does not work
https://bugs.webkit.org/show_bug.cgi?id=229437
<rdar://problem/82563372>

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Add a new test that reproduces the test content submitted with the bug report where
a <style> element containing a @keyframes rule with a given name is replaced with
another <style> element containing another @keyframes rule with the same name
but different keyframes. The test checks that the animation correctly uses the new
keyframes when querying the computed style.

We also get a fair few new PASS results on a ::marker animation test since that test
sets the textContent for a shared <style> element with generated @keyframes rules.

  • web-platform-tests/css/css-animations/animation-style-element-replaced-with-keyframes-rule-of-same-name-expected.txt: Added.
  • web-platform-tests/css/css-animations/animation-style-element-replaced-with-keyframes-rule-of-same-name.html: Added.
  • web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:

Source/WebCore:

Notify the document upon insertion of a new @keyframes rule such that any running CSS Animation
using that rule name may update its computed keyframes.

Test: imported/w3c/web-platform-tests/css/css-animations/animation-style-element-replaced-with-keyframes-rule-of-same-name.html

  • style/StyleResolver.cpp:

(WebCore::Style::Resolver::addKeyframeStyle):

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r288879 r288882  
     12022-02-01  Antoine Quint  <graouts@webkit.org>
     2
     3        Redefining @keyframes does not work
     4        https://bugs.webkit.org/show_bug.cgi?id=229437
     5        <rdar://problem/82563372>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Add a new test that reproduces the test content submitted with the bug report where
     10        a <style> element containing a @keyframes rule with a given name is replaced with
     11        another <style> element containing another @keyframes rule with the same name
     12        but different keyframes. The test checks that the animation correctly uses the new
     13        keyframes when querying the computed style.
     14
     15        We also get a fair few new PASS results on a ::marker animation test since that test
     16        sets the `textContent` for a shared `<style>` element with generated @keyframes rules.
     17
     18        * web-platform-tests/css/css-animations/animation-style-element-replaced-with-keyframes-rule-of-same-name-expected.txt: Added.
     19        * web-platform-tests/css/css-animations/animation-style-element-replaced-with-keyframes-rule-of-same-name.html: Added.
     20        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
     21
    1222022-02-01  Oriol Brufau  <obrufau@igalia.com>
    223
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt

    r288009 r288882  
    2020PASS Animation of font-weight in ::marker
    2121PASS Animation of line-height in ::marker
    22 FAIL Animation of white-space in ::marker assert_equals: expected "nowrap" but got "pre"
    23 FAIL Animation of color in ::marker assert_equals: expected "rgb(50, 150, 100)" but got "rgb(0, 0, 0)"
     22PASS Animation of white-space in ::marker
     23PASS Animation of color in ::marker
    2424PASS Animation of text-combine-upright in ::marker
    2525PASS Animation of unicode-bidi in ::marker
    2626PASS Animation of direction in ::marker
    27 FAIL Animation of content in ::marker assert_equals: expected "\"bar\"" but got "normal"
     27PASS Animation of content in ::marker
    2828FAIL Animation of hyphens in ::marker assert_true: hyphens doesn't seem to be supported in the computed style expected true got false
    29 FAIL Animation of letter-spacing in ::marker assert_equals: expected "10px" but got "normal"
     29PASS Animation of letter-spacing in ::marker
    3030FAIL Animation of line-break in ::marker assert_equals: expected "anywhere" but got "auto"
    31 FAIL Animation of overflow-wrap in ::marker assert_equals: expected "anywhere" but got "normal"
    32 FAIL Animation of tab-size in ::marker assert_equals: expected "10px" but got "8"
    33 FAIL Animation of text-transform in ::marker assert_equals: expected "uppercase" but got "none"
    34 FAIL Animation of word-break in ::marker assert_equals: expected "break-word" but got "normal"
    35 FAIL Animation of word-spacing in ::marker assert_equals: expected "10px" but got "0px"
     31PASS Animation of overflow-wrap in ::marker
     32PASS Animation of tab-size in ::marker
     33PASS Animation of text-transform in ::marker
     34PASS Animation of word-break in ::marker
     35PASS Animation of word-spacing in ::marker
    3636FAIL Animation of text-decoration-skip-ink in ::marker assert_equals: expected "none" but got "auto"
    3737FAIL Animation of text-emphasis in ::marker assert_equals: expected "triangle rgb(50, 100, 100)" but got ""
    38 FAIL Animation of text-emphasis-color in ::marker assert_equals: expected "rgb(50, 100, 100)" but got "rgb(0, 0, 0)"
    39 FAIL Animation of text-emphasis-position in ::marker assert_equals: expected "under left" but got "over right"
     38FAIL Animation of text-emphasis-color in ::marker assert_equals: expected "rgb(50, 100, 100)" but got "rgb(100, 0, 200)"
     39PASS Animation of text-emphasis-position in ::marker
    4040FAIL Animation of text-emphasis-style in ::marker assert_equals: expected "triangle" but got "none"
    41 FAIL Animation of text-shadow in ::marker assert_equals: expected "rgb(50, 100, 100) 2px 2px 2px" but got "none"
     41PASS Animation of text-shadow in ::marker
    4242PASS Animation of display in ::marker
    4343PASS Animation of position in ::marker
  • trunk/Source/WebCore/ChangeLog

    r288881 r288882  
     12022-02-01  Antoine Quint  <graouts@webkit.org>
     2
     3        Redefining @keyframes does not work
     4        https://bugs.webkit.org/show_bug.cgi?id=229437
     5        <rdar://problem/82563372>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Notify the document upon insertion of a new @keyframes rule such that any running CSS Animation
     10        using that rule name may update its computed keyframes.
     11
     12        Test: imported/w3c/web-platform-tests/css/css-animations/animation-style-element-replaced-with-keyframes-rule-of-same-name.html
     13
     14        * style/StyleResolver.cpp:
     15        (WebCore::Style::Resolver::addKeyframeStyle):
     16
    1172022-02-01  Antoine Quint  <graouts@webkit.org>
    218
  • trunk/Source/WebCore/style/StyleResolver.cpp

    r288571 r288882  
    196196void Resolver::addKeyframeStyle(Ref<StyleRuleKeyframes>&& rule)
    197197{
    198     AtomString s(rule->name());
    199     m_keyframesRuleMap.set(s.impl(), WTFMove(rule));
     198    AtomString animationName(rule->name());
     199    m_keyframesRuleMap.set(animationName.impl(), WTFMove(rule));
     200    m_document.keyframesRuleDidChange(animationName);
    200201}
    201202
Note: See TracChangeset for help on using the changeset viewer.