mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Avoid starting transitions if values can't be interpolated (#35234)
Bumps Stylo to https://github.com/servo/stylo/pull/115 This is mainly to avoid firing events like `transitionstart` when the transition isn't actually allowed. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
35835af857
commit
a4c6c205d2
3 changed files with 60 additions and 12 deletions
24
Cargo.lock
generated
24
Cargo.lock
generated
|
@ -1659,7 +1659,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dom"
|
name = "dom"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.8.0",
|
"bitflags 2.8.0",
|
||||||
"malloc_size_of",
|
"malloc_size_of",
|
||||||
|
@ -4424,7 +4424,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "malloc_size_of"
|
name = "malloc_size_of"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app_units",
|
"app_units",
|
||||||
"cssparser",
|
"cssparser",
|
||||||
|
@ -6437,7 +6437,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "selectors"
|
name = "selectors"
|
||||||
version = "0.26.0"
|
version = "0.26.0"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.8.0",
|
"bitflags 2.8.0",
|
||||||
"cssparser",
|
"cssparser",
|
||||||
|
@ -6722,7 +6722,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "servo_arc"
|
name = "servo_arc"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"stable_deref_trait",
|
"stable_deref_trait",
|
||||||
|
@ -6731,7 +6731,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "servo_atoms"
|
name = "servo_atoms"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"string_cache",
|
"string_cache",
|
||||||
"string_cache_codegen",
|
"string_cache_codegen",
|
||||||
|
@ -7100,7 +7100,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "static_prefs"
|
name = "static_prefs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strck"
|
name = "strck"
|
||||||
|
@ -7181,7 +7181,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "style"
|
name = "style"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app_units",
|
"app_units",
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
|
@ -7239,7 +7239,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "style_config"
|
name = "style_config"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
]
|
]
|
||||||
|
@ -7247,7 +7247,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "style_derive"
|
name = "style_derive"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
@ -7277,7 +7277,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "style_traits"
|
name = "style_traits"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app_units",
|
"app_units",
|
||||||
"bitflags 2.8.0",
|
"bitflags 2.8.0",
|
||||||
|
@ -7672,7 +7672,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "to_shmem"
|
name = "to_shmem"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cssparser",
|
"cssparser",
|
||||||
"servo_arc",
|
"servo_arc",
|
||||||
|
@ -7685,7 +7685,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "to_shmem_derive"
|
name = "to_shmem_derive"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2025-01-02#b2aff706472aa08db61ad1cae0e3dd54306f6fdf"
|
source = "git+https://github.com/servo/stylo?branch=2025-01-02#06e3f12281781e087d06f03ed506eb6c9355c3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|
7
tests/wpt/meta/MANIFEST.json
vendored
7
tests/wpt/meta/MANIFEST.json
vendored
|
@ -591977,6 +591977,13 @@
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
"transition-behavior-events.html": [
|
||||||
|
"e3e66c12dab0cac73657e992244e4adb9e831263",
|
||||||
|
[
|
||||||
|
null,
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
],
|
||||||
"transition-behavior.html": [
|
"transition-behavior.html": [
|
||||||
"4c2ddb3c63baa3e146af1427293c7dedd8b8564c",
|
"4c2ddb3c63baa3e146af1427293c7dedd8b8564c",
|
||||||
[
|
[
|
||||||
|
|
41
tests/wpt/tests/css/css-transitions/transition-behavior-events.html
vendored
Normal file
41
tests/wpt/tests/css/css-transitions/transition-behavior-events.html
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<title>CSS transition event dispatch depending on transition-behavior</title>
|
||||||
|
<link rel="author" title="Oriol Brufau" href="obrufau@igalia.com">
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-transitions-1/#event-transitionevent">
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-transitions-2/#transition-behavior-property">
|
||||||
|
<meta name="assert" content="
|
||||||
|
Even for a property like `width` which has a non-discrete animation type,
|
||||||
|
transitions among non-interpolable values should only start (as observed
|
||||||
|
by the `transitionrun` and `transitionstart` events) if discrete transitions
|
||||||
|
are allowed by `transition-behavior`.
|
||||||
|
">
|
||||||
|
<style>
|
||||||
|
#width1, #width2 {
|
||||||
|
width: auto;
|
||||||
|
transition: width 3s -1s linear;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id="width1" style="transition-behavior: normal"></div>
|
||||||
|
<div id="width2" style="transition-behavior: allow-discrete"></div>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script>
|
||||||
|
promise_setup(() => new Promise((resolve, reject) => {
|
||||||
|
for (let event of ["transitionrun", "transitionstart"]) {
|
||||||
|
let event_log = [];
|
||||||
|
addEventListener(event, event => {
|
||||||
|
event_log.push(event.target.id);
|
||||||
|
});
|
||||||
|
promise_test(async function() {
|
||||||
|
assert_array_equals(event_log, ["width2"], "Should only get " + event + " event on #width2");
|
||||||
|
}, event + " events");
|
||||||
|
}
|
||||||
|
document.body.offsetLeft;
|
||||||
|
addEventListener("error", event => reject(event.message));
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
document.getElementById("width1").style.width = document.getElementById("width2").style.width = "100px";
|
||||||
|
requestAnimationFrame(resolve);
|
||||||
|
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue