Skip to content

Commit 3d25ea2

Browse files
committed
layout2020: backdrop filter creates a stacking context
Signed-off-by: Josh <36625023+JoshuaBrest@users.noreply.github.com>
1 parent 044f77d commit 3d25ea2

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed

Cargo.lock

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+10-10
Original file line numberDiff line numberDiff line change
@@ -115,25 +115,25 @@ rustls-pemfile = "2.0"
115115
rustls-pki-types = "1.11"
116116
script_layout_interface = { path = "components/shared/script_layout" }
117117
script_traits = { path = "components/shared/script" }
118-
selectors = { git = "https://github.com/servo/stylo", branch = "2025-02-03" }
118+
selectors = { git = "https://github.com/JoshuaBrest/stylo", branch = "stacking-context-backdrop-filter" }
119119
serde = "1.0.217"
120120
serde_bytes = "0.11"
121121
serde_json = "1.0"
122122
servo-media = { git = "https://github.com/servo/media" }
123123
servo-media-dummy = { git = "https://github.com/servo/media" }
124124
servo-media-gstreamer = { git = "https://github.com/servo/media" }
125-
servo_arc = { git = "https://github.com/servo/stylo", branch = "2025-02-03", features = ["servo"] }
126-
servo_atoms = { git = "https://github.com/servo/stylo", branch = "2025-02-03" }
125+
servo_arc = { git = "https://github.com/JoshuaBrest/stylo", branch = "stacking-context-backdrop-filter", features = ["servo"] }
126+
servo_atoms = { git = "https://github.com/JoshuaBrest/stylo", branch = "stacking-context-backdrop-filter" }
127127
smallbitvec = "2.5.3"
128128
smallvec = "1.13"
129129
static_assertions = "1.1"
130130
string_cache = "0.8"
131131
string_cache_codegen = "0.5"
132-
style = { git = "https://github.com/servo/stylo", branch = "2025-02-03", features = ["servo"] }
133-
style_config = { git = "https://github.com/servo/stylo", branch = "2025-02-03" }
134-
style_dom = { git = "https://github.com/servo/stylo", package = "dom", branch = "2025-02-03" }
135-
style_malloc_size_of = { package = "malloc_size_of", git = "https://github.com/servo/stylo", branch = "2025-02-03", features = ["servo"] }
136-
style_traits = { git = "https://github.com/servo/stylo", branch = "2025-02-03", features = ["servo"] }
132+
style = { git = "https://github.com/JoshuaBrest/stylo", branch = "stacking-context-backdrop-filter", features = ["servo"] }
133+
style_config = { git = "https://github.com/JoshuaBrest/stylo", branch = "stacking-context-backdrop-filter" }
134+
style_dom = { git = "https://github.com/JoshuaBrest/stylo", package = "dom", branch = "stacking-context-backdrop-filter" }
135+
style_malloc_size_of = { package = "malloc_size_of", git = "https://github.com/JoshuaBrest/stylo", branch = "stacking-context-backdrop-filter", features = ["servo"] }
136+
style_traits = { git = "https://github.com/JoshuaBrest/stylo", branch = "stacking-context-backdrop-filter", features = ["servo"] }
137137
surfman = { git = "https://github.com/servo/surfman", rev = "a8079ee2708619926d07c5a2088b8c9af99abdb3", features = ["chains"] }
138138
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
139139
synstructure = "0.13"
@@ -142,7 +142,7 @@ thin-vec = "0.2.13"
142142
tikv-jemalloc-sys = "0.6.0"
143143
tikv-jemallocator = "0.6.0"
144144
time = { package = "time", version = "0.3", features = ["large-dates", "local-offset", "serde"] }
145-
to_shmem = { git = "https://github.com/servo/stylo", branch = "2025-02-03" }
145+
to_shmem = { git = "https://github.com/JoshuaBrest/stylo", branch = "stacking-context-backdrop-filter" }
146146
tokio = "1"
147147
tokio-rustls = { version = "0.26", default-features = false, features = ["logging"] }
148148
tower-service = "0.3"
@@ -210,7 +210,7 @@ codegen-units = 1
210210
#
211211
# Or for Stylo:
212212
#
213-
# [patch."https://github.com/servo/stylo"]
213+
# [patch."https://github.com/JoshuaBrest/stylo"]
214214
# selectors = { path = "../stylo/selectors" }
215215
# servo_arc = { path = "../stylo/servo_arc" }
216216
# servo_atoms = { path = "../stylo/atoms" }

components/layout_2020/style_ext.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ impl ComputedValuesExt for ComputedValues {
589589
/// Returns true if this fragment establishes a new stacking context and false otherwise.
590590
fn establishes_stacking_context(&self, fragment_flags: FragmentFlags) -> bool {
591591
let effects = self.get_effects();
592+
592593
if effects.opacity != 1.0 {
593594
return true;
594595
}
@@ -601,7 +602,11 @@ impl ComputedValuesExt for ComputedValues {
601602
return true;
602603
}
603604

604-
if !self.get_effects().filter.0.is_empty() {
605+
if !effects.filter.0.is_empty() {
606+
return true;
607+
}
608+
609+
if !effects.backdrop_filter.0.is_empty() {
605610
return true;
606611
}
607612

@@ -671,7 +676,10 @@ impl ComputedValuesExt for ComputedValues {
671676
return true;
672677
}
673678

674-
if !self.get_effects().filter.0.is_empty() {
679+
// FIXME(#35391): `filter` and `backdrop-filter` shouldn't establish
680+
// a containing block when applied to the document root element.
681+
let effects = self.get_effects();
682+
if !effects.filter.0.is_empty() || !effects.backdrop_filter.0.is_empty() {
675683
return true;
676684
}
677685

0 commit comments

Comments
 (0)