Bug 1366427: Make backdrop not inherit from the parent element. r=heycam

MozReview-Commit-ID: EnnmvDsgbdx
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-05-20 11:56:48 +02:00
parent 3d40b516c8
commit 71dbc6c023
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 17 additions and 4 deletions

View file

@ -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 {

View file

@ -630,7 +630,7 @@ impl Stylist {
guards: &StylesheetGuards,
element: &E,
pseudo: &PseudoElement,
parent: &Arc<ComputedValues>,
parent_style: &ComputedValues,
font_metrics: &FontMetricsProvider)
-> Option<ComputedStyle>
where E: TElement,
@ -649,8 +649,8 @@ impl Stylist {
properties::cascade(&self.device,
&rule_node,
guards,
Some(&**parent),
Some(&**parent),
Some(parent_style),
Some(parent_style),
None,
&RustLogReporter,
font_metrics,