Changeset 287835 in webkit
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r287830 r287835 1 2022-01-10 Antoine Quint <graouts@webkit.org> 2 3 [Web Animations] getKeyframes() for a CSS Animation should not use computed style for keyframes (part 2) 4 https://bugs.webkit.org/show_bug.cgi?id=235028 5 6 Reviewed by Antti Koivisto. 7 8 Mark WPT progressions. 9 10 * web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt: 11 1 12 2022-01-09 Antoine Quint <graouts@webkit.org> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt
r287822 r287835 18 18 PASS KeyframeEffect.getKeyframes() returns expected values for animations with filter properties and missing keyframes 19 19 PASS KeyframeEffect.getKeyframes() returns expected values for animation with drop-shadow of filter property 20 FAIL KeyframeEffect.getKeyframes() returns expected values for animations with text-shadow properties and missing keyframes assert_equals: value for 'textShadow' on Keyframe #0 should match expected "rgb(0, 0, 0) 1px 1px 2px, rgb(0, 0, 255) 0px 0px 16px, rgb(0, 0, 255) 0px 0px 3.2px" but got "rgb(0, 0, 0) 1px 1px 2px, rgb(0, 0, 255) 0px 0px 16px, rgb(0, 0, 255) 0px 0px 3.200000047683716px" 21 FAIL KeyframeEffect.getKeyframes() returns expected values for animations with background-size properties and missing keyframes assert_equals: value for 'backgroundSize' on ComputedKeyframe #0 after updating current style should match expected "30px, 40%, auto" but got "30px" 20 PASS KeyframeEffect.getKeyframes() returns expected values for animations with text-shadow properties and missing keyframes 21 PASS KeyframeEffect.getKeyframes() returns expected values for animations with background-size properties and missing keyframes 22 22 FAIL KeyframeEffect.getKeyframes() returns expected values for animations with CSS variables as keyframe values assert_equals: value for 'transform' on Keyframe #1 should match expected "translate(100px)" but got "matrix(1, 0, 0, 1, 100, 0)" 23 23 PASS KeyframeEffect.getKeyframes() returns expected values for animations with CSS variables as keyframe values in a shorthand property -
trunk/Source/WebCore/ChangeLog
r287834 r287835 1 2022-01-10 Antoine Quint <graouts@webkit.org> 2 3 [Web Animations] getKeyframes() for a CSS Animation should not use computed style for keyframes (part 2) 4 https://bugs.webkit.org/show_bug.cgi?id=235028 5 6 Reviewed by Antti Koivisto. 7 8 In bug 235008, we already improved the situtation by reading from the StyleProperties 9 associated with the StyleRuleKeyframe for CSS Animations. We're now taking the next 10 step by reading from the matching rules for the provided element. 11 12 There is one remaining case where we use the computed style: when the CSSValue uses 13 a CSS variable. To fix the css/css-animations/KeyframeEffect-getKeyframes.tentative.html 14 WPT entirely, we'll need to be able to substitute those in the output. 15 16 * animation/KeyframeEffect.cpp: 17 (WebCore::KeyframeEffect::getKeyframes): 18 1 19 2022-01-10 Nikolas Zimmermann <nzimmermann@igalia.com> 2 20 -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r287827 r287835 666 666 }; 667 667 668 auto styleProperties = MutableStyleProperties::create(); 669 if (m_blendingKeyframesSource == BlendingKeyframesSource::CSSAnimation) { 670 auto matchingRules = m_target->styleResolver().pseudoStyleRulesForElement(target, m_pseudoId, Style::Resolver::AllCSSRules); 671 for (auto& matchedRule : matchingRules) 672 styleProperties->mergeAndOverrideOnConflict(matchedRule->properties()); 673 if (is<StyledElement>(m_target) && m_pseudoId == PseudoId::None) { 674 if (auto* inlineProperties = downcast<StyledElement>(*m_target).inlineStyle()) 675 styleProperties->mergeAndOverrideOnConflict(*inlineProperties); 676 } 677 } 678 668 679 // We need to establish which properties are implicit for 0% and 100%. 669 680 HashSet<CSSPropertyID> zeroKeyframeProperties = computedKeyframes.properties(); … … 693 704 694 705 auto& keyframe = computedKeyframes[i]; 706 auto& style = *keyframe.style(); 707 auto* keyframeRule = keyframeRuleForKey(keyframe.key()); 695 708 696 709 // 2. Set offset, computedOffset, easing members of output keyframe to the respective values keyframe offset, computed keyframe offset, … … 704 717 auto outputKeyframe = convertDictionaryToJS(lexicalGlobalObject, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject), computedKeyframe); 705 718 706 auto addPropertyToKeyframe = [&](CSSPropertyID cssPropertyId , String idlValue) {719 auto addPropertyToKeyframe = [&](CSSPropertyID cssPropertyId) { 707 720 // 1. Let property name be the result of applying the animation property name to IDL attribute name algorithm to the property name of declaration. 708 721 auto propertyName = CSSPropertyIDToIDLAttributeName(cssPropertyId); 709 722 // 2. Let IDL value be the result of serializing the property value of declaration by passing declaration to the algorithm to serialize a CSS value. 710 // 3. Let value be the result of converting IDL value to an ECMAScript String value.711 auto value = toJS<IDLDOMString>(lexicalGlobalObject, idlValue);712 // 4. Call the [[DefineOwnProperty]] internal method on output keyframe with property name property name,713 // Property Descriptor { [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true, [[Value]]: value } and Boolean flag false.714 JSObject::defineOwnProperty(outputKeyframe, &lexicalGlobalObject, AtomString(propertyName).impl(), PropertyDescriptor(value, 0), false);715 };716 717 // 3. For each animation property-value pair specified on keyframe, declaration, perform the following steps:718 auto& style = *keyframe.style();719 auto* keyframeRule = keyframeRuleForKey(keyframe.key());720 for (auto cssPropertyId : keyframe.properties()) {721 if (cssPropertyId == CSSPropertyCustom)722 continue;723 723 String idlValue = ""; 724 724 if (keyframeRule) { … … 729 729 } 730 730 if (idlValue.isEmpty()) { 731 if (auto cssValue = styleProperties->getPropertyCSSValue(cssPropertyId)) { 732 if (!cssValue->hasVariableReferences()) 733 idlValue = styleProperties->getPropertyValue(cssPropertyId); 734 } 735 } 736 if (idlValue.isEmpty()) { 731 737 if (auto cssValue = computedStyleExtractor.valueForPropertyInStyle(style, cssPropertyId, renderer)) 732 738 idlValue = cssValue->cssText(); 733 739 } 734 addPropertyToKeyframe(cssPropertyId, idlValue); 740 // 3. Let value be the result of converting IDL value to an ECMAScript String value. 741 auto value = toJS<IDLDOMString>(lexicalGlobalObject, idlValue); 742 // 4. Call the [[DefineOwnProperty]] internal method on output keyframe with property name property name, 743 // Property Descriptor { [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true, [[Value]]: value } and Boolean flag false. 744 JSObject::defineOwnProperty(outputKeyframe, &lexicalGlobalObject, AtomString(propertyName).impl(), PropertyDescriptor(value, 0), false); 745 }; 746 747 // 3. For each animation property-value pair specified on keyframe, declaration, perform the following steps: 748 for (auto cssPropertyId : keyframe.properties()) { 749 if (cssPropertyId == CSSPropertyCustom) 750 continue; 751 addPropertyToKeyframe(cssPropertyId); 735 752 } 736 753 … … 738 755 if (lastStyleChangeEventStyle) { 739 756 if (!keyframe.key()) { 740 for (auto cssPropertyId : zeroKeyframeProperties) { 741 if (auto cssValue = computedStyleExtractor.valueForPropertyInStyle(*lastStyleChangeEventStyle, cssPropertyId, renderer)) 742 addPropertyToKeyframe(cssPropertyId, cssValue->cssText()); 743 } 757 for (auto cssPropertyId : zeroKeyframeProperties) 758 addPropertyToKeyframe(cssPropertyId); 744 759 zeroKeyframeProperties.clear(); 745 760 } else if (keyframe.key() == 1) { 746 for (auto cssPropertyId : oneKeyframeProperties) { 747 if (auto cssValue = computedStyleExtractor.valueForPropertyInStyle(*lastStyleChangeEventStyle, cssPropertyId, renderer)) 748 addPropertyToKeyframe(cssPropertyId, cssValue->cssText()); 749 } 761 for (auto cssPropertyId : oneKeyframeProperties) 762 addPropertyToKeyframe(cssPropertyId); 750 763 oneKeyframeProperties.clear(); 751 764 }
Note: See TracChangeset
for help on using the changeset viewer.