diff --git a/Libraries/LibWeb/Animations/Animatable.cpp b/Libraries/LibWeb/Animations/Animatable.cpp index 3c0f00a8d69..29602d50aab 100644 --- a/Libraries/LibWeb/Animations/Animatable.cpp +++ b/Libraries/LibWeb/Animations/Animatable.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -127,21 +128,23 @@ void Animatable::disassociate_with_animation(GC::Ref animation) impl.associated_animations.remove_first_matching([&](auto element) { return animation == element; }); } -void Animatable::add_transitioned_properties(Vector> properties, CSS::StyleValueVector delays, CSS::StyleValueVector durations, CSS::StyleValueVector timing_functions) +void Animatable::add_transitioned_properties(Vector> properties, CSS::StyleValueVector delays, CSS::StyleValueVector durations, CSS::StyleValueVector timing_functions, CSS::StyleValueVector transition_behaviors) { auto& impl = ensure_impl(); VERIFY(properties.size() == delays.size()); VERIFY(properties.size() == durations.size()); VERIFY(properties.size() == timing_functions.size()); + VERIFY(properties.size() == transition_behaviors.size()); for (size_t i = 0; i < properties.size(); i++) { size_t index_of_this_transition = impl.transition_attributes.size(); auto delay = delays[i]->is_time() ? delays[i]->as_time().time().to_milliseconds() : 0; auto duration = durations[i]->is_time() ? durations[i]->as_time().time().to_milliseconds() : 0; auto timing_function = timing_functions[i]->is_easing() ? timing_functions[i]->as_easing().function() : CSS::EasingStyleValue::CubicBezier::ease(); + auto transition_behavior = CSS::keyword_to_transition_behavior(transition_behaviors[i]->to_keyword()).value_or(CSS::TransitionBehavior::Normal); VERIFY(timing_functions[i]->is_easing()); - impl.transition_attributes.empend(delay, duration, timing_function); + impl.transition_attributes.empend(delay, duration, timing_function, transition_behavior); for (auto const& property : properties[i]) impl.transition_attribute_indices.set(property, index_of_this_transition); diff --git a/Libraries/LibWeb/Animations/Animatable.h b/Libraries/LibWeb/Animations/Animatable.h index 8072f632b1d..158d6914912 100644 --- a/Libraries/LibWeb/Animations/Animatable.h +++ b/Libraries/LibWeb/Animations/Animatable.h @@ -36,6 +36,7 @@ public: double delay; double duration; CSS::EasingStyleValue::Function timing_function; + CSS::TransitionBehavior transition_behavior; }; virtual ~Animatable() = default; @@ -56,7 +57,7 @@ public: GC::Ptr cached_transition_property_source() const; void set_cached_transition_property_source(GC::Ptr value); - void add_transitioned_properties(Vector> properties, CSS::StyleValueVector delays, CSS::StyleValueVector durations, CSS::StyleValueVector timing_functions); + void add_transitioned_properties(Vector> properties, CSS::StyleValueVector delays, CSS::StyleValueVector durations, CSS::StyleValueVector timing_functions, CSS::StyleValueVector transition_behaviors); Optional property_transition_attributes(CSS::PropertyID) const; void set_transition(CSS::PropertyID, GC::Ref); void remove_transition(CSS::PropertyID); diff --git a/Libraries/LibWeb/CSS/Enums.json b/Libraries/LibWeb/CSS/Enums.json index d465335933d..18834c1d857 100644 --- a/Libraries/LibWeb/CSS/Enums.json +++ b/Libraries/LibWeb/CSS/Enums.json @@ -591,6 +591,10 @@ "stroke-box", "view-box " ], + "transition-behavior": [ + "normal", + "allow-discrete" + ], "unicode-bidi": [ "bidi-override", "embed", diff --git a/Libraries/LibWeb/CSS/Interpolation.cpp b/Libraries/LibWeb/CSS/Interpolation.cpp index 27b5c2c3dfb..e68d82c2101 100644 --- a/Libraries/LibWeb/CSS/Interpolation.cpp +++ b/Libraries/LibWeb/CSS/Interpolation.cpp @@ -177,13 +177,13 @@ ValueComparingRefPtr interpolate_property(DOM::Element& ele } // https://drafts.csswg.org/css-transitions/#transitionable -bool property_values_are_transitionable(PropertyID property_id, CSSStyleValue const& old_value, CSSStyleValue const& new_value) +bool property_values_are_transitionable(PropertyID property_id, CSSStyleValue const& old_value, CSSStyleValue const& new_value, TransitionBehavior transition_behavior) { // When comparing the before-change style and after-change style for a given property, // the property values are transitionable if they have an animation type that is neither not animatable nor discrete. auto animation_type = animation_type_from_longhand_property(property_id); - if (animation_type == AnimationType::None || animation_type == AnimationType::Discrete) + if (animation_type == AnimationType::None || (transition_behavior != TransitionBehavior::AllowDiscrete && animation_type == AnimationType::Discrete)) return false; // FIXME: Even when a property is transitionable, the two values may not be. The spec uses the example of inset/non-inset shadows. diff --git a/Libraries/LibWeb/CSS/Interpolation.h b/Libraries/LibWeb/CSS/Interpolation.h index d178981026f..6a07e59fddb 100644 --- a/Libraries/LibWeb/CSS/Interpolation.h +++ b/Libraries/LibWeb/CSS/Interpolation.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include namespace Web::CSS { @@ -16,7 +17,7 @@ struct CalculationContext; ValueComparingRefPtr interpolate_property(DOM::Element&, PropertyID, CSSStyleValue const& from, CSSStyleValue const& to, float delta); // https://drafts.csswg.org/css-transitions/#transitionable -bool property_values_are_transitionable(PropertyID, CSSStyleValue const& old_value, CSSStyleValue const& new_value); +bool property_values_are_transitionable(PropertyID, CSSStyleValue const& old_value, CSSStyleValue const& new_value, TransitionBehavior transition_behavior); NonnullRefPtr interpolate_value(DOM::Element&, CalculationContext const&, CSSStyleValue const& from, CSSStyleValue const& to, float delta); NonnullRefPtr interpolate_repeatable_list(DOM::Element&, CalculationContext const&, CSSStyleValue const& from, CSSStyleValue const& to, float delta); diff --git a/Libraries/LibWeb/CSS/Keywords.json b/Libraries/LibWeb/CSS/Keywords.json index dbe16cccab6..50e5f7efa34 100644 --- a/Libraries/LibWeb/CSS/Keywords.json +++ b/Libraries/LibWeb/CSS/Keywords.json @@ -73,6 +73,7 @@ "all-petite-caps", "all-scroll", "all-small-caps", + "allow-discrete", "alpha", "alternate", "alternate-reverse", diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index e358b5aa178..708d990a7fa 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -3724,7 +3724,7 @@ RefPtr Parser::parse_transition_value(TokenStream Parser::parse_transition_value(TokenStreamto_keyword() == Keyword::All); @@ -3775,10 +3783,10 @@ RefPtr Parser::parse_transition_value(TokenStreamcustom_ident(); - if (auto property = property_id_from_string(custom_ident); property.has_value()) + if (auto property = property_id_from_string(custom_ident); property.has_value()) { transition.property_name = CustomIdentStyleValue::create(custom_ident); - - continue; + continue; + } } dbgln_if(CSS_PARSER_DEBUG, "Transition property has unexpected token \"{}\"", tokens.next_token().to_string()); diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index e31b374d872..d462dbc201a 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -2986,7 +2986,17 @@ "transition-property", "transition-duration", "transition-timing-function", - "transition-delay" + "transition-delay", + "transition-behavior" + ] + }, + "transition-behavior": { + "affects-layout": false, + "animation-type": "none", + "inherited": false, + "initial": "normal", + "valid-types": [ + "transition-behavior" ] }, "transition-delay": { diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index 5a8d5de9230..4326b256ee7 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -913,22 +913,25 @@ void StyleComputer::for_each_property_expanding_shorthands(PropertyID property_i set_longhand_property(CSS::PropertyID::TransitionDuration, TimeStyleValue::create(CSS::Time::make_seconds(0))); set_longhand_property(CSS::PropertyID::TransitionDelay, TimeStyleValue::create(CSS::Time::make_seconds(0))); set_longhand_property(CSS::PropertyID::TransitionTimingFunction, EasingStyleValue::create(EasingStyleValue::CubicBezier::ease())); + set_longhand_property(CSS::PropertyID::TransitionBehavior, CSSKeywordValue::create(Keyword::Normal)); return; } auto const& transitions = value.as_transition().transitions(); - Array>, 4> transition_values; + Array>, 5> transition_values; for (auto const& transition : transitions) { transition_values[0].append(*transition.property_name); transition_values[1].append(transition.duration.as_style_value()); transition_values[2].append(transition.delay.as_style_value()); if (transition.easing) transition_values[3].append(*transition.easing); + transition_values[4].append(CSSKeywordValue::create(to_keyword(transition.transition_behavior))); } set_longhand_property(CSS::PropertyID::TransitionProperty, StyleValueList::create(move(transition_values[0]), StyleValueList::Separator::Comma)); set_longhand_property(CSS::PropertyID::TransitionDuration, StyleValueList::create(move(transition_values[1]), StyleValueList::Separator::Comma)); set_longhand_property(CSS::PropertyID::TransitionDelay, StyleValueList::create(move(transition_values[2]), StyleValueList::Separator::Comma)); set_longhand_property(CSS::PropertyID::TransitionTimingFunction, StyleValueList::create(move(transition_values[3]), StyleValueList::Separator::Comma)); + set_longhand_property(CSS::PropertyID::TransitionBehavior, StyleValueList::create(move(transition_values[4]), StyleValueList::Separator::Comma)); return; } @@ -1371,8 +1374,11 @@ static void compute_transitioned_properties(ComputedProperties const& style, DOM auto timing_functions = normalize_transition_length_list( PropertyID::TransitionTimingFunction, [] { return EasingStyleValue::create(EasingStyleValue::CubicBezier::ease()); }); + auto transition_behaviors = normalize_transition_length_list( + PropertyID::TransitionBehavior, + [] { return CSSKeywordValue::create(Keyword::None); }); - element.add_transitioned_properties(move(properties), move(delays), move(durations), move(timing_functions)); + element.add_transitioned_properties(move(properties), move(delays), move(durations), move(timing_functions), move(transition_behaviors)); } // https://drafts.csswg.org/css-transitions/#starting @@ -1414,13 +1420,13 @@ void StyleComputer::start_needed_transitions(ComputedProperties const& previous_ if ( // - the element does not have a running transition for the property, (!has_running_transition) && + // - there is a matching transition-property value, and + (matching_transition_properties.has_value()) && // - the before-change style is different from the after-change style for that property, and the values for the property are transitionable, - (!before_change_value.equals(after_change_value) && property_values_are_transitionable(property_id, before_change_value, after_change_value)) && + (!before_change_value.equals(after_change_value) && property_values_are_transitionable(property_id, before_change_value, after_change_value, matching_transition_properties->transition_behavior)) && // - the element does not have a completed transition for the property // or the end value of the completed transition is different from the after-change style for the property, (!has_completed_transition || !existing_transition->transition_end_value()->equals(after_change_value)) && - // - there is a matching transition-property value, and - (matching_transition_properties.has_value()) && // - the combined duration is greater than 0s, (combined_duration(matching_transition_properties.value()) > 0)) { @@ -1480,7 +1486,7 @@ void StyleComputer::start_needed_transitions(ComputedProperties const& previous_ // or if these two values are not transitionable, // then implementations must cancel the running transition. auto current_value = existing_transition->value_at_time(style_change_event_time); - if (current_value->equals(after_change_value) || !property_values_are_transitionable(property_id, current_value, after_change_value)) { + if (current_value->equals(after_change_value) || !property_values_are_transitionable(property_id, current_value, after_change_value, matching_transition_properties->transition_behavior)) { dbgln_if(CSS_TRANSITIONS_DEBUG, "Transition step 4.1"); existing_transition->cancel(); } @@ -1489,7 +1495,7 @@ void StyleComputer::start_needed_transitions(ComputedProperties const& previous_ // or if the current value of the property in the running transition is not transitionable with the value of the property in the after-change style, // then implementations must cancel the running transition. else if ((combined_duration(matching_transition_properties.value()) <= 0) - || !property_values_are_transitionable(property_id, current_value, after_change_value)) { + || !property_values_are_transitionable(property_id, current_value, after_change_value, matching_transition_properties->transition_behavior)) { dbgln_if(CSS_TRANSITIONS_DEBUG, "Transition step 4.2"); existing_transition->cancel(); } diff --git a/Libraries/LibWeb/CSS/StyleValues/TransitionStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/TransitionStyleValue.cpp index 35ad5833323..cfa6948ad09 100644 --- a/Libraries/LibWeb/CSS/StyleValues/TransitionStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/TransitionStyleValue.cpp @@ -18,6 +18,8 @@ String TransitionStyleValue::to_string(SerializationMode mode) const builder.append(", "sv); first = false; builder.appendff("{} {} {} {}", transition.property_name->to_string(mode), transition.duration, transition.easing->to_string(mode), transition.delay); + if (transition.transition_behavior != TransitionBehavior::Normal) + builder.appendff(" {}", CSS::to_string(transition.transition_behavior)); } return MUST(builder.to_string()); diff --git a/Libraries/LibWeb/CSS/StyleValues/TransitionStyleValue.h b/Libraries/LibWeb/CSS/StyleValues/TransitionStyleValue.h index b64237c113d..21b3d066626 100644 --- a/Libraries/LibWeb/CSS/StyleValues/TransitionStyleValue.h +++ b/Libraries/LibWeb/CSS/StyleValues/TransitionStyleValue.h @@ -21,6 +21,7 @@ public: TimeOrCalculated duration { CSS::Time::make_seconds(0.0) }; TimeOrCalculated delay { CSS::Time::make_seconds(0.0) }; ValueComparingRefPtr easing; + TransitionBehavior transition_behavior { TransitionBehavior::Normal }; bool operator==(Transition const&) const = default; }; diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt index 6241b24af37..e0bb738f82d 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt @@ -220,19 +220,20 @@ All properties associated with getComputedStyle(document.body): "217": "transform", "218": "transform-box", "219": "transform-origin", - "220": "transition-delay", - "221": "transition-duration", - "222": "transition-property", - "223": "transition-timing-function", - "224": "translate", - "225": "unicode-bidi", - "226": "user-select", - "227": "vertical-align", - "228": "view-transition-name", - "229": "width", - "230": "x", - "231": "y", - "232": "z-index" + "220": "transition-behavior", + "221": "transition-delay", + "222": "transition-duration", + "223": "transition-property", + "224": "transition-timing-function", + "225": "translate", + "226": "unicode-bidi", + "227": "user-select", + "228": "vertical-align", + "229": "view-transition-name", + "230": "width", + "231": "x", + "232": "y", + "233": "z-index" } All properties associated with document.body.style by default: {} diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt index ea3b2e8cf81..f77174bb2c6 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt @@ -607,6 +607,8 @@ All supported properties and their default values exposed from CSSStylePropertie 'transformOrigin': '50% 50%' 'transform-origin': '50% 50%' 'transition': 'all' +'transitionBehavior': 'normal' +'transition-behavior': 'normal' 'transitionDelay': '0s' 'transition-delay': '0s' 'transitionDuration': '0s' diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index 7ccc821b2a2..32f4b8f605a 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -218,6 +218,7 @@ top: auto transform: none transform-box: view-box transform-origin: 50% 50% +transition-behavior: normal transition-delay: 0s transition-duration: 0s transition-property: all diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/CSS2/floats/float-no-interpolation.txt b/Tests/LibWeb/Text/expected/wpt-import/css/CSS2/floats/float-no-interpolation.txt index 0f9aae58754..ae2f490a9ee 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/CSS2/floats/float-no-interpolation.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/CSS2/floats/float-no-interpolation.txt @@ -2,18 +2,17 @@ Harness status: OK Found 66 tests -54 Pass -12 Fail -Fail CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (-0.3) should be [initial] -Fail CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (0) should be [initial] -Fail CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (0.3) should be [initial] +66 Pass +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (-0.3) should be [initial] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (0) should be [initial] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (0.3) should be [initial] Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (0.5) should be [right] Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (0.6) should be [right] Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (1) should be [right] Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [right] at (1.5) should be [right] -Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [right] at (-0.3) should be [initial] -Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [right] at (0) should be [initial] -Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [right] at (0.3) should be [initial] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [right] at (-0.3) should be [initial] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [right] at (0) should be [initial] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [right] at (0.3) should be [initial] Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [right] at (0.5) should be [right] Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [right] at (0.6) should be [right] Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [right] at (1) should be [right] @@ -46,15 +45,15 @@ Pass Web Animations: property from [initial] to [right] at (0.5) should Pass Web Animations: property from [initial] to [right] at (0.6) should be [right] Pass Web Animations: property from [initial] to [right] at (1) should be [right] Pass Web Animations: property from [initial] to [right] at (1.5) should be [right] -Fail CSS Transitions: property from [left] to [right] at (-1) should be [left] -Fail CSS Transitions: property from [left] to [right] at (0) should be [left] -Fail CSS Transitions: property from [left] to [right] at (0.4) should be [left] +Pass CSS Transitions: property from [left] to [right] at (-1) should be [left] +Pass CSS Transitions: property from [left] to [right] at (0) should be [left] +Pass CSS Transitions: property from [left] to [right] at (0.4) should be [left] Pass CSS Transitions: property from [left] to [right] at (0.5) should be [right] Pass CSS Transitions: property from [left] to [right] at (1) should be [right] Pass CSS Transitions: property from [left] to [right] at (1.5) should be [right] -Fail CSS Transitions with transition: all: property from [left] to [right] at (-1) should be [left] -Fail CSS Transitions with transition: all: property from [left] to [right] at (0) should be [left] -Fail CSS Transitions with transition: all: property from [left] to [right] at (0.4) should be [left] +Pass CSS Transitions with transition: all: property from [left] to [right] at (-1) should be [left] +Pass CSS Transitions with transition: all: property from [left] to [right] at (0) should be [left] +Pass CSS Transitions with transition: all: property from [left] to [right] at (0.4) should be [left] Pass CSS Transitions with transition: all: property from [left] to [right] at (0.5) should be [right] Pass CSS Transitions with transition: all: property from [left] to [right] at (1) should be [right] Pass CSS Transitions with transition: all: property from [left] to [right] at (1.5) should be [right] diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt index 535648fbe77..8c358e7e3cc 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt @@ -1,8 +1,8 @@ Harness status: OK -Found 197 tests +Found 198 tests -187 Pass +188 Pass 10 Fail Pass accent-color Pass border-collapse @@ -188,6 +188,7 @@ Pass text-overflow Pass top Fail transform Pass transform-box +Pass transition-behavior Pass transition-delay Pass transition-duration Pass transition-property diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/animation/discrete-no-interpolation.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/animation/discrete-no-interpolation.txt new file mode 100644 index 00000000000..42b5d619459 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/animation/discrete-no-interpolation.txt @@ -0,0 +1,89 @@ +Harness status: OK + +Found 84 tests + +84 Pass +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [column] at (-0.3) should be [initial] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [column] at (0) should be [initial] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [column] at (0.3) should be [initial] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [column] at (0.5) should be [column] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [column] at (0.6) should be [column] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [column] at (1) should be [column] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [column] at (1.5) should be [column] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [column] at (-0.3) should be [initial] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [column] at (0) should be [initial] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [column] at (0.3) should be [initial] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [column] at (0.5) should be [column] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [column] at (0.6) should be [column] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [column] at (1) should be [column] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [column] at (1.5) should be [column] +Pass CSS Transitions: property from [initial] to [column] at (-0.3) should be [column] +Pass CSS Transitions: property from [initial] to [column] at (0) should be [column] +Pass CSS Transitions: property from [initial] to [column] at (0.3) should be [column] +Pass CSS Transitions: property from [initial] to [column] at (0.5) should be [column] +Pass CSS Transitions: property from [initial] to [column] at (0.6) should be [column] +Pass CSS Transitions: property from [initial] to [column] at (1) should be [column] +Pass CSS Transitions: property from [initial] to [column] at (1.5) should be [column] +Pass CSS Transitions with transition: all: property from [initial] to [column] at (-0.3) should be [column] +Pass CSS Transitions with transition: all: property from [initial] to [column] at (0) should be [column] +Pass CSS Transitions with transition: all: property from [initial] to [column] at (0.3) should be [column] +Pass CSS Transitions with transition: all: property from [initial] to [column] at (0.5) should be [column] +Pass CSS Transitions with transition: all: property from [initial] to [column] at (0.6) should be [column] +Pass CSS Transitions with transition: all: property from [initial] to [column] at (1) should be [column] +Pass CSS Transitions with transition: all: property from [initial] to [column] at (1.5) should be [column] +Pass CSS Animations: property from [initial] to [column] at (-0.3) should be [initial] +Pass CSS Animations: property from [initial] to [column] at (0) should be [initial] +Pass CSS Animations: property from [initial] to [column] at (0.3) should be [initial] +Pass CSS Animations: property from [initial] to [column] at (0.5) should be [column] +Pass CSS Animations: property from [initial] to [column] at (0.6) should be [column] +Pass CSS Animations: property from [initial] to [column] at (1) should be [column] +Pass CSS Animations: property from [initial] to [column] at (1.5) should be [column] +Pass Web Animations: property from [initial] to [column] at (-0.3) should be [initial] +Pass Web Animations: property from [initial] to [column] at (0) should be [initial] +Pass Web Animations: property from [initial] to [column] at (0.3) should be [initial] +Pass Web Animations: property from [initial] to [column] at (0.5) should be [column] +Pass Web Animations: property from [initial] to [column] at (0.6) should be [column] +Pass Web Animations: property from [initial] to [column] at (1) should be [column] +Pass Web Animations: property from [initial] to [column] at (1.5) should be [column] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [wrap] at (-0.3) should be [initial] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [wrap] at (0) should be [initial] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [wrap] at (0.3) should be [initial] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [wrap] at (0.5) should be [wrap] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [wrap] at (0.6) should be [wrap] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [wrap] at (1) should be [wrap] +Pass CSS Transitions with transition-behavior:allow-discrete: property from [initial] to [wrap] at (1.5) should be [wrap] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [wrap] at (-0.3) should be [initial] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [wrap] at (0) should be [initial] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [wrap] at (0.3) should be [initial] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [wrap] at (0.5) should be [wrap] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [wrap] at (0.6) should be [wrap] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [wrap] at (1) should be [wrap] +Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial] to [wrap] at (1.5) should be [wrap] +Pass CSS Transitions: property from [initial] to [wrap] at (-0.3) should be [wrap] +Pass CSS Transitions: property from [initial] to [wrap] at (0) should be [wrap] +Pass CSS Transitions: property from [initial] to [wrap] at (0.3) should be [wrap] +Pass CSS Transitions: property from [initial] to [wrap] at (0.5) should be [wrap] +Pass CSS Transitions: property from [initial] to [wrap] at (0.6) should be [wrap] +Pass CSS Transitions: property from [initial] to [wrap] at (1) should be [wrap] +Pass CSS Transitions: property from [initial] to [wrap] at (1.5) should be [wrap] +Pass CSS Transitions with transition: all: property from [initial] to [wrap] at (-0.3) should be [wrap] +Pass CSS Transitions with transition: all: property from [initial] to [wrap] at (0) should be [wrap] +Pass CSS Transitions with transition: all: property from [initial] to [wrap] at (0.3) should be [wrap] +Pass CSS Transitions with transition: all: property from [initial] to [wrap] at (0.5) should be [wrap] +Pass CSS Transitions with transition: all: property from [initial] to [wrap] at (0.6) should be [wrap] +Pass CSS Transitions with transition: all: property from [initial] to [wrap] at (1) should be [wrap] +Pass CSS Transitions with transition: all: property from [initial] to [wrap] at (1.5) should be [wrap] +Pass CSS Animations: property from [initial] to [wrap] at (-0.3) should be [initial] +Pass CSS Animations: property from [initial] to [wrap] at (0) should be [initial] +Pass CSS Animations: property from [initial] to [wrap] at (0.3) should be [initial] +Pass CSS Animations: property from [initial] to [wrap] at (0.5) should be [wrap] +Pass CSS Animations: property from [initial] to [wrap] at (0.6) should be [wrap] +Pass CSS Animations: property from [initial] to [wrap] at (1) should be [wrap] +Pass CSS Animations: property from [initial] to [wrap] at (1.5) should be [wrap] +Pass Web Animations: property from [initial] to [wrap] at (-0.3) should be [initial] +Pass Web Animations: property from [initial] to [wrap] at (0) should be [initial] +Pass Web Animations: property from [initial] to [wrap] at (0.3) should be [initial] +Pass Web Animations: property from [initial] to [wrap] at (0.5) should be [wrap] +Pass Web Animations: property from [initial] to [wrap] at (0.6) should be [wrap] +Pass Web Animations: property from [initial] to [wrap] at (1) should be [wrap] +Pass Web Animations: property from [initial] to [wrap] at (1.5) should be [wrap] \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/parsing/transition-behavior.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/parsing/transition-behavior.txt new file mode 100644 index 00000000000..f31d6bb23bf --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/parsing/transition-behavior.txt @@ -0,0 +1,34 @@ +Harness status: OK + +Found 28 tests + +22 Pass +6 Fail +Pass e.style['transition-behavior'] = "normal" should set the property value +Pass Property transition-behavior value 'normal' +Pass e.style['transition-behavior'] = "allow-discrete" should set the property value +Pass Property transition-behavior value 'allow-discrete' +Pass e.style['transition'] = "allow-discrete display" should set the property value +Pass Property transition value 'allow-discrete display' +Pass e.style['transition'] = "allow-discrete display 3s" should set the property value +Pass Property transition value 'allow-discrete display 3s' +Pass e.style['transition'] = "allow-discrete display 3s 1s" should set the property value +Pass Property transition value 'allow-discrete display 3s 1s' +Pass e.style['transition'] = "allow-discrete display 3s ease-in-out" should set the property value +Pass Property transition value 'allow-discrete display 3s ease-in-out' +Pass e.style['transition'] = "allow-discrete display 3s ease-in-out 1s" should set the property value +Pass Property transition value 'allow-discrete display 3s ease-in-out 1s' +Fail e.style['transition'] = "asdf display" should not set the property value +Fail e.style['transition'] = "display asdf" should not set the property value +Pass e.style['transition'] = "display allow-discrete 3s ease-in-out 1s" should set the property value +Pass e.style['transition'] = "display 3s allow-discrete ease-in-out 1s" should set the property value +Pass e.style['transition'] = "display 3s ease-in-out allow-discrete 1s" should set the property value +Pass e.style['transition'] = "display 3s ease-in-out 1s allow-discrete" should set the property value +Pass Property transition value 'display allow-discrete 3s ease-in-out 1s' +Pass Property transition value 'display 3s allow-discrete ease-in-out 1s' +Pass Property transition value 'display 3s ease-in-out allow-discrete 1s' +Pass Property transition value 'display 3s ease-in-out 1s allow-discrete' +Fail e.style['transition'] = "allow-discrete display, normal opacity, color" should set the property value +Fail Property transition value 'allow-discrete display, normal opacity, color' +Fail e.style['transition'] = "normal opacity, color, allow-discrete display" should set the property value +Fail Property transition value 'normal opacity, color, allow-discrete display' \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/animation/discrete-no-interpolation.html b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/animation/discrete-no-interpolation.html new file mode 100644 index 00000000000..7eefce7e251 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/animation/discrete-no-interpolation.html @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/parsing/transition-behavior.html b/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/parsing/transition-behavior.html new file mode 100644 index 00000000000..56c65660b70 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/parsing/transition-behavior.html @@ -0,0 +1,57 @@ + + + + + + + +
+