Changeset 287534 in webkit
- Timestamp:
- Jan 3, 2022 2:00:53 AM (7 months ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/longhand-overrides-shorthand-prefixing.html (modified) (1 diff)
-
LayoutTests/fast/css/transform-inline-style-remove-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-shorthand-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-valid-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/style-animation-parsing-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSComputedStyleDeclaration.cpp (modified) (10 diffs)
-
Source/WebCore/css/CSSComputedStyleDeclaration.h (modified) (2 diffs)
-
Source/WebCore/css/parser/CSSPropertyParser.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r287532 r287534 1 2022-01-02 Antoine Quint <graouts@webkit.org> 2 3 "animation" shorthand should list all longhand values when serializing 4 https://bugs.webkit.org/show_bug.cgi?id=234792 5 6 Reviewed by Darin Adler. 7 8 Add the initial longhand values for some non-WPT tests that expected them to be 9 absent in the shorthand serialization. 10 11 * fast/css/longhand-overrides-shorthand-prefixing.html: 12 * fast/css/transform-inline-style-remove-expected.txt: 13 1 14 2022-01-03 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/LayoutTests/fast/css/longhand-overrides-shorthand-prefixing.html
r287509 r287534 64 64 } 65 65 66 testPropertyVariants("animation", "animation-duration", "2s move", "10s move", "10s");66 testPropertyVariants("animation", "animation-duration", "2s move", "10s ease 0s 1 normal none running move", "10s"); 67 67 68 68 successfullyParsed = true; -
trunk/LayoutTests/fast/css/transform-inline-style-remove-expected.txt
r287509 r287534 20 20 transform origin Y (after): 21 21 22 animation (before): 5s ease-in-out infinite alternatetest22 animation (before): 5s ease-in-out 0s infinite alternate none running test 23 23 animation name (before): test 24 24 animation duration (before): 5s -
trunk/LayoutTests/imported/w3c/ChangeLog
r287524 r287534 1 2022-01-02 Antoine Quint <graouts@webkit.org> 2 3 "animation" shorthand should list all longhand values when serializing 4 https://bugs.webkit.org/show_bug.cgi?id=234792 5 6 Reviewed by Darin Adler. 7 8 Mark 20 new WPT progressions. 9 10 * web-platform-tests/css/css-animations/parsing/animation-shorthand-expected.txt: 11 * web-platform-tests/css/css-animations/parsing/animation-valid-expected.txt: 12 * web-platform-tests/css/css-animations/style-animation-parsing-expected.txt: 13 1 14 2022-01-02 Antoine Quint <graouts@webkit.org> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-shorthand-expected.txt
r277053 r287534 10 10 PASS e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-timing-function 11 11 PASS e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should not set unrelated longhands 12 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-delay assert_equals: animation-delay should be canonical expected "0s, -3s" but got "initial, -3s" 13 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-direction assert_equals: animation-direction should be canonical expected "reverse, normal" but got "reverse, initial" 14 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-duration assert_equals: animation-duration should be canonical expected "0s, 1s" but got "initial, 1s" 15 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-fill-mode assert_equals: animation-fill-mode should be canonical expected "both, none" but got "both, initial" 16 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-iteration-count assert_equals: animation-iteration-count should be canonical expected "1, 4" but got "initial, 4" 17 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-name assert_equals: animation-name should be canonical expected "anim, none" but got "anim, initial" 18 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-play-state assert_equals: animation-play-state should be canonical expected "paused, running" but got "paused, initial" 12 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-delay 13 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-direction 14 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-duration 15 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-fill-mode 16 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-iteration-count 17 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-name 18 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-play-state 19 19 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-timeline assert_equals: animation-timeline should be canonical expected (string) "auto, auto" but got (undefined) undefined 20 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-timing-function assert_equals: animation-timing-function should be canonical expected "ease, cubic-bezier(0, -2, 1, 3)" but got "initial, cubic-bezier(0, -2, 1, 3)" 20 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-timing-function 21 21 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should not set unrelated longhands 22 FAIL e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-delay assert_equals: animation-delay should be canonical expected "-3s, 0s" but got "-3s, initial" 23 FAIL e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-direction assert_equals: animation-direction should be canonical expected "normal, reverse" but got "initial, reverse" 24 FAIL e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-duration assert_equals: animation-duration should be canonical expected "1s, 0s" but got "1s, initial" 25 FAIL e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-fill-mode assert_equals: animation-fill-mode should be canonical expected "none, both" but got "initial, both" 26 FAIL e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-iteration-count assert_equals: animation-iteration-count should be canonical expected "4, 1" but got "4, initial" 27 FAIL e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-name assert_equals: animation-name should be canonical expected "none, anim" but got "initial, anim" 28 FAIL e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-play-state assert_equals: animation-play-state should be canonical expected "running, paused" but got "initial, paused" 22 PASS e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-delay 23 PASS e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-direction 24 PASS e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-duration 25 PASS e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-fill-mode 26 PASS e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-iteration-count 27 PASS e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-name 28 PASS e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-play-state 29 29 FAIL e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-timeline assert_equals: animation-timeline should be canonical expected (string) "auto, auto" but got (undefined) undefined 30 FAIL e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-timing-function assert_equals: animation-timing-function should be canonical expected "cubic-bezier(0, -2, 1, 3), ease" but got "cubic-bezier(0, -2, 1, 3), initial" 30 PASS e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-timing-function 31 31 PASS e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should not set unrelated longhands 32 32 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-valid-expected.txt
r287509 r287534 10 10 PASS e.style['animation'] = "anim" should set the property value 11 11 PASS e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set the property value 12 FAIL e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set the property value assert_equals: serialization should be canonical expected "0s ease 0s 1 reverse both paused anim, 1s cubic-bezier(0, -2, 1, 3) -3s 4 normal none running none" but got "reverse both paused anim, 1s cubic-bezier(0, -2, 1, 3) -3s 4" 12 PASS e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set the property value 13 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/style-animation-parsing-expected.txt
r267650 r287534 2 2 PASS Test animation name being empty. 3 3 PASS Test a non-conflicting animation name. 4 FAIL Test an animation name that is the same as a possible animation fill-mode. assert_equals: style1.animationName expected "none" but got "initial" 5 FAIL Test an animation name that is the same as a possible animation direction. assert_equals: style1.animationName expected "none" but got "initial" 6 FAIL Test an animation name that is the same as a possible running state. assert_equals: style1.animationName expected "none" but got "initial" 4 PASS Test an animation name that is the same as a possible animation fill-mode. 5 PASS Test an animation name that is the same as a possible animation direction. 6 PASS Test an animation name that is the same as a possible running state. 7 7 -
trunk/Source/WebCore/ChangeLog
r287533 r287534 1 2022-01-02 Antoine Quint <graouts@webkit.org> 2 3 "animation" shorthand should list all longhand values when serializing 4 https://bugs.webkit.org/show_bug.cgi?id=234792 5 6 Reviewed by Darin Adler. 7 8 Currently we omit any initial value when serializing the "animation" shorthand. However, 9 the CSS Animations spec says: 10 11 Note that order is also important within each animation definition for distinguishing 12 <keyframes-name> values from other keywords. When parsing, keywords that are valid for 13 properties other than animation-name whose values were not found earlier in the shorthand 14 must be accepted for those properties rather than for animation-name. Furthermore, when 15 serializing, default values of other properties must be output in at least the cases 16 necessary to distinguish an animation-name that could be a value of another property, 17 and may be output in additional cases. 18 19 Both Firefox and Chrome always include all longhand values when querying the inline style, 20 such that <div style="animation: none"> yields "0s ease 0s 1 normal none running none" for 21 element.style.animation. Currently, Safari only outputs "none". 22 23 When parsing the "animation" shorthand in consumeAnimationShorthand(), we now fill in initial 24 values as if they were explicitly set to their initial value, for instance duration is set to 25 "0s". 26 27 To do this, we refactored code in CSSComputedStyleDeclaration.cpp that dealt with the creation 28 of CSSValue from various values exposed on Animation such that it may be called from within 29 CSSPropertyParser.cpp. 30 31 * css/CSSComputedStyleDeclaration.cpp: 32 (WebCore::ComputedStyleExtractor::valueForAnimationDuration): 33 (WebCore::ComputedStyleExtractor::valueForAnimationDelay): 34 (WebCore::ComputedStyleExtractor::valueForAnimationIterationCount): 35 (WebCore::ComputedStyleExtractor::valueForAnimationDirection): 36 (WebCore::ComputedStyleExtractor::valueForAnimationFillMode): 37 (WebCore::ComputedStyleExtractor::valueForAnimationPlayState): 38 (WebCore::ComputedStyleExtractor::valueForAnimationName): 39 (WebCore::delayValue): 40 (WebCore::durationValue): 41 (WebCore::ComputedStyleExtractor::valueForAnimationTimingFunction): 42 (WebCore::timingFunctionValue): 43 (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): 44 (WebCore::createTimingFunctionValue): Deleted. 45 * css/CSSComputedStyleDeclaration.h: 46 * css/parser/CSSPropertyParser.cpp: 47 (WebCore::CSSPropertyParser::consumeAnimationShorthand): 48 1 49 2022-01-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 50 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r287487 r287534 1346 1346 } 1347 1347 1348 Ref<CSSPrimitiveValue> ComputedStyleExtractor::valueForAnimationDuration(double duration) 1349 { 1350 return CSSValuePool::singleton().createValue(duration, CSSUnitType::CSS_S); 1351 } 1352 1353 Ref<CSSPrimitiveValue> ComputedStyleExtractor::valueForAnimationDelay(double delay) 1354 { 1355 return CSSValuePool::singleton().createValue(delay, CSSUnitType::CSS_S); 1356 } 1357 1358 Ref<CSSPrimitiveValue> ComputedStyleExtractor::valueForAnimationIterationCount(double iterationCount) 1359 { 1360 if (iterationCount == Animation::IterationCountInfinite) 1361 return CSSValuePool::singleton().createIdentifierValue(CSSValueInfinite); 1362 return CSSValuePool::singleton().createValue(iterationCount, CSSUnitType::CSS_NUMBER); 1363 } 1364 1365 Ref<CSSPrimitiveValue> ComputedStyleExtractor::valueForAnimationDirection(Animation::AnimationDirection direction) 1366 { 1367 switch (direction) { 1368 case Animation::AnimationDirectionNormal: 1369 return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal); 1370 case Animation::AnimationDirectionAlternate: 1371 return CSSValuePool::singleton().createIdentifierValue(CSSValueAlternate); 1372 case Animation::AnimationDirectionReverse: 1373 return CSSValuePool::singleton().createIdentifierValue(CSSValueReverse); 1374 case Animation::AnimationDirectionAlternateReverse: 1375 return CSSValuePool::singleton().createIdentifierValue(CSSValueAlternateReverse); 1376 } 1377 } 1378 1379 Ref<CSSPrimitiveValue> ComputedStyleExtractor::valueForAnimationFillMode(AnimationFillMode fillMode) 1380 { 1381 switch (fillMode) { 1382 case AnimationFillMode::None: 1383 return CSSValuePool::singleton().createIdentifierValue(CSSValueNone); 1384 case AnimationFillMode::Forwards: 1385 return CSSValuePool::singleton().createIdentifierValue(CSSValueForwards); 1386 case AnimationFillMode::Backwards: 1387 return CSSValuePool::singleton().createIdentifierValue(CSSValueBackwards); 1388 case AnimationFillMode::Both: 1389 return CSSValuePool::singleton().createIdentifierValue(CSSValueBoth); 1390 } 1391 } 1392 1393 Ref<CSSPrimitiveValue> ComputedStyleExtractor::valueForAnimationPlayState(AnimationPlayState playState) 1394 { 1395 switch (playState) { 1396 case AnimationPlayState::Playing: 1397 return CSSValuePool::singleton().createIdentifierValue(CSSValueRunning); 1398 case AnimationPlayState::Paused: 1399 return CSSValuePool::singleton().createIdentifierValue(CSSValuePaused); 1400 } 1401 } 1402 1403 Ref<CSSPrimitiveValue> ComputedStyleExtractor::valueForAnimationName(const Animation::Name& name) 1404 { 1405 if (name.isIdentifier) 1406 return CSSValuePool::singleton().createCustomIdent(name.string); 1407 return CSSValuePool::singleton().createValue(name.string, CSSUnitType::CSS_STRING); 1408 } 1409 1348 1410 static Ref<CSSValueList> delayValue(const AnimationList* animationList) 1349 1411 { 1350 auto& cssValuePool = CSSValuePool::singleton();1351 1412 auto list = CSSValueList::createCommaSeparated(); 1352 1413 if (animationList) { 1353 1414 for (size_t i = 0; i < animationList->size(); ++i) 1354 list->append( cssValuePool.createValue(animationList->animation(i).delay(), CSSUnitType::CSS_S));1415 list->append(ComputedStyleExtractor::valueForAnimationDelay(animationList->animation(i).delay())); 1355 1416 } else { 1356 1417 // Note that initialAnimationDelay() is used for both transitions and animations 1357 list->append( cssValuePool.createValue(Animation::initialDelay(), CSSUnitType::CSS_S));1418 list->append(ComputedStyleExtractor::valueForAnimationDelay(Animation::initialDelay())); 1358 1419 } 1359 1420 return list; … … 1362 1423 static Ref<CSSValueList> durationValue(const AnimationList* animationList) 1363 1424 { 1364 auto& cssValuePool = CSSValuePool::singleton();1365 1425 auto list = CSSValueList::createCommaSeparated(); 1366 1426 if (animationList) { 1367 1427 for (size_t i = 0; i < animationList->size(); ++i) 1368 list->append( cssValuePool.createValue(animationList->animation(i).duration(), CSSUnitType::CSS_S));1428 list->append(ComputedStyleExtractor::valueForAnimationDuration(animationList->animation(i).duration())); 1369 1429 } else { 1370 1430 // Note that initialAnimationDuration() is used for both transitions and animations 1371 list->append( cssValuePool.createValue(Animation::initialDuration(), CSSUnitType::CSS_S));1431 list->append(ComputedStyleExtractor::valueForAnimationDuration(Animation::initialDuration())); 1372 1432 } 1373 1433 return list; 1374 1434 } 1375 1435 1376 static Ref<CSSValue> createTimingFunctionValue(const TimingFunction& timingFunction)1436 Ref<CSSValue> ComputedStyleExtractor::valueForAnimationTimingFunction(const TimingFunction& timingFunction) 1377 1437 { 1378 1438 switch (timingFunction.type()) { … … 1419 1479 if (animationList) { 1420 1480 for (size_t i = 0; i < animationList->size(); ++i) 1421 list->append( createTimingFunctionValue(*animationList->animation(i).timingFunction()));1481 list->append(ComputedStyleExtractor::valueForAnimationTimingFunction(*animationList->animation(i).timingFunction())); 1422 1482 } else 1423 1483 // Note that initialAnimationTimingFunction() is used for both transitions and animations 1424 list->append( createTimingFunctionValue(Animation::initialTimingFunction()));1484 list->append(ComputedStyleExtractor::valueForAnimationTimingFunction(Animation::initialTimingFunction())); 1425 1485 return list; 1426 1486 } … … 3513 3573 const AnimationList* t = style.animations(); 3514 3574 if (t) { 3515 for (size_t i = 0; i < t->size(); ++i) { 3516 switch (t->animation(i).direction()) { 3517 case Animation::AnimationDirectionNormal: 3518 list->append(cssValuePool.createIdentifierValue(CSSValueNormal)); 3519 break; 3520 case Animation::AnimationDirectionAlternate: 3521 list->append(cssValuePool.createIdentifierValue(CSSValueAlternate)); 3522 break; 3523 case Animation::AnimationDirectionReverse: 3524 list->append(cssValuePool.createIdentifierValue(CSSValueReverse)); 3525 break; 3526 case Animation::AnimationDirectionAlternateReverse: 3527 list->append(cssValuePool.createIdentifierValue(CSSValueAlternateReverse)); 3528 break; 3529 } 3530 } 3575 for (size_t i = 0; i < t->size(); ++i) 3576 list->append(valueForAnimationDirection(t->animation(i).direction())); 3531 3577 } else 3532 3578 list->append(cssValuePool.createIdentifierValue(CSSValueNormal)); … … 3539 3585 const AnimationList* t = style.animations(); 3540 3586 if (t) { 3541 for (size_t i = 0; i < t->size(); ++i) { 3542 switch (t->animation(i).fillMode()) { 3543 case AnimationFillMode::None: 3544 list->append(cssValuePool.createIdentifierValue(CSSValueNone)); 3545 break; 3546 case AnimationFillMode::Forwards: 3547 list->append(cssValuePool.createIdentifierValue(CSSValueForwards)); 3548 break; 3549 case AnimationFillMode::Backwards: 3550 list->append(cssValuePool.createIdentifierValue(CSSValueBackwards)); 3551 break; 3552 case AnimationFillMode::Both: 3553 list->append(cssValuePool.createIdentifierValue(CSSValueBoth)); 3554 break; 3555 } 3556 } 3587 for (size_t i = 0; i < t->size(); ++i) 3588 list->append(valueForAnimationFillMode(t->animation(i).fillMode())); 3557 3589 } else 3558 3590 list->append(cssValuePool.createIdentifierValue(CSSValueNone)); … … 3563 3595 const AnimationList* t = style.animations(); 3564 3596 if (t) { 3565 for (size_t i = 0; i < t->size(); ++i) { 3566 double iterationCount = t->animation(i).iterationCount(); 3567 if (iterationCount == Animation::IterationCountInfinite) 3568 list->append(cssValuePool.createIdentifierValue(CSSValueInfinite)); 3569 else 3570 list->append(cssValuePool.createValue(iterationCount, CSSUnitType::CSS_NUMBER)); 3571 } 3597 for (size_t i = 0; i < t->size(); ++i) 3598 list->append(valueForAnimationIterationCount(t->animation(i).iterationCount())); 3572 3599 } else 3573 3600 list->append(cssValuePool.createValue(Animation::initialIterationCount(), CSSUnitType::CSS_NUMBER)); … … 3578 3605 const AnimationList* t = style.animations(); 3579 3606 if (t) { 3580 for (size_t i = 0; i < t->size(); ++i) { 3581 auto& name = t->animation(i).name(); 3582 if (name.isIdentifier) 3583 list->append(cssValuePool.createCustomIdent(name.string)); 3584 else 3585 list->append(cssValuePool.createValue(name.string, CSSUnitType::CSS_STRING)); 3586 } 3607 for (size_t i = 0; i < t->size(); ++i) 3608 list->append(valueForAnimationName(t->animation(i).name())); 3587 3609 } else 3588 3610 list->append(cssValuePool.createIdentifierValue(CSSValueNone)); … … 3593 3615 const AnimationList* t = style.animations(); 3594 3616 if (t) { 3595 for (size_t i = 0; i < t->size(); ++i) { 3596 switch (t->animation(i).playState()) { 3597 case AnimationPlayState::Playing: 3598 list->append(cssValuePool.createIdentifierValue(CSSValueRunning)); 3599 break; 3600 case AnimationPlayState::Paused: 3601 list->append(cssValuePool.createIdentifierValue(CSSValuePaused)); 3602 break; 3603 } 3604 } 3617 for (size_t i = 0; i < t->size(); ++i) 3618 list->append(valueForAnimationPlayState(t->animation(i).playState())); 3605 3619 } else 3606 3620 list->append(cssValuePool.createIdentifierValue(CSSValueRunning)); … … 3816 3830 list->append(createTransitionPropertyValue(animation)); 3817 3831 list->append(cssValuePool.createValue(animation.duration(), CSSUnitType::CSS_S)); 3818 list->append( createTimingFunctionValue(*animation.timingFunction()));3832 list->append(valueForAnimationTimingFunction(*animation.timingFunction())); 3819 3833 list->append(cssValuePool.createValue(animation.delay(), CSSUnitType::CSS_S)); 3820 3834 transitionsList->append(WTFMove(list)); … … 3827 3841 list->append(cssValuePool.createIdentifierValue(CSSValueAll)); 3828 3842 list->append(cssValuePool.createValue(Animation::initialDuration(), CSSUnitType::CSS_S)); 3829 list->append( createTimingFunctionValue(Animation::initialTimingFunction()));3843 list->append(valueForAnimationTimingFunction(Animation::initialTimingFunction())); 3830 3844 list->append(cssValuePool.createValue(Animation::initialDelay(), CSSUnitType::CSS_S)); 3831 3845 return list; -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h
r286795 r287534 21 21 #pragma once 22 22 23 #include "Animation.h" 23 24 #include "CSSStyleDeclaration.h" 24 25 #include "RenderStyleConstants.h" … … 77 78 static Ref<CSSFontStyleValue> fontNonKeywordStyleFromStyleValue(FontSelectionValue); 78 79 static Ref<CSSFontStyleValue> fontStyleFromStyleValue(std::optional<FontSelectionValue>, FontStyleAxis); 80 81 static Ref<CSSPrimitiveValue> valueForAnimationDuration(double); 82 static Ref<CSSValue> valueForAnimationTimingFunction(const TimingFunction&); 83 static Ref<CSSPrimitiveValue> valueForAnimationDelay(double); 84 static Ref<CSSPrimitiveValue> valueForAnimationIterationCount(double); 85 static Ref<CSSPrimitiveValue> valueForAnimationDirection(Animation::AnimationDirection); 86 static Ref<CSSPrimitiveValue> valueForAnimationFillMode(AnimationFillMode); 87 static Ref<CSSPrimitiveValue> valueForAnimationPlayState(AnimationPlayState); 88 static Ref<CSSPrimitiveValue> valueForAnimationName(const Animation::Name&); 79 89 80 90 private: -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r287433 r287534 34 34 #include "CSSBorderImage.h" 35 35 #include "CSSBorderImageSliceValue.h" 36 #include "CSSComputedStyleDeclaration.h" 36 37 #include "CSSContentDistributionValue.h" 37 38 #include "CSSCursorImageValue.h" … … 81 82 #include "StylePropertyShorthand.h" 82 83 #include "StylePropertyShorthandFunctions.h" 84 #include "TimingFunction.h" 83 85 #include <bitset> 84 86 #include <memory> … … 1656 1658 // FIXME: This will make invalid longhands, see crbug.com/386459 1657 1659 for (size_t i = 0; i < longhandCount; ++i) { 1658 if (!parsedLonghand[i]) 1659 longhands[i]->append(CSSValuePool::singleton().createImplicitInitialValue()); 1660 if (!parsedLonghand[i]) { 1661 auto property = shorthand.properties()[i]; 1662 if (property == CSSPropertyAnimationDuration) 1663 longhands[i]->append(ComputedStyleExtractor::valueForAnimationDuration(Animation::initialDuration())); 1664 else if (property == CSSPropertyAnimationTimingFunction) 1665 longhands[i]->append(ComputedStyleExtractor::valueForAnimationTimingFunction(CubicBezierTimingFunction::defaultTimingFunction())); 1666 else if (property == CSSPropertyAnimationDelay) 1667 longhands[i]->append(ComputedStyleExtractor::valueForAnimationDelay(Animation::initialDelay())); 1668 else if (property == CSSPropertyAnimationIterationCount) 1669 longhands[i]->append(ComputedStyleExtractor::valueForAnimationIterationCount(Animation::initialIterationCount())); 1670 else if (property == CSSPropertyAnimationDirection) 1671 longhands[i]->append(ComputedStyleExtractor::valueForAnimationDirection(Animation::initialDirection())); 1672 else if (property == CSSPropertyAnimationFillMode) 1673 longhands[i]->append(ComputedStyleExtractor::valueForAnimationFillMode(Animation::initialFillMode())); 1674 else if (property == CSSPropertyAnimationPlayState) 1675 longhands[i]->append(ComputedStyleExtractor::valueForAnimationPlayState(Animation::initialPlayState())); 1676 else if (property == CSSPropertyAnimationName) 1677 longhands[i]->append(ComputedStyleExtractor::valueForAnimationName(Animation::initialName())); 1678 else { 1679 ASSERT(shorthand.id() == CSSPropertyTransition); 1680 longhands[i]->append(CSSValuePool::singleton().createImplicitInitialValue()); 1681 } 1682 } 1660 1683 parsedLonghand[i] = false; 1661 1684 }
Note: See TracChangeset
for help on using the changeset viewer.