From b25035dee0c95d3cc561fe95847aa4c8bfbf619e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20=C5=A0olt=C3=A9s?= Date: Sat, 19 Sep 2026 16:14:55 +0200 Subject: [PATCH] Implement bounded CSS animation lists (#672) --- .../css-animation-multiple-lists-672-242.md | 55 ++ .../native/webscene_css_transitions.h | 310 +++++---- .../native/webscene_native_dom.h | 92 +-- .../native/webscene_native_dom_animations.inc | 632 +++++++----------- .../native/webscene_native_dom_metrics.inc | 53 +- .../native/webscene_native_dom_tree.inc | 8 + .../webscene_v8_runtime_css_cascade.inc | 14 +- .../native/webscene_v8_runtime_style.inc | 9 +- ...ative_v8_runtime_animation_cssom_tests.inc | 97 +++ .../tests/native_v8_runtime_tests.cpp | 2 + tests/WebPlatformSubset/capabilities.json | 6 +- .../css-animation-multiple-lists.html | 78 +++ .../webscene-component-profile.json | 7 + ...-css-animation-multiple-lists-profile.json | 30 + 14 files changed, 800 insertions(+), 593 deletions(-) create mode 100644 docs/validation/css-animation-multiple-lists-672-242.md create mode 100644 tests/WebPlatformSubset/contracts/css-animation-multiple-lists.html create mode 100644 tests/WebPlatformSubset/webscene-css-animation-multiple-lists-profile.json diff --git a/docs/validation/css-animation-multiple-lists-672-242.md b/docs/validation/css-animation-multiple-lists-672-242.md new file mode 100644 index 000000000..7bad494ac --- /dev/null +++ b/docs/validation/css-animation-multiple-lists-672-242.md @@ -0,0 +1,55 @@ +# Multiple CSS animation list source validation + +Issue #672 adds bounded comma-separated CSS animation coordination to WebScene's +retained opacity, `rotate()`, and compatible foreground-filter runtime under +#242. `animation-name` determines track count and order. Duration, timing, +delay, iteration, direction, fill, and play-state lists repeat modulo their +length; entries beyond the name count do not create tracks. The shorthand +parses every comma-separated item and CSSOM serializes one coordinated item per +name. + +## Runtime contract + +Each configured track retains an independent identity, host-clock origin, pause +hold, fill state, compatible filter data, and exactly-once end latch. A same-index +track preserves time while only fill or play state changes. Changes to its name, +keyframes, duration, delay, iterations, direction, or timing restart that track. +Removing a track destroys its retained state, so it cannot paint or dispatch a +stale completion after mutation, detach, navigation, or teardown. + +Tracks sample in animation-list order. For each supported property, the last +track that contributes in its active or applicable fill phase supplies the +replace-composited value. A later track in an unfilled delay or terminal phase +does not hide an earlier contributing track. Simultaneous finite completions +append one `animationend` per track in list order. A `none` or unresolved name +keeps its coordinated slot but creates no effect or event. + +## Bounds and scheduling + +- At most eight animation-name entries configure runtime tracks per element. + Authored CSSOM text remains observable beyond the execution cap. +- Existing stop-count, filter-function, duration, and iteration bounds apply to + every track. Invalid coordinated values fall back to each longhand's initial + runtime value. +- List parsing, keyframe lookup, filter compatibility, and track reconciliation + happen during style configuration. Frame sampling performs one bounded scan + over retained tracks and does not rerun selector matching, cascade, layout, + or visual-tree construction. +- Paused, completed, and fill-only tracks do not keep host-frame demand alive. + Infinite or incomplete running tracks use the existing visibility and paint + area gates. + +## Evidence and deferred scope + +`test_multiple_animation_lists_coordinate_bounded_tracks` covers repeated +longhands, multi-item shorthand serialization, independent pause/delay/direction, +last-contributing paint, the eight-track cap, same-frame end ordering, removal, +detach, and frame demand. The dedicated browser contract provides a WPT-aligned +observable reduction for coordination, ordering, serialization, and cleanup. + +Additive/accumulate composition, `animation-composition`, Web Animations API +objects, more than eight live tracks, zero-duration event expansion, additional +animated properties, transition/animation compositing changes, and ABI or +AppScene changes remain deferred. Under the fast implementation policy, only +`git diff --check` is executed. Native, browser, package, and unchanged Code OSS +acceptance remain unexecuted. diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_transitions.h b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_transitions.h index 9daa44f31..708268f1b 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_transitions.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_transitions.h @@ -249,52 +249,105 @@ inline bool apply_compiled_single_transition_shorthand( inline void apply_animation_shorthand(node_style& style, const std::string& value) { - auto name = std::string("none"); - auto duration = std::string("0s"); - auto delay = std::string("0s"); - auto timing = std::string("ease"); - auto iterations = std::string("1"); - auto direction = std::string("normal"); - auto fill_mode = std::string("none"); - auto play_state = std::string("running"); - auto saw_time = false; - const auto first = split_css_component_list(value, ','); - for (const auto& token : split_value_tokens( - first.empty() ? std::string_view{} : std::string_view(first.front()))) { - const auto lower = ascii_lower(token); - if (is_css_time(lower)) { - if (!saw_time) duration = lower; - else delay = lower; - saw_time = true; - } else if (is_animation_timing_function(lower)) { - timing = lower; - } else if (lower == "infinite" - || std::all_of(lower.begin(), lower.end(), [](unsigned char character) { - return std::isdigit(character) || character == '.'; - })) { - iterations = lower; - } else if (lower == "forwards" || lower == "backwards" - || lower == "both") { - fill_mode = lower; - } else if (lower == "normal" || lower == "reverse" - || lower == "alternate" || lower == "alternate-reverse") { - direction = lower; - } else if (lower == "running" || lower == "paused") { - play_state = lower; - } else if (lower != "none" - && lower != "backwards") { - name = token; + std::vector names, durations, delays, timings, iterations; + std::vector directions, fill_modes, play_states; + const auto items = split_css_component_list(value, ','); + for (const auto& item : items) { + auto name = std::string("none"); + auto duration = std::string("0s"); + auto delay = std::string("0s"); + auto timing = std::string("ease"); + auto iteration = std::string("1"); + auto direction = std::string("normal"); + auto fill_mode = std::string("none"); + auto play_state = std::string("running"); + auto saw_time = false; + for (const auto& token : split_value_tokens(item)) { + const auto lower = ascii_lower(token); + if (is_css_time(lower)) { + if (!saw_time) duration = lower; + else delay = lower; + saw_time = true; + } else if (is_animation_timing_function(lower)) { + timing = lower; + } else if (lower == "infinite" + || std::all_of(lower.begin(), lower.end(), [](unsigned char character) { + return std::isdigit(character) || character == '.'; + })) { + iteration = lower; + } else if (lower == "forwards" || lower == "backwards" + || lower == "both") { + fill_mode = lower; + } else if (lower == "normal" || lower == "reverse" + || lower == "alternate" || lower == "alternate-reverse") { + direction = lower; + } else if (lower == "running" || lower == "paused") { + play_state = lower; + } else if (lower != "none") { + name = token; + } } + names.push_back(std::move(name)); + durations.push_back(std::move(duration)); + delays.push_back(std::move(delay)); + timings.push_back(std::move(timing)); + iterations.push_back(std::move(iteration)); + directions.push_back(std::move(direction)); + fill_modes.push_back(std::move(fill_mode)); + play_states.push_back(std::move(play_state)); } + const auto join = [](const std::vector& list) { + auto result = std::string{}; + for (const auto& entry : list) { + if (!result.empty()) result += ", "; + result += entry; + } + return result; + }; auto& animations = style.mutable_animations(); - animations.animation_name_value = name; - animations.animation_duration_value = duration; - animations.animation_delay_value = delay; - animations.animation_timing_function_value = timing; - animations.animation_iteration_count_value = iterations; - animations.animation_direction_value = direction; - animations.animation_fill_mode_value = fill_mode; - animations.animation_play_state_value = play_state; + animations.animation_name_value = names.empty() ? "none" : join(names); + animations.animation_duration_value = durations.empty() ? "0s" : join(durations); + animations.animation_delay_value = delays.empty() ? "0s" : join(delays); + animations.animation_timing_function_value = timings.empty() ? "ease" : join(timings); + animations.animation_iteration_count_value = iterations.empty() ? "1" : join(iterations); + animations.animation_direction_value = directions.empty() ? "normal" : join(directions); + animations.animation_fill_mode_value = fill_modes.empty() ? "none" : join(fill_modes); + animations.animation_play_state_value = play_states.empty() ? "running" : join(play_states); + } + +inline std::string serialize_animation_shorthand( + const node_style::animation_data& animations) + { + const auto names = split_css_component_list(animations.animation_name_value, ','); + if (names.empty()) return "none 0s ease 0s 1 normal none running"; + const auto durations = split_css_component_list(animations.animation_duration_value, ','); + const auto timings = split_css_component_list( + animations.animation_timing_function_value, ','); + const auto delays = split_css_component_list(animations.animation_delay_value, ','); + const auto iterations = split_css_component_list( + animations.animation_iteration_count_value, ','); + const auto directions = split_css_component_list( + animations.animation_direction_value, ','); + const auto fills = split_css_component_list(animations.animation_fill_mode_value, ','); + const auto plays = split_css_component_list(animations.animation_play_state_value, ','); + const auto coordinated = [](const auto& list, size_t index, + std::string_view initial) { + return list.empty() ? std::string(initial) + : trim_value(list[index % list.size()]); + }; + auto result = std::string{}; + for (size_t index = 0U; index < names.size(); ++index) { + if (!result.empty()) result += ", "; + result += trim_value(names[index]) + " " + + coordinated(durations, index, "0s") + " " + + coordinated(timings, index, "ease") + " " + + coordinated(delays, index, "0s") + " " + + coordinated(iterations, index, "1") + " " + + coordinated(directions, index, "normal") + " " + + coordinated(fills, index, "none") + " " + + coordinated(plays, index, "running"); + } + return result; } inline void configure_keyframes(node_style& style, @@ -302,25 +355,9 @@ inline void configure_keyframes(node_style& style, { if (!style.has_animation_data()) return; auto& animations = style.mutable_animations(); - animations.opacity_keyframes.clear(); - animations.opacity_keyframe_animation_signature.clear(); - animations.rotation_keyframes.clear(); - animations.rotation_keyframe_animation_signature.clear(); - animations.filter_keyframes.clear(); - animations.filter_keyframe_animation_signature.clear(); - const auto play_states = split_css_component_list( - animations.animation_play_state_value, ','); - const auto play_state = play_states.empty() - ? std::string("running") : ascii_lower(trim_value(play_states.front())); - animations.keyframe_play_state = play_state == "paused" - ? node_style::animation_data::play_kind::paused - : node_style::animation_data::play_kind::running; - if (animations.animation_name_value == "none") return; + animations.keyframe_animations.clear(); const auto names = split_css_component_list(animations.animation_name_value, ','); if (names.empty()) return; - const auto name = ascii_lower(trim_value(names.front())); - const auto definition = definitions.find(name); - if (name == "none" || definition == definitions.end()) return; const auto durations = split_css_component_list(animations.animation_duration_value, ','); const auto delays = split_css_component_list(animations.animation_delay_value, ','); const auto timings = split_css_component_list( @@ -331,84 +368,87 @@ inline void configure_keyframes(node_style& style, animations.animation_direction_value, ','); const auto fill_modes = split_css_component_list( animations.animation_fill_mode_value, ','); - animations.opacity_keyframe_duration_ms = durations.empty() - ? 0 : std::max(0.0F, parse_css_time_ms(durations.front())); - animations.opacity_keyframe_delay_ms = delays.empty() - ? 0 : parse_css_time_ms(delays.front()); - const auto iteration = iteration_counts.empty() - ? std::string("1") : ascii_lower(trim_value(iteration_counts.front())); - animations.opacity_keyframe_iterations = iteration == "infinite" - ? std::numeric_limits::infinity() - : std::max(0.0F, std::strtof(iteration.c_str(), nullptr)); - const auto direction = directions.empty() - ? std::string("normal") : ascii_lower(trim_value(directions.front())); - animations.keyframe_direction = direction == "reverse" - ? node_style::animation_data::direction_kind::reverse - : direction == "alternate" - ? node_style::animation_data::direction_kind::alternate - : direction == "alternate-reverse" - ? node_style::animation_data::direction_kind::alternate_reverse - : node_style::animation_data::direction_kind::normal; - const auto fill_mode = fill_modes.empty() - ? std::string("none") : ascii_lower(trim_value(fill_modes.front())); - animations.keyframe_fill_mode = fill_mode == "forwards" - ? node_style::animation_data::fill_kind::forwards - : fill_mode == "backwards" - ? node_style::animation_data::fill_kind::backwards - : fill_mode == "both" - ? node_style::animation_data::fill_kind::both - : node_style::animation_data::fill_kind::none; - node_style::transition_timing animation_timing; - if (!timings.empty()) parse_animation_timing(timings.front(), animation_timing); - animations.opacity_keyframe_x1 = animation_timing.x1; - animations.opacity_keyframe_y1 = animation_timing.y1; - animations.opacity_keyframe_x2 = animation_timing.x2; - animations.opacity_keyframe_y2 = animation_timing.y2; - animations.opacity_keyframe_step_count = animation_timing.step_count; - animations.opacity_keyframe_timing_kind = animation_timing.kind; - animations.opacity_keyframe_step_position = animation_timing.steps_position; - animations.opacity_keyframes = definition->second.opacity_stops; - animations.rotation_keyframes = definition->second.rotation_stops; - animations.filter_keyframes = definition->second.filter_stops; - if (animations.opacity_keyframe_duration_ms <= 0 - || animations.opacity_keyframe_iterations == 0 - || (animations.opacity_keyframes.size() < 2U - && animations.rotation_keyframes.size() < 2U - && animations.filter_keyframes.size() < 2U)) return; - std::ostringstream signature; - signature << name << '|' << animations.opacity_keyframe_duration_ms << '|' - << animations.opacity_keyframe_delay_ms << '|' - << animations.opacity_keyframe_iterations << '|' - << static_cast(animations.keyframe_direction) << '|' - << static_cast(animations.opacity_keyframe_timing_kind) << ',' - << animations.opacity_keyframe_step_count << ',' - << static_cast(animations.opacity_keyframe_step_position) << '|' - << animations.opacity_keyframe_x1 << ',' << animations.opacity_keyframe_y1 << ',' - << animations.opacity_keyframe_x2 << ',' << animations.opacity_keyframe_y2; - const auto base_signature = signature.str(); - if (animations.opacity_keyframes.size() >= 2U) { - signature.str(base_signature); - signature.clear(); - for (const auto& stop : animations.opacity_keyframes) { - signature << '|' << stop.offset << ':' << stop.opacity; + const auto play_states = split_css_component_list( + animations.animation_play_state_value, ','); + const auto coordinated = [](const auto& list, size_t index, + std::string_view initial) { + return list.empty() ? std::string(initial) + : ascii_lower(trim_value(list[index % list.size()])); + }; + const auto count = std::min( + names.size(), node_style::animation_data::max_keyframe_animation_tracks); + animations.keyframe_animations.reserve(count); + for (size_t index = 0U; index < count; ++index) { + node_style::animation_data::keyframe_animation track; + track.name = trim_value(names[index]); + const auto normalized_name = ascii_lower(track.name); + track.duration_ms = std::max(0.0F, parse_css_time_ms( + coordinated(durations, index, "0s"))); + track.delay_ms = parse_css_time_ms(coordinated(delays, index, "0s")); + const auto iteration = coordinated(iteration_counts, index, "1"); + if (iteration == "infinite") { + track.iterations = std::numeric_limits::infinity(); + } else { + char* parsed_end = nullptr; + const auto parsed = std::strtof(iteration.c_str(), &parsed_end); + track.iterations = parsed_end == iteration.c_str() + iteration.size() + && std::isfinite(parsed) + ? std::max(0.0F, parsed) : 1.0F; } - animations.opacity_keyframe_animation_signature = signature.str(); - } - if (animations.rotation_keyframes.size() >= 2U) { - signature.str(base_signature); - signature.clear(); - for (const auto& stop : animations.rotation_keyframes) { - signature << '|' << stop.offset << ':' << stop.degrees; + const auto direction = coordinated(directions, index, "normal"); + track.direction = direction == "reverse" + ? node_style::animation_data::direction_kind::reverse + : direction == "alternate" + ? node_style::animation_data::direction_kind::alternate + : direction == "alternate-reverse" + ? node_style::animation_data::direction_kind::alternate_reverse + : node_style::animation_data::direction_kind::normal; + const auto fill_mode = coordinated(fill_modes, index, "none"); + track.fill_mode = fill_mode == "forwards" + ? node_style::animation_data::fill_kind::forwards + : fill_mode == "backwards" + ? node_style::animation_data::fill_kind::backwards + : fill_mode == "both" + ? node_style::animation_data::fill_kind::both + : node_style::animation_data::fill_kind::none; + track.play_state = coordinated(play_states, index, "running") == "paused" + ? node_style::animation_data::play_kind::paused + : node_style::animation_data::play_kind::running; + node_style::transition_timing timing; + parse_animation_timing(coordinated(timings, index, "ease"), timing); + track.x1 = timing.x1; track.y1 = timing.y1; + track.x2 = timing.x2; track.y2 = timing.y2; + track.step_count = timing.step_count; + track.timing_kind = timing.kind; + track.step_position = timing.steps_position; + const auto definition = definitions.find(normalized_name); + if (normalized_name != "none" && definition != definitions.end()) { + track.opacity_keyframes = definition->second.opacity_stops; + track.rotation_keyframes = definition->second.rotation_stops; + track.filter_keyframes = definition->second.filter_stops; } - animations.rotation_keyframe_animation_signature = signature.str(); - } - if (animations.filter_keyframes.size() >= 2U) { - signature.str(base_signature); - signature.clear(); - for (const auto& stop : animations.filter_keyframes) { - signature << '|' << stop.offset << ':' << stop.value; + const auto runnable = track.duration_ms > 0 && track.iterations != 0 + && (track.opacity_keyframes.size() >= 2U + || track.rotation_keyframes.size() >= 2U + || track.filter_keyframes.size() >= 2U); + if (runnable) { + std::ostringstream signature; + signature << normalized_name << '|' << track.duration_ms << '|' + << track.delay_ms << '|' << track.iterations << '|' + << static_cast(track.direction) << '|' + << static_cast(track.timing_kind) << ',' + << track.step_count << ',' + << static_cast(track.step_position) << '|' + << track.x1 << ',' << track.y1 << ',' << track.x2 << ',' << track.y2; + for (const auto& stop : track.opacity_keyframes) + signature << "|o" << stop.offset << ':' << stop.opacity; + for (const auto& stop : track.rotation_keyframes) + signature << "|r" << stop.offset << ':' << stop.degrees; + for (const auto& stop : track.filter_keyframes) + signature << "|f" << stop.offset << ':' << stop.value; + track.signature = signature.str(); } - animations.filter_keyframe_animation_signature = signature.str(); + animations.keyframe_animations.push_back(std::move(track)); } } diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h index 30fec7a7c..4f511eab5 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h @@ -199,6 +199,7 @@ struct node_style final { }; struct animation_data final { + static constexpr size_t max_keyframe_animation_tracks = 8U; enum class direction_kind : uint8_t { normal, reverse, @@ -234,27 +235,29 @@ struct node_style final { std::string animation_direction_value{"normal"}; std::string animation_fill_mode_value{"none"}; std::string animation_play_state_value{"running"}; - std::string opacity_keyframe_animation_signature; - std::vector opacity_keyframes; - std::string rotation_keyframe_animation_signature; - std::vector rotation_keyframes; - std::string filter_keyframe_animation_signature; - std::vector filter_keyframes; - float opacity_keyframe_duration_ms{0}; - float opacity_keyframe_delay_ms{0}; - float opacity_keyframe_iterations{1}; - direction_kind keyframe_direction{direction_kind::normal}; - fill_kind keyframe_fill_mode{fill_kind::none}; - play_kind keyframe_play_state{play_kind::running}; - float opacity_keyframe_x1{0.25F}; - float opacity_keyframe_y1{0.1F}; - float opacity_keyframe_x2{0.25F}; - float opacity_keyframe_y2{1.0F}; - uint32_t opacity_keyframe_step_count{1U}; - transition_timing::function_kind opacity_keyframe_timing_kind{ - transition_timing::function_kind::cubic_bezier}; - transition_timing::step_position opacity_keyframe_step_position{ - transition_timing::step_position::jump_end}; + struct keyframe_animation final { + std::string name; + std::string signature; + std::vector opacity_keyframes; + std::vector rotation_keyframes; + std::vector filter_keyframes; + float duration_ms{0}; + float delay_ms{0}; + float iterations{1}; + direction_kind direction{direction_kind::normal}; + fill_kind fill_mode{fill_kind::none}; + play_kind play_state{play_kind::running}; + float x1{0.25F}; + float y1{0.1F}; + float x2{0.25F}; + float y2{1.0F}; + uint32_t step_count{1U}; + transition_timing::function_kind timing_kind{ + transition_timing::function_kind::cubic_bezier}; + transition_timing::step_position step_position{ + transition_timing::step_position::jump_end}; + }; + std::vector keyframe_animations; }; const animation_data& animations() const noexcept @@ -1456,6 +1459,24 @@ struct dom_node final { std::vector functions; bool authored_none{false}; }; + struct keyframe_animation_runtime final { + std::string name; + std::string signature; + std::vector filter_keyframes; + std::vector filter_underlying; + std::vector painted_filter_functions; + double started_ms{0}; + double paused_at_ms{0}; + float painted_opacity{1}; + float painted_rotation_degrees{0}; + node_style::animation_data::fill_kind fill_mode{ + node_style::animation_data::fill_kind::none}; + bool active{false}; + bool filled{false}; + bool paused{false}; + bool filter_valid{false}; + bool end_event_sent{false}; + }; css_length painted_transform_translate_x{}; css_length painted_transform_translate_y{}; css_length transform_animation_from_translate_x{}; @@ -1520,25 +1541,10 @@ struct dom_node final { bool opacity_animation_initialized{false}; bool opacity_animation_active{false}; bool opacity_animation_start_event_sent{false}; - std::string opacity_keyframe_animation_signature; - double opacity_keyframe_animation_started_ms{0}; - bool opacity_keyframe_animation_active{false}; - std::string rotation_keyframe_animation_signature; - double rotation_keyframe_animation_started_ms{0}; - bool rotation_keyframe_animation_active{false}; - bool rotation_keyframe_animation_filled{false}; - std::string filter_keyframe_animation_signature; - std::vector filter_keyframes; - std::vector filter_keyframe_underlying; - double filter_keyframe_animation_started_ms{0}; - bool filter_keyframe_animation_active{false}; - bool filter_keyframe_animation_valid{false}; - bool filter_keyframe_animation_filled{false}; - node_style::animation_data::fill_kind keyframe_fill_mode{ - node_style::animation_data::fill_kind::none}; - bool keyframe_animation_paused{false}; - double keyframe_animation_paused_at_ms{0}; - bool keyframe_animation_end_event_sent{false}; + std::vector keyframe_animations; + bool keyframe_opacity_override{false}; + bool keyframe_rotation_override{false}; + bool keyframe_filter_override{false}; uint32_t painted_foreground_rgba{0}; uint32_t color_animation_from_rgba{0}; uint32_t color_animation_target_rgba{0}; @@ -1886,16 +1892,14 @@ struct dom_node final { bool has_painted_rotation_keyframe_override_value() const noexcept { return animation_runtime_state != nullptr - && (animation_runtime_state->rotation_keyframe_animation_active - || animation_runtime_state->rotation_keyframe_animation_filled); + && animation_runtime_state->keyframe_rotation_override; } bool has_painted_filter_override_value() const noexcept { return animation_runtime_state != nullptr && (animation_runtime_state->filter_animation_active - || animation_runtime_state->filter_keyframe_animation_active - || animation_runtime_state->filter_keyframe_animation_filled); + || animation_runtime_state->keyframe_filter_override); } bool transform_animation_active_value() const noexcept diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_animations.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_animations.inc index da8191861..caae6aa5d 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_animations.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_animations.inc @@ -248,160 +248,115 @@ void native_document::update_style_animations(dom_node& node) animation.top_animation_active, animation.top_animation_start_event_sent); - const auto opacity_keyframe_changed = - animation.opacity_keyframe_animation_signature - != node.style.animations().opacity_keyframe_animation_signature; - const auto rotation_keyframe_changed = - animation.rotation_keyframe_animation_signature - != node.style.animations().rotation_keyframe_animation_signature; - const auto filter_keyframe_changed = - animation.filter_keyframe_animation_signature - != node.style.animations().filter_keyframe_animation_signature; - const auto fill_mode_changed = animation.keyframe_fill_mode - != node.style.animations().keyframe_fill_mode; - const auto has_configured_keyframes = - !node.style.animations().opacity_keyframe_animation_signature.empty() - || !node.style.animations().rotation_keyframe_animation_signature.empty() - || !node.style.animations().filter_keyframe_animation_signature.empty(); - const auto desired_keyframe_pause = has_configured_keyframes - && node.style.animations().keyframe_play_state - == node_style::animation_data::play_kind::paused; - const auto was_keyframe_paused = animation.keyframe_animation_paused; - const auto previous_pause_timestamp = - animation.keyframe_animation_paused_at_ms; - animation.keyframe_fill_mode = node.style.animations().keyframe_fill_mode; - if (opacity_keyframe_changed || rotation_keyframe_changed - || filter_keyframe_changed) { - animation.keyframe_animation_end_event_sent = false; + const auto& configured_keyframes = node.style.animations().keyframe_animations; + auto keyframe_set_changed = animation.keyframe_animations.size() + != configured_keyframes.size(); + for (size_t index = 0U; + !keyframe_set_changed && index < configured_keyframes.size(); ++index) { + keyframe_set_changed = animation.keyframe_animations[index].signature + != configured_keyframes[index].signature; } - if (opacity_keyframe_changed) { - animation.opacity_keyframe_animation_signature = - node.style.animations().opacity_keyframe_animation_signature; - animation.opacity_keyframe_animation_started_ms = animation_frame_timestamp_ms_; - animation.opacity_keyframe_animation_active = - !animation.opacity_keyframe_animation_signature.empty() - && node.style.animations().opacity_keyframes.size() >= 2U - && node.style.animations().opacity_keyframe_duration_ms > 0 - && node.style.animations().opacity_keyframe_iterations != 0; - if (!animation.opacity_keyframe_animation_active) { - animation.painted_opacity = node.style.opacity; - } + if (keyframe_set_changed && animation_events_) { + std::erase_if(*animation_events_, [&](const auto& event) { + return event.node_id == node.id; + }); } - if (rotation_keyframe_changed) { - animation.rotation_keyframe_animation_signature = - node.style.animations().rotation_keyframe_animation_signature; - animation.rotation_keyframe_animation_started_ms = animation_frame_timestamp_ms_; - animation.rotation_keyframe_animation_filled = false; - animation.rotation_keyframe_animation_active = - !animation.rotation_keyframe_animation_signature.empty() - && node.style.animations().rotation_keyframes.size() >= 2U - && node.style.animations().opacity_keyframe_duration_ms > 0 - && node.style.animations().opacity_keyframe_iterations != 0; - if (!animation.rotation_keyframe_animation_active) { - animation.painted_transform_rotate_degrees = node.style.transform_rotate_degrees; - } + if (animation.keyframe_animations.size() > configured_keyframes.size()) { + animation.keyframe_animations.resize(configured_keyframes.size()); } - if (filter_keyframe_changed - || !animation.filter_keyframe_animation_signature.empty()) { - const auto& effects = node.style.textual().effect_values; - const auto authored = effects.find("filter"); - const auto value = authored == effects.end() - ? std::string_view{"none"} - : std::string_view{authored->second}; - if (!parse_foreground_filters( - node, value, animation.filter_keyframe_underlying)) { - animation.filter_keyframe_underlying.clear(); - } + while (animation.keyframe_animations.size() < configured_keyframes.size()) { + animation.keyframe_animations.emplace_back(); } - if (filter_keyframe_changed) { - animation.filter_keyframe_animation_signature = - node.style.animations().filter_keyframe_animation_signature; - animation.filter_keyframe_animation_started_ms = animation_frame_timestamp_ms_; - animation.filter_keyframe_animation_active = false; - animation.filter_keyframe_animation_valid = false; - animation.filter_keyframe_animation_filled = false; - animation.filter_keyframes.clear(); - auto valid = !animation.filter_keyframe_animation_signature.empty() - && node.style.animations().filter_keyframes.size() >= 2U - && node.style.animations().opacity_keyframe_duration_ms > 0 - && node.style.animations().opacity_keyframe_iterations != 0; - size_t longest = 0U; - for (const auto& source : node.style.animations().filter_keyframes) { - dom_node::animation_runtime_data::retained_filter_keyframe stop; - stop.offset = source.offset; - valid = valid - && parse_foreground_filters(node, source.value, stop.functions); - stop.authored_none = stop.functions.empty(); - animation.filter_keyframes.push_back(std::move(stop)); - if (animation.filter_keyframes.back().functions.size() - > animation.filter_keyframes[longest].functions.size()) { - longest = animation.filter_keyframes.size() - 1U; - } - } - if (valid) { - const auto canonical = animation.filter_keyframes[longest].functions; - for (auto& stop : animation.filter_keyframes) { - auto expected = canonical; - if (!make_retained_filter_lists_compatible( - stop.functions, expected)) { - valid = false; - break; + for (size_t track_index = 0U; + track_index < configured_keyframes.size(); ++track_index) { + const auto& configured = configured_keyframes[track_index]; + auto& runtime = animation.keyframe_animations[track_index]; + const auto identity_changed = runtime.signature != configured.signature; + const auto fill_changed = runtime.fill_mode != configured.fill_mode; + const auto was_paused = runtime.paused; + const auto previous_pause_timestamp = runtime.paused_at_ms; + const auto desired_pause = !configured.signature.empty() + && configured.play_state + == node_style::animation_data::play_kind::paused; + runtime.name = configured.name; + runtime.fill_mode = configured.fill_mode; + if (identity_changed) { + runtime.signature = configured.signature; + runtime.started_ms = animation_frame_timestamp_ms_; + runtime.active = !configured.signature.empty(); + runtime.filled = false; + runtime.end_event_sent = false; + runtime.filter_valid = false; + runtime.filter_keyframes.clear(); + runtime.filter_underlying.clear(); + runtime.painted_filter_functions.clear(); + runtime.painted_opacity = node.style.opacity; + runtime.painted_rotation_degrees = node.style.transform_rotate_degrees; + if (!configured.filter_keyframes.empty()) { + auto valid = configured.filter_keyframes.size() >= 2U; + size_t longest = 0U; + for (const auto& source : configured.filter_keyframes) { + dom_node::animation_runtime_data::retained_filter_keyframe stop; + stop.offset = source.offset; + valid = valid + && parse_foreground_filters(node, source.value, stop.functions); + stop.authored_none = stop.functions.empty(); + runtime.filter_keyframes.push_back(std::move(stop)); + if (runtime.filter_keyframes.back().functions.size() + > runtime.filter_keyframes[longest].functions.size()) { + longest = runtime.filter_keyframes.size() - 1U; + } + } + if (valid) { + const auto canonical = + runtime.filter_keyframes[longest].functions; + for (auto& stop : runtime.filter_keyframes) { + auto expected = canonical; + if (!make_retained_filter_lists_compatible( + stop.functions, expected)) { + valid = false; + break; + } + } + } + runtime.filter_valid = valid; + if (configured.opacity_keyframes.size() < 2U + && configured.rotation_keyframes.size() < 2U && !valid) { + runtime.active = false; } } + } else if (fill_changed && !runtime.signature.empty()) { + runtime.active = true; + runtime.filled = false; } - animation.filter_keyframe_animation_valid = valid; - animation.filter_keyframe_animation_active = valid; - animation.painted_filter_functions = - animation.filter_keyframe_underlying; - } - if (fill_mode_changed) { - if (!opacity_keyframe_changed) { - animation.opacity_keyframe_animation_active = - !animation.opacity_keyframe_animation_signature.empty() - && node.style.animations().opacity_keyframes.size() >= 2U - && node.style.animations().opacity_keyframe_duration_ms > 0 - && node.style.animations().opacity_keyframe_iterations != 0; - } - if (!rotation_keyframe_changed) { - animation.rotation_keyframe_animation_filled = false; - animation.rotation_keyframe_animation_active = - !animation.rotation_keyframe_animation_signature.empty() - && node.style.animations().rotation_keyframes.size() >= 2U - && node.style.animations().opacity_keyframe_duration_ms > 0 - && node.style.animations().opacity_keyframe_iterations != 0; - } - if (!filter_keyframe_changed) { - animation.filter_keyframe_animation_filled = false; - animation.filter_keyframe_animation_active = - animation.filter_keyframe_animation_valid; - } - } - const auto keyframe_identity_changed = opacity_keyframe_changed - || rotation_keyframe_changed || filter_keyframe_changed; - if (was_keyframe_paused - && (!desired_keyframe_pause || keyframe_identity_changed)) { - const auto held_duration = std::max( - 0.0, animation_frame_timestamp_ms_ - previous_pause_timestamp); - if (!opacity_keyframe_changed - && animation.opacity_keyframe_animation_active) { - animation.opacity_keyframe_animation_started_ms += held_duration; + if (!configured.filter_keyframes.empty()) { + const auto& effects = node.style.textual().effect_values; + const auto authored = effects.find("filter"); + const auto value = authored == effects.end() + ? std::string_view{"none"} + : std::string_view{authored->second}; + if (!parse_foreground_filters( + node, value, runtime.filter_underlying)) { + runtime.filter_underlying.clear(); + } + if (identity_changed) { + runtime.painted_filter_functions = runtime.filter_underlying; + } } - if (!rotation_keyframe_changed - && animation.rotation_keyframe_animation_active) { - animation.rotation_keyframe_animation_started_ms += held_duration; + if (was_paused && (!desired_pause || identity_changed)) { + const auto held_duration = std::max( + 0.0, animation_frame_timestamp_ms_ - previous_pause_timestamp); + if (!identity_changed && runtime.active) { + runtime.started_ms += held_duration; + } } - if (!filter_keyframe_changed - && animation.filter_keyframe_animation_active) { - animation.filter_keyframe_animation_started_ms += held_duration; + runtime.paused = desired_pause; + if (desired_pause && (!was_paused || identity_changed)) { + runtime.paused_at_ms = animation_frame_timestamp_ms_; + } else if (configured.signature.empty()) { + runtime.paused_at_ms = 0; } } - animation.keyframe_animation_paused = desired_keyframe_pause; - if (desired_keyframe_pause - && (!was_keyframe_paused || keyframe_identity_changed)) { - animation.keyframe_animation_paused_at_ms = animation_frame_timestamp_ms_; - } else if (!has_configured_keyframes) { - animation.keyframe_animation_paused_at_ms = 0; - } if (animation.opacity_animation_active && node.style.animations().transition_property_value == "none") { transition_events_.push_back({node.id,"transitioncancel","opacity", @@ -1087,273 +1042,197 @@ bool native_document::advance_animations() noexcept } } - auto keyframe_animation_completed = false; - const auto keyframe_timestamp_ms = animation.keyframe_animation_paused - ? animation.keyframe_animation_paused_at_ms - : animation_frame_timestamp_ms_; - if (animation.opacity_keyframe_animation_active) { - const auto sample_opacity = [&](float cycle_progress) { - const auto& stops = node.style.animations().opacity_keyframes; + const auto previous_opacity_override = + animation.keyframe_opacity_override; + const auto previous_rotation_override = + animation.keyframe_rotation_override; + const auto previous_filter_override = + animation.keyframe_filter_override; + animation.keyframe_opacity_override = false; + animation.keyframe_rotation_override = false; + animation.keyframe_filter_override = false; + auto winning_opacity = node.style.opacity; + auto winning_rotation = node.style.transform_rotate_degrees; + const std::vector* winning_filter = nullptr; + const std::vector* filter_underlying = nullptr; + for (size_t track_index = 0U; + track_index < animation.keyframe_animations.size() + && track_index < node.style.animations().keyframe_animations.size(); + ++track_index) { + auto& runtime = animation.keyframe_animations[track_index]; + const auto& configured = + node.style.animations().keyframe_animations[track_index]; + if (runtime.signature.empty()) continue; + if (!runtime.filter_underlying.empty()) { + filter_underlying = &runtime.filter_underlying; + } + auto contributes = false; + auto progress = 0.0F; + auto completed = false; + if (!runtime.active) { + contributes = runtime.filled; + } else { + const auto timestamp_ms = runtime.paused + ? runtime.paused_at_ms : animation_frame_timestamp_ms_; + const auto elapsed_ms = static_cast( + timestamp_ms - runtime.started_ms - configured.delay_ms); + if (elapsed_ms < 0) { + contributes = fills_before(configured.fill_mode); + if (contributes) { + progress = directed_keyframe_progress( + 0.0F, 0.0, configured.direction); + } + } else { + const auto duration = std::max(0.001F, configured.duration_ms); + const auto finite = std::isfinite(configured.iterations); + const auto total_duration = finite + ? duration * std::max(0.0F, configured.iterations) + : 0.0F; + if (finite && elapsed_ms >= total_duration) { + contributes = fills_after(configured.fill_mode); + if (contributes) { + progress = terminal_keyframe_progress( + configured.iterations, configured.direction); + } + if (!runtime.paused) { + runtime.active = false; + runtime.filled = contributes; + completed = true; + } + } else { + contributes = true; + runtime.filled = false; + progress = active_keyframe_progress( + elapsed_ms, duration, configured.direction); + } + } + } + const auto eased_segment = [&](float segment_progress) { + return timing_value( + segment_progress, + configured.x1, configured.y1, + configured.x2, configured.y2, + configured.timing_kind, + configured.step_count, + configured.step_position); + }; + if (contributes && configured.opacity_keyframes.size() >= 2U) { + const auto& stops = configured.opacity_keyframes; auto right = std::lower_bound( - stops.begin(), stops.end(), cycle_progress, - [](const node_style::opacity_keyframe& stop, float progress) { - return stop.offset < progress; + stops.begin(), stops.end(), progress, + [](const node_style::opacity_keyframe& stop, float value) { + return stop.offset < value; }); if (right == stops.begin()) { - animation.painted_opacity = right->opacity; + runtime.painted_opacity = right->opacity; } else if (right == stops.end()) { - animation.painted_opacity = stops.back().opacity; + runtime.painted_opacity = stops.back().opacity; } else { const auto& from = *(right - 1); - const auto span = std::max( - 0.0001F, right->offset - from.offset); - const auto segment_progress = std::clamp( - (cycle_progress - from.offset) / span, 0.0F, 1.0F); - const auto eased = timing_value( - segment_progress, - node.style.animations().opacity_keyframe_x1, - node.style.animations().opacity_keyframe_y1, - node.style.animations().opacity_keyframe_x2, - node.style.animations().opacity_keyframe_y2, - node.style.animations().opacity_keyframe_timing_kind, - node.style.animations().opacity_keyframe_step_count, - node.style.animations().opacity_keyframe_step_position); - animation.painted_opacity = from.opacity + const auto span = std::max(0.0001F, right->offset - from.offset); + const auto local = std::clamp( + (progress - from.offset) / span, 0.0F, 1.0F); + const auto eased = eased_segment(local); + runtime.painted_opacity = from.opacity + (right->opacity - from.opacity) * eased; } - }; - const auto elapsed_ms = static_cast( - keyframe_timestamp_ms - - animation.opacity_keyframe_animation_started_ms - - node.style.animations().opacity_keyframe_delay_ms); - if (elapsed_ms < 0) { - if (fills_before(node.style.animations().keyframe_fill_mode)) { - sample_opacity(directed_keyframe_progress( - 0.0F, 0.0, node.style.animations().keyframe_direction)); - } else { - animation.painted_opacity = node.style.opacity; - } - advanced = advanced || keyframe_paint_visible; - } else { - const auto duration = std::max( - 0.001F, node.style.animations().opacity_keyframe_duration_ms); - const auto iterations = node.style.animations().opacity_keyframe_iterations; - const auto finite = std::isfinite(iterations); - const auto total_duration = finite - ? duration * std::max(0.0F, iterations) - : 0.0F; - if (finite && elapsed_ms >= total_duration) { - if (fills_after(node.style.animations().keyframe_fill_mode)) { - sample_opacity(terminal_keyframe_progress( - iterations, node.style.animations().keyframe_direction)); - } else { - animation.painted_opacity = node.style.opacity; - } - if (!animation.keyframe_animation_paused) { - animation.opacity_keyframe_animation_active = false; - keyframe_animation_completed = true; - } - advanced = advanced || keyframe_paint_visible; - } else { - sample_opacity(active_keyframe_progress( - elapsed_ms, duration, - node.style.animations().keyframe_direction)); - advanced = advanced || keyframe_paint_visible; - } + winning_opacity = runtime.painted_opacity; + animation.keyframe_opacity_override = true; } - } - - if (animation.rotation_keyframe_animation_active) { - const auto sample_rotation = [&](float cycle_progress) { - const auto& stops = node.style.animations().rotation_keyframes; + if (contributes && configured.rotation_keyframes.size() >= 2U) { + const auto& stops = configured.rotation_keyframes; auto right = std::lower_bound( - stops.begin(), stops.end(), cycle_progress, - [](const node_style::rotation_keyframe& stop, float progress) { - return stop.offset < progress; + stops.begin(), stops.end(), progress, + [](const node_style::rotation_keyframe& stop, float value) { + return stop.offset < value; }); if (right == stops.begin()) { - animation.painted_transform_rotate_degrees = right->degrees; + runtime.painted_rotation_degrees = right->degrees; } else if (right == stops.end()) { - animation.painted_transform_rotate_degrees = stops.back().degrees; + runtime.painted_rotation_degrees = stops.back().degrees; } else { const auto& from = *(right - 1); - const auto span = std::max( - 0.0001F, right->offset - from.offset); - const auto segment_progress = std::clamp( - (cycle_progress - from.offset) / span, 0.0F, 1.0F); - const auto eased = timing_value( - segment_progress, - node.style.animations().opacity_keyframe_x1, - node.style.animations().opacity_keyframe_y1, - node.style.animations().opacity_keyframe_x2, - node.style.animations().opacity_keyframe_y2, - node.style.animations().opacity_keyframe_timing_kind, - node.style.animations().opacity_keyframe_step_count, - node.style.animations().opacity_keyframe_step_position); - animation.painted_transform_rotate_degrees = from.degrees + const auto span = std::max(0.0001F, right->offset - from.offset); + const auto local = std::clamp( + (progress - from.offset) / span, 0.0F, 1.0F); + const auto eased = eased_segment(local); + runtime.painted_rotation_degrees = from.degrees + (right->degrees - from.degrees) * eased; } - }; - const auto elapsed_ms = static_cast( - keyframe_timestamp_ms - - animation.rotation_keyframe_animation_started_ms - - node.style.animations().opacity_keyframe_delay_ms); - if (elapsed_ms < 0) { - if (fills_before(node.style.animations().keyframe_fill_mode)) { - sample_rotation(directed_keyframe_progress( - 0.0F, 0.0, node.style.animations().keyframe_direction)); - } else { - animation.painted_transform_rotate_degrees = - node.style.transform_rotate_degrees; - } - advanced = advanced || keyframe_paint_visible; - } else { - const auto duration = std::max( - 0.001F, node.style.animations().opacity_keyframe_duration_ms); - const auto iterations = node.style.animations().opacity_keyframe_iterations; - const auto finite = std::isfinite(iterations); - const auto total_duration = finite - ? duration * std::max(0.0F, iterations) - : 0.0F; - if (finite && elapsed_ms >= total_duration) { - if (fills_after(node.style.animations().keyframe_fill_mode)) { - sample_rotation(terminal_keyframe_progress( - iterations, node.style.animations().keyframe_direction)); - animation.rotation_keyframe_animation_filled = true; - } else { - animation.painted_transform_rotate_degrees = - node.style.transform_rotate_degrees; - animation.rotation_keyframe_animation_filled = false; - } - if (!animation.keyframe_animation_paused) { - animation.rotation_keyframe_animation_active = false; - keyframe_animation_completed = true; - } - advanced = advanced || keyframe_paint_visible; - } else { - sample_rotation(active_keyframe_progress( - elapsed_ms, duration, - node.style.animations().keyframe_direction)); - advanced = advanced || keyframe_paint_visible; - } + winning_rotation = runtime.painted_rotation_degrees; + animation.keyframe_rotation_override = true; } - } - - if (animation.filter_keyframe_animation_active) { - const auto sample_filter = [&](float cycle_progress) { - const auto& stops = animation.filter_keyframes; + if (contributes && runtime.filter_valid + && runtime.filter_keyframes.size() >= 2U) { + const auto& stops = runtime.filter_keyframes; const auto assign_stop = [&](const auto& stop) { if (stop.authored_none) { - animation.painted_filter_functions.clear(); + runtime.painted_filter_functions.clear(); } else { - animation.painted_filter_functions = stop.functions; + runtime.painted_filter_functions = stop.functions; } }; auto right = std::lower_bound( - stops.begin(), stops.end(), cycle_progress, - [](const auto& stop, float progress) { - return stop.offset < progress; + stops.begin(), stops.end(), progress, + [](const auto& stop, float value) { + return stop.offset < value; }); if (right == stops.begin()) { assign_stop(*right); } else if (right == stops.end()) { assign_stop(stops.back()); - } else if (std::abs(cycle_progress - right->offset) < 0.000001F) { + } else if (std::abs(progress - right->offset) < 0.000001F) { assign_stop(*right); } else { const auto& from = *(right - 1); - const auto span = std::max( - 0.0001F, right->offset - from.offset); - const auto segment_progress = std::clamp( - (cycle_progress - from.offset) / span, 0.0F, 1.0F); - const auto eased = timing_value( - segment_progress, - node.style.animations().opacity_keyframe_x1, - node.style.animations().opacity_keyframe_y1, - node.style.animations().opacity_keyframe_x2, - node.style.animations().opacity_keyframe_y2, - node.style.animations().opacity_keyframe_timing_kind, - node.style.animations().opacity_keyframe_step_count, - node.style.animations().opacity_keyframe_step_position); - animation.painted_filter_functions = from.functions; + const auto span = std::max(0.0001F, right->offset - from.offset); + const auto local = std::clamp( + (progress - from.offset) / span, 0.0F, 1.0F); + const auto eased = eased_segment(local); + runtime.painted_filter_functions = from.functions; for (size_t index = 0U; - index < animation.painted_filter_functions.size(); ++index) { - const auto start = from.functions[index].amount; - animation.painted_filter_functions[index].amount = start - + (right->functions[index].amount - start) * eased; + index < runtime.painted_filter_functions.size(); ++index) { + const auto initial = from.functions[index].amount; + runtime.painted_filter_functions[index].amount = initial + + (right->functions[index].amount - initial) * eased; } } - }; - const auto elapsed_ms = static_cast( - keyframe_timestamp_ms - - animation.filter_keyframe_animation_started_ms - - node.style.animations().opacity_keyframe_delay_ms); - if (elapsed_ms < 0) { - if (fills_before(node.style.animations().keyframe_fill_mode)) { - sample_filter(directed_keyframe_progress( - 0.0F, 0.0, node.style.animations().keyframe_direction)); - } else { - animation.painted_filter_functions = - animation.filter_keyframe_underlying; - } - advanced = advanced || keyframe_paint_visible; - } else { - const auto duration = std::max( - 0.001F, node.style.animations().opacity_keyframe_duration_ms); - const auto iterations = node.style.animations().opacity_keyframe_iterations; - const auto finite = std::isfinite(iterations); - const auto total_duration = finite - ? duration * std::max(0.0F, iterations) - : 0.0F; - if (finite && elapsed_ms >= total_duration) { - if (fills_after(node.style.animations().keyframe_fill_mode)) { - sample_filter(terminal_keyframe_progress( - iterations, node.style.animations().keyframe_direction)); - animation.filter_keyframe_animation_filled = true; - } else { - animation.painted_filter_functions = - animation.filter_keyframe_underlying; - animation.filter_keyframe_animation_filled = false; - } - if (!animation.keyframe_animation_paused) { - animation.filter_keyframe_animation_active = false; - keyframe_animation_completed = true; - } - advanced = advanced || keyframe_paint_visible; - } else { - sample_filter(active_keyframe_progress( - elapsed_ms, duration, - node.style.animations().keyframe_direction)); - advanced = advanced || keyframe_paint_visible; + winning_filter = &runtime.painted_filter_functions; + animation.keyframe_filter_override = true; + } + advanced = advanced || (contributes && keyframe_paint_visible); + if (completed && !runtime.end_event_sent) { + if (!animation_events_) { + animation_events_ = + std::make_unique>(); } + animation_events_->push_back({ + node.id, + "animationend", + runtime.name, + configured.duration_ms * configured.iterations / 1000.0F}); + runtime.end_event_sent = true; } } - if (keyframe_animation_completed - && !animation.opacity_keyframe_animation_active - && !animation.rotation_keyframe_animation_active - && !animation.filter_keyframe_animation_active - && !animation.keyframe_animation_end_event_sent) { - auto animation_name = node.style.animations().animation_name_value; - if (const auto comma = animation_name.find(','); - comma != std::string::npos) { - animation_name.erase(comma); - } - const auto first = animation_name.find_first_not_of(" \t\r\n"); - const auto last = animation_name.find_last_not_of(" \t\r\n"); - if (first != std::string::npos) { - animation_name = animation_name.substr(first, last - first + 1U); - } - if (!animation_events_) { - animation_events_ = - std::make_unique>(); + if (animation.keyframe_opacity_override) { + animation.painted_opacity = winning_opacity; + } else if (previous_opacity_override) { + animation.painted_opacity = node.style.opacity; + } + if (animation.keyframe_rotation_override) { + animation.painted_transform_rotate_degrees = winning_rotation; + } else if (previous_rotation_override) { + animation.painted_transform_rotate_degrees = + node.style.transform_rotate_degrees; + } + if (animation.keyframe_filter_override && winning_filter != nullptr) { + animation.painted_filter_functions = *winning_filter; + } else if (previous_filter_override && !animation.filter_animation_active) { + if (filter_underlying != nullptr) { + animation.painted_filter_functions = *filter_underlying; + } else { + animation.painted_filter_functions.clear(); } - animation_events_->push_back({ - node.id, - "animationend", - std::move(animation_name), - node.style.animations().opacity_keyframe_duration_ms - * node.style.animations().opacity_keyframe_iterations / 1000.0F}); - animation.keyframe_animation_end_event_sent = true; } } // Opacity, colors, filters, scale, and rotation are paint-only. @@ -1385,12 +1264,13 @@ bool native_document::has_active_animations() const noexcept || animation->color_animation_active || animation->background_color_animation_active || animation->filter_animation_active; - const auto keyframe_active = animation->opacity_keyframe_animation_active - || animation->rotation_keyframe_animation_active - || animation->filter_keyframe_animation_active; + const auto keyframe_active = std::any_of( + animation->keyframe_animations.begin(), + animation->keyframe_animations.end(), [](const auto& track) { + return track.active && !track.paused; + }); return transition_active - || (keyframe_active && !animation->keyframe_animation_paused - && intersects_visible_paint_area(*node)); + || (keyframe_active && intersects_visible_paint_area(*node)); }); active_animation_demand_cache_valid_ = true; return active_animation_demand_cache_; diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_metrics.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_metrics.inc index 33130e20a..5e3183372 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_metrics.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_metrics.inc @@ -149,16 +149,21 @@ native_document::allocation_metrics native_document::read_allocation_metrics() c * sizeof(retained_filter_function) + animation->filter_animation_target.capacity() * sizeof(retained_filter_function) - + animation->opacity_keyframe_animation_signature.capacity() + 1U - + animation->rotation_keyframe_animation_signature.capacity() + 1U - + animation->filter_keyframe_animation_signature.capacity() + 1U - + animation->filter_keyframes.capacity() - * sizeof(dom_node::animation_runtime_data::retained_filter_keyframe) - + animation->filter_keyframe_underlying.capacity() - * sizeof(retained_filter_function); - for (const auto& stop : animation->filter_keyframes) { - result.animation_runtime_storage_bytes += stop.functions.capacity() - * sizeof(retained_filter_function); + + animation->keyframe_animations.capacity() + * sizeof(dom_node::animation_runtime_data::keyframe_animation_runtime); + for (const auto& track : animation->keyframe_animations) { + result.animation_runtime_storage_bytes += + track.name.capacity() + track.signature.capacity() + 2U + + track.filter_keyframes.capacity() + * sizeof(dom_node::animation_runtime_data::retained_filter_keyframe) + + track.filter_underlying.capacity() + * sizeof(retained_filter_function) + + track.painted_filter_functions.capacity() + * sizeof(retained_filter_function); + for (const auto& stop : track.filter_keyframes) { + result.animation_runtime_storage_bytes += stop.functions.capacity() + * sizeof(retained_filter_function); + } } } if (node == nullptr || !node->has_canvas_data()) continue; @@ -208,17 +213,23 @@ native_document::allocation_metrics native_document::read_allocation_metrics() c + string_bytes(animations->animation_delay_value) + string_bytes(animations->animation_timing_function_value) + string_bytes(animations->animation_iteration_count_value) - + string_bytes(animations->opacity_keyframe_animation_signature) - + string_bytes(animations->rotation_keyframe_animation_signature) - + string_bytes(animations->filter_keyframe_animation_signature) - + animations->opacity_keyframes.capacity() - * sizeof(node_style::opacity_keyframe) - + animations->rotation_keyframes.capacity() - * sizeof(node_style::rotation_keyframe) - + animations->filter_keyframes.capacity() - * sizeof(node_style::filter_keyframe); - for (const auto& stop : animations->filter_keyframes) { - result.animation_storage_bytes += string_bytes(stop.value); + + string_bytes(animations->animation_direction_value) + + string_bytes(animations->animation_fill_mode_value) + + string_bytes(animations->animation_play_state_value) + + animations->keyframe_animations.capacity() + * sizeof(node_style::animation_data::keyframe_animation); + for (const auto& track : animations->keyframe_animations) { + result.animation_storage_bytes += + string_bytes(track.name) + string_bytes(track.signature) + + track.opacity_keyframes.capacity() + * sizeof(node_style::opacity_keyframe) + + track.rotation_keyframes.capacity() + * sizeof(node_style::rotation_keyframe) + + track.filter_keyframes.capacity() + * sizeof(node_style::filter_keyframe); + for (const auto& stop : track.filter_keyframes) { + result.animation_storage_bytes += string_bytes(stop.value); + } } } result.background_image_data_count = background_allocations.size(); diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_tree.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_tree.inc index 142930a8a..390b802c8 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_tree.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_tree.inc @@ -620,6 +620,14 @@ size_t native_document::erase_detached_subtrees( } #endif } + if (animation_events_) { + std::erase_if(*animation_events_, [&](const auto& event) { + return event.node_id == 0U + || event.node_id > native_id_index_.size() + || native_id_index_[event.node_id - 1U] == nullptr; + }); + if (animation_events_->empty()) animation_events_.reset(); + } if (shadow_dom_storage_ != nullptr) { for (const auto* node : removed) { shadow_dom_storage_->node_data.erase(node->id); diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_cascade.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_cascade.inc index 4b66aa116..b9ae0126d 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_cascade.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_cascade.inc @@ -147,12 +147,14 @@ void configure_style_keyframe_animation(dom_node& node) { css::configure_keyframes(node.style,opacity_keyframes); - if (!node.style.animations().opacity_keyframe_animation_signature.empty()) - record_composition("css-opacity-keyframe-animation",node.id); - if (!node.style.animations().rotation_keyframe_animation_signature.empty()) - record_composition("css-rotation-keyframe-animation",node.id); - if (!node.style.animations().filter_keyframe_animation_signature.empty()) - record_composition("css-filter-keyframe-animation",node.id); + for (const auto& track : node.style.animations().keyframe_animations) { + if (track.opacity_keyframes.size() >= 2U) + record_composition("css-opacity-keyframe-animation",node.id); + if (track.rotation_keyframes.size() >= 2U) + record_composition("css-rotation-keyframe-animation",node.id); + if (track.filter_keyframes.size() >= 2U) + record_composition("css-filter-keyframe-animation",node.id); + } } void recompute_cascaded_line_height(dom_node& node,const std::vector& rules) diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_style.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_style.inc index a0fcd168d..f6325d823 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_style.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_style.inc @@ -2045,14 +2045,7 @@ || name == "transition-timing-function") { value = node->style.animations().transition_timing_function_value; } else if (name == "animation") { - value = node->style.animations().animation_name_value + " " - + node->style.animations().animation_duration_value + " " - + node->style.animations().animation_timing_function_value + " " - + node->style.animations().animation_delay_value + " " - + node->style.animations().animation_iteration_count_value + " " - + node->style.animations().animation_direction_value + " " - + node->style.animations().animation_fill_mode_value + " " - + node->style.animations().animation_play_state_value; + value = css::serialize_animation_shorthand(node->style.animations()); } else if (name == "animationName" || name == "animation-name") { value = node->style.animations().animation_name_value; } else if (name == "animationDuration" || name == "animation-duration") { diff --git a/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_animation_cssom_tests.inc b/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_animation_cssom_tests.inc index d77112f4e..c0f736641 100644 --- a/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_animation_cssom_tests.inc +++ b/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_animation_cssom_tests.inc @@ -965,6 +965,103 @@ void test_animation_play_state_holds_and_resumes_host_time( engine, false, "detached play-state animations retained host-frame demand"); } +void test_multiple_animation_lists_coordinate_bounded_tracks( + webscene_engine* engine) +{ + animation_frame_and_wait(engine, 10000.0, 7120U); + execute_and_wait(engine, R"JS( + (() => { + document.body.innerHTML = ` + +
+
`; + globalThis.__listEnds = []; + document.getElementById('ordered').addEventListener( + 'animationend', event => __listEnds.push(event.animationName)); + void document.body.offsetHeight; + })() + )JS", "animation-list-setup.js"); + + animation_frame_and_wait(engine, 10250.0, 7121U); + const auto coordinated = evaluate(engine, R"JS( + (() => { + const node = document.getElementById('coordinated'); + const style = getComputedStyle(node); + const capped = Number(getComputedStyle( + document.getElementById('capped')).opacity); + return style.animationName === 'list-low, list-high' + && style.animationDuration === '1000ms' + && style.animationDelay === '0ms, 500ms' + && style.animationPlayState === 'running, paused' + && style.animation.split(',').length === 2 + && Math.abs(Number(style.opacity) - 1) < .001 + && Math.abs(capped - .8) < .001; + })() + )JS", "animation-list-coordination.js"); + require(coordinated == "true", + "animation lists did not repeat, serialize, compose, or honor the track cap"); + + animation_frame_and_wait(engine, 10500.0, 7122U); + const auto ordered = evaluate(engine, + "JSON.stringify(__listEnds)", "animation-list-end-order.js"); + require(ordered == R"JSON(["list-low","list-high"])JSON", + "same-frame animationend records were not dispatched in list order: " + ordered); + wait_for_animation_frame_demand( + engine, true, "running coordinated animation lost host-frame demand"); + + execute_and_wait(engine, R"JS( + (() => { + const node = document.getElementById('coordinated'); + node.style.animationName = 'list-low'; + return node.style.animationName; + })() + )JS", "animation-list-remove-track.js"); + animation_frame_and_wait(engine, 10750.0, 7123U); + const auto removed = evaluate(engine, R"JS( + (() => { + const node = document.getElementById('coordinated'); + return getComputedStyle(node).animationName === 'list-low' + && Number(getComputedStyle(node).opacity) < .4; + })() + )JS", "animation-list-remove-track-result.js"); + require(removed == "true", "removed animation left a later retained override"); + + execute_and_wait(engine, + "document.body.innerHTML = '
animation lists detached
'", + "animation-list-detach.js"); + wait_for_animation_frame_demand( + engine, false, "detached animation lists retained host-frame demand"); +} + void test_filter_keyframes_use_host_clock_and_retained_paint( webscene_engine* engine) { diff --git a/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_tests.cpp b/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_tests.cpp index 4322cc8b8..603ff70d6 100644 --- a/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_tests.cpp +++ b/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_tests.cpp @@ -1140,6 +1140,7 @@ int main() test_animation_direction_maps_cycles_and_terminal_boundaries(focused_engine); test_animation_fill_maps_before_after_and_preserves_timeline(focused_engine); test_animation_play_state_holds_and_resumes_host_time(focused_engine); + test_multiple_animation_lists_coordinate_bounded_tracks(focused_engine); webscene_engine_destroy(focused_engine); return 0; } @@ -1637,6 +1638,7 @@ int main() test_animation_direction_maps_cycles_and_terminal_boundaries(engine); test_animation_fill_maps_before_after_and_preserves_timeline(engine); test_animation_play_state_holds_and_resumes_host_time(engine); + test_multiple_animation_lists_coordinate_bounded_tracks(engine); // This regression uses fixed host timestamps beginning at 2700 ms. Give it // a fresh timeline so earlier animation tests cannot make those frames stale. webscene_engine_destroy(engine); diff --git a/tests/WebPlatformSubset/capabilities.json b/tests/WebPlatformSubset/capabilities.json index 2b27965d5..24282bf1a 100644 --- a/tests/WebPlatformSubset/capabilities.json +++ b/tests/WebPlatformSubset/capabilities.json @@ -97,11 +97,11 @@ }, { "family": "transitions-and-animation", - "required": ["host-frame-driven requestAnimationFrame", "transition longhands and delay", "four-number cubic-bezier timing", "translate, scale, rotate, opacity, foreground color, background color, supported compound filters, left and top interpolation", "background shorthand transition aliasing", "filter none identity interpolation", "logical inset transition aliasing", "intermediate computed style, paint and client geometry", "transition run/start/cancel/end events", "cancellation and reversal", "bounded paint samples", "dense bounded rotation cadence", "native opacity, rotate, and bounded filter keyframes", "native animation shorthand and longhands", "native staggered delay and infinite iteration", "single-animation normal, reverse, alternate, and alternate-reverse direction", "single-animation none, forwards, backwards, and both fill", "single-animation running and paused play state"], + "required": ["host-frame-driven requestAnimationFrame", "transition longhands and delay", "four-number cubic-bezier timing", "translate, scale, rotate, opacity, foreground color, background color, supported compound filters, left and top interpolation", "background shorthand transition aliasing", "filter none identity interpolation", "logical inset transition aliasing", "intermediate computed style, paint and client geometry", "transition run/start/cancel/end events", "cancellation and reversal", "bounded paint samples", "dense bounded rotation cadence", "native opacity, rotate, and bounded filter keyframes", "native animation shorthand and longhands", "native staggered delay and infinite iteration", "single-animation normal, reverse, alternate, and alternate-reverse direction", "single-animation none, forwards, backwards, and both fill", "single-animation running and paused play state", "bounded comma-separated animation lists"], "candidate": ["innerHTML transition-longhand retention", "inline transition recascade and per-longhand importance", "computed transition times serialized in seconds", "synthetic click timer task ordering"], "productEvidence": ["calendar segmented-tab underline", "Code OSS Chat and session filter transitions", "Code OSS dictation brightness and incremental Chat blur keyframes", "automatically discovered three-dot loader animation", "automatically discovered rotating spinner", "animated toolbar and dialog state changes", "continuous live-resize chart layout"], - "coverage": ["contracts/segmented-transform-transition.html", "contracts/transform-none-transition.html", "contracts/paint-transitions-temporal.html", "contracts/css-filter-transition-temporal.html", "contracts/css-filter-transition-midpoint.html", "contracts/logical-inset-transition-cadence.html", "contracts/rotation-transition-cadence.html", "contracts/dynamic-transition-style-task-order.html", "contracts/css-opacity-keyframes-temporal.html", "contracts/css-animation-fill-mode-forwards.html", "contracts/css-animation-fill-mode-boundaries.html", "contracts/css-animation-direction.html", "contracts/css-animation-play-state.html", "contracts/css-rotation-keyframes-cadence.html", "contracts/css-filter-keyframes-temporal.html", "contracts/css-filter-keyframes-midpoint.html", "CssTransformTransitionTests", "test_inline_transition_longhands_survive_dynamic_parse_and_recascade", "test_logical_inset_transition_smooths_throttled_pointer_updates", "test_filter_keyframes_use_host_clock_and_retained_paint", "test_animation_direction_maps_cycles_and_terminal_boundaries", "test_animation_fill_maps_before_after_and_preserves_timeline", "test_animation_play_state_holds_and_resumes_host_time", "native host-clock transition, retained filter paint, and keyframe regressions", "hosted component automatically discovered temporal checkpoints", "hosted component intermediate viewport-publication gate"], - "gap": "Native is required to pass the bounded transform/opacity/foreground-color/background-color/filter transition slice, including events, cancellation, reversal, authored compound order, identity interpolation, paint, and cadence. Filter transitions and keyframes are limited to the retained blur, brightness, contrast, grayscale, and saturate functions and their existing list/value bounds. Bounded filter keyframes cover Code OSS dictation brightness and incremental Chat blur, including compatible compound order, none identities, finite fill, animationend, retained paint, and host-clock cleanup. The single-animation keyframe slice maps normal, reverse, alternate, and alternate-reverse through negative delays and finite, fractional, or infinite iteration counts before opacity, rotation, and bounded-filter sampling. For positive-duration, nonzero-count animations, none, forwards, backwards, and both apply direction-aware fill boundaries to those supported properties without extending frame demand; positive-delay backwards fill samples its boundary without applying the between-keyframe timing function. Running and paused play state now hold and resume the same bounded host-clock timeline, including delay, direction, fill, supported-property paint, exactly-once completion, and zero paused frame demand. Identity interpolation from transform:none is part of the neutral forward/reverse contract. The candidate dynamic-style reduction passes Chrome and native and closes Bootstrap Modal's static-backdrop callback guard by retaining inline transition longhands through parser construction and recascade, honoring per-longhand importance, and exposing computed times in seconds. Native also passes candidate opacity and rotate() CSS Animations contracts, while generic discovery proves changing staggered-dot and spinner paint samples. Other animated properties, zero-duration or zero-count fill, multiple-animation composition, and the complete Web Animations API are not claimed." + "coverage": ["contracts/segmented-transform-transition.html", "contracts/transform-none-transition.html", "contracts/paint-transitions-temporal.html", "contracts/css-filter-transition-temporal.html", "contracts/css-filter-transition-midpoint.html", "contracts/logical-inset-transition-cadence.html", "contracts/rotation-transition-cadence.html", "contracts/dynamic-transition-style-task-order.html", "contracts/css-opacity-keyframes-temporal.html", "contracts/css-animation-fill-mode-forwards.html", "contracts/css-animation-fill-mode-boundaries.html", "contracts/css-animation-direction.html", "contracts/css-animation-play-state.html", "contracts/css-animation-multiple-lists.html", "contracts/css-rotation-keyframes-cadence.html", "contracts/css-filter-keyframes-temporal.html", "contracts/css-filter-keyframes-midpoint.html", "CssTransformTransitionTests", "test_inline_transition_longhands_survive_dynamic_parse_and_recascade", "test_logical_inset_transition_smooths_throttled_pointer_updates", "test_filter_keyframes_use_host_clock_and_retained_paint", "test_animation_direction_maps_cycles_and_terminal_boundaries", "test_animation_fill_maps_before_after_and_preserves_timeline", "test_animation_play_state_holds_and_resumes_host_time", "test_multiple_animation_lists_coordinate_bounded_tracks", "native host-clock transition, retained filter paint, and keyframe regressions", "hosted component automatically discovered temporal checkpoints", "hosted component intermediate viewport-publication gate"], + "gap": "Native is required to pass the bounded transform/opacity/foreground-color/background-color/filter transition slice, including events, cancellation, reversal, authored compound order, identity interpolation, paint, and cadence. Filter transitions and keyframes are limited to the retained blur, brightness, contrast, grayscale, and saturate functions and their existing list/value bounds. Bounded filter keyframes cover Code OSS dictation brightness and incremental Chat blur, including compatible compound order, none identities, finite fill, animationend, retained paint, and host-clock cleanup. The single-animation keyframe slice maps normal, reverse, alternate, and alternate-reverse through negative delays and finite, fractional, or infinite iteration counts before opacity, rotation, and bounded-filter sampling. For positive-duration, nonzero-count animations, none, forwards, backwards, and both apply direction-aware fill boundaries to those supported properties without extending frame demand; positive-delay backwards fill samples its boundary without applying the between-keyframe timing function. Running and paused play state now hold and resume the same bounded host-clock timeline, including delay, direction, fill, supported-property paint, exactly-once completion, and zero paused frame demand. Up to eight comma-separated animations coordinate repeated longhand lists with independent clocks, fill, pause, ordered completion, and last-contributing replace composition for the supported properties. Identity interpolation from transform:none is part of the neutral forward/reverse contract. The candidate dynamic-style reduction passes Chrome and native and closes Bootstrap Modal's static-backdrop callback guard by retaining inline transition longhands through parser construction and recascade, honoring per-longhand importance, and exposing computed times in seconds. Native also passes candidate opacity and rotate() CSS Animations contracts, while generic discovery proves changing staggered-dot and spinner paint samples. Other animated properties, zero-duration or zero-count fill, additive animation composition, more than eight live tracks per element, and the complete Web Animations API are not claimed." }, { "family": "clipping-and-rounded-borders", diff --git a/tests/WebPlatformSubset/contracts/css-animation-multiple-lists.html b/tests/WebPlatformSubset/contracts/css-animation-multiple-lists.html new file mode 100644 index 000000000..7d7df7729 --- /dev/null +++ b/tests/WebPlatformSubset/contracts/css-animation-multiple-lists.html @@ -0,0 +1,78 @@ + + +Bounded comma-separated CSS animations coordinate independent tracks + +
+ diff --git a/tests/WebPlatformSubset/webscene-component-profile.json b/tests/WebPlatformSubset/webscene-component-profile.json index a8bb056bc..c3854158a 100644 --- a/tests/WebPlatformSubset/webscene-component-profile.json +++ b/tests/WebPlatformSubset/webscene-component-profile.json @@ -1895,6 +1895,13 @@ "evidence": ["css-animation-play-state-665-242"], "reason": "WPT-aligned single-animation reduction for running/paused metadata, positive- and negative-delay holds, mid-active pause and resume continuity, direction-aware supported-property paint, exactly-once completion, cleanup, and settled scheduling." }, + { + "path": "contracts/css-animation-multiple-lists.html", + "type": "contract", + "capabilities": ["animation-list-coordination", "longhand-list-repetition-and-truncation", "multi-item-shorthand-serialization", "independent-track-state", "last-contributing-replace-composition", "ordered-exactly-once-animation-end", "track-removal-cleanup", "bounded-frame-demand"], + "evidence": ["css-animation-multiple-lists-672-242"], + "reason": "WPT-aligned bounded reduction for coordinated animation lists, per-track clocks and state, supported-property replace composition, ordered completion, serialization, and cleanup." + }, { "path": "contracts/css-filter-keyframes-temporal.html", "type": "contract", diff --git a/tests/WebPlatformSubset/webscene-css-animation-multiple-lists-profile.json b/tests/WebPlatformSubset/webscene-css-animation-multiple-lists-profile.json new file mode 100644 index 000000000..814c843b4 --- /dev/null +++ b/tests/WebPlatformSubset/webscene-css-animation-multiple-lists-profile.json @@ -0,0 +1,30 @@ +{ + "profile": "webscene-css-animation-multiple-lists-1", + "wptRevision": "2c705104a295c48053eeddf7fe0170d790a4e853", + "runtime": "v8", + "viewport": { + "width": 800, + "height": 600, + "deviceScaleFactor": 1 + }, + "required": [ + { + "path": "contracts/css-animation-multiple-lists.html", + "type": "contract", + "capabilities": [ + "animation-list-coordination", + "longhand-list-repetition-and-truncation", + "multi-item-shorthand-serialization", + "independent-track-state", + "last-contributing-replace-composition", + "ordered-exactly-once-animation-end", + "track-removal-cleanup", + "bounded-frame-demand" + ], + "evidence": ["css-animation-multiple-lists-672-242"], + "reason": "WPT-aligned bounded reduction for coordinated CSS animation lists, per-track clocks and state, replace composition, ordered completion, CSSOM serialization, and removal cleanup." + } + ], + "harnessBlocked": [], + "excluded": [] +}