aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/style/gecko/pseudo_element.rs9
-rw-r--r--components/style/stylist.rs6
2 files changed, 12 insertions, 3 deletions
diff --git a/components/style/gecko/pseudo_element.rs b/components/style/gecko/pseudo_element.rs
index b15e17e6f38..93da2b589d0 100644
--- a/components/style/gecko/pseudo_element.rs
+++ b/components/style/gecko/pseudo_element.rs
@@ -49,6 +49,15 @@ impl PseudoElement {
PseudoElementCascadeType::Lazy
}
+ /// Whether the pseudo-element should inherit from the default computed
+ /// values instead of from the parent element.
+ ///
+ /// This is not the common thing, but there are some pseudos (namely:
+ /// ::backdrop), that shouldn't inherit from the parent element.
+ pub fn inherits_from_default_values(&self) -> bool {
+ !matches!(*self, PseudoElement::Backdrop)
+ }
+
/// Gets the canonical index of this eagerly-cascaded pseudo-element.
#[inline]
pub fn eager_index(&self) -> usize {
diff --git a/components/style/stylist.rs b/components/style/stylist.rs
index 24f9ec31b17..3189defd7b1 100644
--- a/components/style/stylist.rs
+++ b/components/style/stylist.rs
@@ -628,7 +628,7 @@ impl Stylist {
guards: &StylesheetGuards,
element: &E,
pseudo: &PseudoElement,
- parent: &Arc<ComputedValues>,
+ parent_style: &ComputedValues,
font_metrics: &FontMetricsProvider)
-> Option<ComputedStyle>
where E: TElement,
@@ -647,8 +647,8 @@ impl Stylist {
properties::cascade(&self.device,
&rule_node,
guards,
- Some(&**parent),
- Some(&**parent),
+ Some(parent_style),
+ Some(parent_style),
None,
&RustLogReporter,
font_metrics,