diff --git a/Cargo.lock b/Cargo.lock index edc7d9a0784..d301f693843 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1686,7 +1686,7 @@ dependencies = [ [[package]] name = "dom" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "bitflags 2.8.0", "malloc_size_of", @@ -4483,7 +4483,7 @@ dependencies = [ [[package]] name = "malloc_size_of" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "app_units", "cssparser", @@ -6488,7 +6488,7 @@ dependencies = [ [[package]] name = "selectors" version = "0.26.0" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "bitflags 2.8.0", "cssparser", @@ -6773,7 +6773,7 @@ dependencies = [ [[package]] name = "servo_arc" version = "0.4.0" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "serde", "stable_deref_trait", @@ -6782,7 +6782,7 @@ dependencies = [ [[package]] name = "servo_atoms" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "string_cache", "string_cache_codegen", @@ -7140,7 +7140,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "static_prefs" version = "0.1.0" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" [[package]] name = "strck" @@ -7220,7 +7220,7 @@ dependencies = [ [[package]] name = "style" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "app_units", "arrayvec", @@ -7278,7 +7278,7 @@ dependencies = [ [[package]] name = "style_config" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "lazy_static", ] @@ -7286,7 +7286,7 @@ dependencies = [ [[package]] name = "style_derive" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "darling", "proc-macro2", @@ -7316,7 +7316,7 @@ dependencies = [ [[package]] name = "style_traits" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "app_units", "bitflags 2.8.0", @@ -7710,7 +7710,7 @@ dependencies = [ [[package]] name = "to_shmem" version = "0.1.0" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "cssparser", "servo_arc", @@ -7723,7 +7723,7 @@ dependencies = [ [[package]] name = "to_shmem_derive" version = "0.1.0" -source = "git+https://github.com/servo/stylo?branch=2025-02-03#7eaabe1687ea6afa84c6d7d6b8c1b3466aa56a36" +source = "git+https://github.com/servo/stylo?branch=2025-02-03#8c57436148122c32b3cc3d40ee7c71806af1d087" dependencies = [ "darling", "proc-macro2", diff --git a/components/layout_2020/style_ext.rs b/components/layout_2020/style_ext.rs index c4a748bea18..d3156298fbc 100644 --- a/components/layout_2020/style_ext.rs +++ b/components/layout_2020/style_ext.rs @@ -5,6 +5,7 @@ use app_units::Au; use style::color::AbsoluteColor; use style::computed_values::direction::T as Direction; +use style::computed_values::isolation::T as ComputedIsolation; use style::computed_values::mix_blend_mode::T as ComputedMixBlendMode; use style::computed_values::position::T as ComputedPosition; use style::computed_values::transform_style::T as ComputedTransformStyle; @@ -602,6 +603,10 @@ impl ComputedValuesExt for ComputedValues { return true; } + if self.get_box().isolation == ComputedIsolation::Isolate { + return true; + } + // Fixed position and sticky position always create stacking contexts. // TODO(mrobinson): We need to handle sticky positioning here when we support it. if self.get_box().position == ComputedPosition::Fixed { diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index 5dfd071b218..a920226f3f1 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -122597,6 +122597,21 @@ ] ] }, + "isolation": { + "isolation-establishes-stacking-context.html": [ + "78d3b82caaccc6c14f1f62039a1554c1f18c4d83", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ] + }, "mix-blend-mode": { "mix-blend-mode-animation.html": [ "55618485d880d20668e7ab9d1379ef8792af5fe2", diff --git a/tests/wpt/meta/css/compositing/inheritance.html.ini b/tests/wpt/meta/css/compositing/inheritance.html.ini index 745aa2a9346..0eda0ac0a39 100644 --- a/tests/wpt/meta/css/compositing/inheritance.html.ini +++ b/tests/wpt/meta/css/compositing/inheritance.html.ini @@ -4,9 +4,3 @@ [Property background-blend-mode does not inherit] expected: FAIL - - [Property isolation has initial value auto] - expected: FAIL - - [Property isolation does not inherit] - expected: FAIL diff --git a/tests/wpt/meta/css/compositing/isolation/animation/isolation-no-interpolation.html.ini b/tests/wpt/meta/css/compositing/isolation/animation/isolation-no-interpolation.html.ini index 780e9743a4e..54453eb9c69 100644 --- a/tests/wpt/meta/css/compositing/isolation/animation/isolation-no-interpolation.html.ini +++ b/tests/wpt/meta/css/compositing/isolation/animation/isolation-no-interpolation.html.ini @@ -1,67 +1,4 @@ [isolation-no-interpolation.html] - [CSS Transitions: property from [initial\] to [isolate\] at (-0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [isolate\] at (0) should be [initial\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [isolate\] at (0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [isolate\] at (0.5) should be [isolate\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [isolate\] at (0.6) should be [isolate\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [isolate\] at (1) should be [isolate\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [isolate\] at (1.5) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [isolate\] at (-0.3) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [isolate\] at (0) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [isolate\] at (0.3) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [isolate\] at (0.5) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [isolate\] at (0.6) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [isolate\] at (1) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [isolate\] at (1.5) should be [isolate\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [isolate\] at (-0.3) should be [initial\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [isolate\] at (0) should be [initial\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [isolate\] at (0.3) should be [initial\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [isolate\] at (0.5) should be [isolate\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [isolate\] at (0.6) should be [isolate\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [isolate\] at (1) should be [isolate\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [isolate\] at (1.5) should be [isolate\]] - expected: FAIL - [Web Animations: property from [initial\] to [isolate\] at (-0.3) should be [initial\]] expected: FAIL @@ -82,54 +19,3 @@ [Web Animations: property from [initial\] to [isolate\] at (1.5) should be [isolate\]] expected: FAIL - - [CSS Transitions: property from [initial\] to [isolate\] at (-0.3) should be [isolate\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [isolate\] at (0) should be [isolate\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [isolate\] at (0.3) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition-behavior:allow-discrete: property from [initial\] to [isolate\] at (-0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions with transition-behavior:allow-discrete: property from [initial\] to [isolate\] at (0) should be [initial\]] - expected: FAIL - - [CSS Transitions with transition-behavior:allow-discrete: property from [initial\] to [isolate\] at (0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions with transition-behavior:allow-discrete: property from [initial\] to [isolate\] at (0.5) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition-behavior:allow-discrete: property from [initial\] to [isolate\] at (0.6) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition-behavior:allow-discrete: property from [initial\] to [isolate\] at (1) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition-behavior:allow-discrete: property from [initial\] to [isolate\] at (1.5) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial\] to [isolate\] at (-0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial\] to [isolate\] at (0) should be [initial\]] - expected: FAIL - - [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial\] to [isolate\] at (0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial\] to [isolate\] at (0.5) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial\] to [isolate\] at (0.6) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial\] to [isolate\] at (1) should be [isolate\]] - expected: FAIL - - [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property from [initial\] to [isolate\] at (1.5) should be [isolate\]] - expected: FAIL diff --git a/tests/wpt/meta/css/compositing/parsing/isolation-computed.html.ini b/tests/wpt/meta/css/compositing/parsing/isolation-computed.html.ini deleted file mode 100644 index 6761f039cab..00000000000 --- a/tests/wpt/meta/css/compositing/parsing/isolation-computed.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[isolation-computed.html] - [Property isolation value 'auto'] - expected: FAIL - - [Property isolation value 'isolate'] - expected: FAIL diff --git a/tests/wpt/meta/css/compositing/parsing/isolation-valid.html.ini b/tests/wpt/meta/css/compositing/parsing/isolation-valid.html.ini deleted file mode 100644 index 6d9593144de..00000000000 --- a/tests/wpt/meta/css/compositing/parsing/isolation-valid.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[isolation-valid.html] - [e.style['isolation'\] = "auto" should set the property value] - expected: FAIL - - [e.style['isolation'\] = "isolate" should set the property value] - expected: FAIL diff --git a/tests/wpt/tests/css/compositing/isolation/isolation-establishes-stacking-context.html b/tests/wpt/tests/css/compositing/isolation/isolation-establishes-stacking-context.html new file mode 100644 index 00000000000..78d3b82caac --- /dev/null +++ b/tests/wpt/tests/css/compositing/isolation/isolation-establishes-stacking-context.html @@ -0,0 +1,28 @@ + + +CSS Compositing and Blending: The isolation property + + + + + + + +

Test passes if there is a filled green square and no red.

+
+
+