mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Fix container units on ::backdrop
Differential Revision: https://phabricator.services.mozilla.com/D165542
This commit is contained in:
parent
a685297bf3
commit
40f5dbb1ab
3 changed files with 22 additions and 2 deletions
|
@ -55,6 +55,7 @@ pub fn cascade<E>(
|
||||||
pseudo: Option<&PseudoElement>,
|
pseudo: Option<&PseudoElement>,
|
||||||
rule_node: &StrongRuleNode,
|
rule_node: &StrongRuleNode,
|
||||||
guards: &StylesheetGuards,
|
guards: &StylesheetGuards,
|
||||||
|
originating_element_style: Option<&ComputedValues>,
|
||||||
parent_style: Option<&ComputedValues>,
|
parent_style: Option<&ComputedValues>,
|
||||||
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
||||||
layout_parent_style: Option<&ComputedValues>,
|
layout_parent_style: Option<&ComputedValues>,
|
||||||
|
@ -73,6 +74,7 @@ where
|
||||||
pseudo,
|
pseudo,
|
||||||
rule_node,
|
rule_node,
|
||||||
guards,
|
guards,
|
||||||
|
originating_element_style,
|
||||||
parent_style,
|
parent_style,
|
||||||
parent_style_ignoring_first_line,
|
parent_style_ignoring_first_line,
|
||||||
layout_parent_style,
|
layout_parent_style,
|
||||||
|
@ -173,6 +175,7 @@ fn cascade_rules<E>(
|
||||||
pseudo: Option<&PseudoElement>,
|
pseudo: Option<&PseudoElement>,
|
||||||
rule_node: &StrongRuleNode,
|
rule_node: &StrongRuleNode,
|
||||||
guards: &StylesheetGuards,
|
guards: &StylesheetGuards,
|
||||||
|
originating_element_style: Option<&ComputedValues>,
|
||||||
parent_style: Option<&ComputedValues>,
|
parent_style: Option<&ComputedValues>,
|
||||||
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
||||||
layout_parent_style: Option<&ComputedValues>,
|
layout_parent_style: Option<&ComputedValues>,
|
||||||
|
@ -196,6 +199,7 @@ where
|
||||||
rule_node,
|
rule_node,
|
||||||
guards,
|
guards,
|
||||||
DeclarationIterator::new(rule_node, guards, pseudo),
|
DeclarationIterator::new(rule_node, guards, pseudo),
|
||||||
|
originating_element_style,
|
||||||
parent_style,
|
parent_style,
|
||||||
parent_style_ignoring_first_line,
|
parent_style_ignoring_first_line,
|
||||||
layout_parent_style,
|
layout_parent_style,
|
||||||
|
@ -232,6 +236,7 @@ pub fn apply_declarations<'a, E, I>(
|
||||||
rules: &StrongRuleNode,
|
rules: &StrongRuleNode,
|
||||||
guards: &StylesheetGuards,
|
guards: &StylesheetGuards,
|
||||||
iter: I,
|
iter: I,
|
||||||
|
originating_element_style: Option<&ComputedValues>,
|
||||||
parent_style: Option<&ComputedValues>,
|
parent_style: Option<&ComputedValues>,
|
||||||
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
||||||
layout_parent_style: Option<&ComputedValues>,
|
layout_parent_style: Option<&ComputedValues>,
|
||||||
|
@ -246,6 +251,10 @@ where
|
||||||
E: TElement,
|
E: TElement,
|
||||||
I: Iterator<Item = (&'a PropertyDeclaration, CascadePriority)>,
|
I: Iterator<Item = (&'a PropertyDeclaration, CascadePriority)>,
|
||||||
{
|
{
|
||||||
|
debug_assert_eq!(
|
||||||
|
originating_element_style.is_some(),
|
||||||
|
element.is_some() && pseudo.is_some()
|
||||||
|
);
|
||||||
debug_assert!(layout_parent_style.is_none() || parent_style.is_some());
|
debug_assert!(layout_parent_style.is_none() || parent_style.is_some());
|
||||||
debug_assert_eq!(
|
debug_assert_eq!(
|
||||||
parent_style.is_some(),
|
parent_style.is_some(),
|
||||||
|
@ -282,7 +291,7 @@ where
|
||||||
|
|
||||||
let is_root_element = pseudo.is_none() && element.map_or(false, |e| e.is_root());
|
let is_root_element = pseudo.is_none() && element.map_or(false, |e| e.is_root());
|
||||||
let container_size_query =
|
let container_size_query =
|
||||||
ContainerSizeQuery::for_option_element(element, pseudo.and(parent_style));
|
ContainerSizeQuery::for_option_element(element, originating_element_style);
|
||||||
|
|
||||||
let mut context = computed::Context::new(
|
let mut context = computed::Context::new(
|
||||||
// We'd really like to own the rules here to avoid refcount traffic, but
|
// We'd really like to own the rules here to avoid refcount traffic, but
|
||||||
|
@ -339,6 +348,7 @@ where
|
||||||
if let Some(visited_rules) = visited_rules {
|
if let Some(visited_rules) = visited_rules {
|
||||||
cascade.compute_visited_style_if_needed(
|
cascade.compute_visited_style_if_needed(
|
||||||
element,
|
element,
|
||||||
|
originating_element_style,
|
||||||
parent_style,
|
parent_style,
|
||||||
parent_style_ignoring_first_line,
|
parent_style_ignoring_first_line,
|
||||||
layout_parent_style,
|
layout_parent_style,
|
||||||
|
@ -725,6 +735,7 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
|
||||||
fn compute_visited_style_if_needed<E>(
|
fn compute_visited_style_if_needed<E>(
|
||||||
&mut self,
|
&mut self,
|
||||||
element: Option<E>,
|
element: Option<E>,
|
||||||
|
originating_element_style: Option<&ComputedValues>,
|
||||||
parent_style: Option<&ComputedValues>,
|
parent_style: Option<&ComputedValues>,
|
||||||
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
||||||
layout_parent_style: Option<&ComputedValues>,
|
layout_parent_style: Option<&ComputedValues>,
|
||||||
|
@ -755,6 +766,7 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
|
||||||
self.context.builder.pseudo,
|
self.context.builder.pseudo,
|
||||||
visited_rules,
|
visited_rules,
|
||||||
guards,
|
guards,
|
||||||
|
visited_parent!(originating_element_style),
|
||||||
visited_parent!(parent_style),
|
visited_parent!(parent_style),
|
||||||
visited_parent!(parent_style_ignoring_first_line),
|
visited_parent!(parent_style_ignoring_first_line),
|
||||||
visited_parent!(layout_parent_style),
|
visited_parent!(layout_parent_style),
|
||||||
|
|
|
@ -349,6 +349,7 @@ where
|
||||||
pseudo,
|
pseudo,
|
||||||
inputs,
|
inputs,
|
||||||
&self.context.shared.guards,
|
&self.context.shared.guards,
|
||||||
|
pseudo.and(parent_style),
|
||||||
parent_style,
|
parent_style,
|
||||||
parent_style,
|
parent_style,
|
||||||
layout_parent_style,
|
layout_parent_style,
|
||||||
|
|
|
@ -895,8 +895,9 @@ impl Stylist {
|
||||||
},
|
},
|
||||||
pseudo,
|
pseudo,
|
||||||
guards,
|
guards,
|
||||||
|
/* originating_element_style */ None,
|
||||||
parent,
|
parent,
|
||||||
None,
|
/* element */ None,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -989,6 +990,7 @@ impl Stylist {
|
||||||
cascade_inputs,
|
cascade_inputs,
|
||||||
pseudo,
|
pseudo,
|
||||||
guards,
|
guards,
|
||||||
|
Some(originating_element_style),
|
||||||
Some(parent_style),
|
Some(parent_style),
|
||||||
Some(element),
|
Some(element),
|
||||||
))
|
))
|
||||||
|
@ -1003,6 +1005,7 @@ impl Stylist {
|
||||||
inputs: CascadeInputs,
|
inputs: CascadeInputs,
|
||||||
pseudo: &PseudoElement,
|
pseudo: &PseudoElement,
|
||||||
guards: &StylesheetGuards,
|
guards: &StylesheetGuards,
|
||||||
|
originating_element_style: Option<&ComputedValues>,
|
||||||
parent_style: Option<&ComputedValues>,
|
parent_style: Option<&ComputedValues>,
|
||||||
element: Option<E>,
|
element: Option<E>,
|
||||||
) -> Arc<ComputedValues>
|
) -> Arc<ComputedValues>
|
||||||
|
@ -1026,6 +1029,7 @@ impl Stylist {
|
||||||
Some(pseudo),
|
Some(pseudo),
|
||||||
inputs,
|
inputs,
|
||||||
guards,
|
guards,
|
||||||
|
originating_element_style,
|
||||||
parent_style,
|
parent_style,
|
||||||
parent_style,
|
parent_style,
|
||||||
parent_style,
|
parent_style,
|
||||||
|
@ -1052,6 +1056,7 @@ impl Stylist {
|
||||||
pseudo: Option<&PseudoElement>,
|
pseudo: Option<&PseudoElement>,
|
||||||
inputs: CascadeInputs,
|
inputs: CascadeInputs,
|
||||||
guards: &StylesheetGuards,
|
guards: &StylesheetGuards,
|
||||||
|
originating_element_style: Option<&ComputedValues>,
|
||||||
parent_style: Option<&ComputedValues>,
|
parent_style: Option<&ComputedValues>,
|
||||||
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
parent_style_ignoring_first_line: Option<&ComputedValues>,
|
||||||
layout_parent_style: Option<&ComputedValues>,
|
layout_parent_style: Option<&ComputedValues>,
|
||||||
|
@ -1087,6 +1092,7 @@ impl Stylist {
|
||||||
pseudo,
|
pseudo,
|
||||||
inputs.rules.as_ref().unwrap_or(self.rule_tree.root()),
|
inputs.rules.as_ref().unwrap_or(self.rule_tree.root()),
|
||||||
guards,
|
guards,
|
||||||
|
originating_element_style,
|
||||||
parent_style,
|
parent_style,
|
||||||
parent_style_ignoring_first_line,
|
parent_style_ignoring_first_line,
|
||||||
layout_parent_style,
|
layout_parent_style,
|
||||||
|
@ -1505,6 +1511,7 @@ impl Stylist {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
|
/* originating_element_style */ None,
|
||||||
Some(parent_style),
|
Some(parent_style),
|
||||||
Some(parent_style),
|
Some(parent_style),
|
||||||
Some(parent_style),
|
Some(parent_style),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue