diff options
3 files changed, 17 insertions, 19 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs index ee961942300..cc34642466a 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -619,18 +619,20 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> // List of absolute descendants, in tree order. let mut abs_descendants = AbsoluteDescendants::new(); - for kid in node.children() { - if kid.get_pseudo_element_type() != PseudoElementType::Normal { - self.process(&kid); - } + if !node.is_replaced_content() { + for kid in node.children() { + if kid.get_pseudo_element_type() != PseudoElementType::Normal { + self.process(&kid); + } - self.build_block_flow_using_construction_result_of_child( - &mut flow, - &mut consecutive_siblings, - node, - kid, - &mut inline_fragment_accumulator, - &mut abs_descendants); + self.build_block_flow_using_construction_result_of_child( + &mut flow, + &mut consecutive_siblings, + node, + kid, + &mut inline_fragment_accumulator, + &mut abs_descendants); + } } // Perform a final flush of any inline fragments that we were gathering up to handle {ib} @@ -683,7 +685,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> HTMLElementTypeId::HTMLInputElement))) || node.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement( HTMLElementTypeId::HTMLTextAreaElement))); - if node.get_pseudo_element_type().is_before_or_after() || + if node.get_pseudo_element_type().is_replaced_content() || node_is_input_or_text_area { // A TextArea's text contents are displayed through the input text // box, so don't construct them. @@ -1659,7 +1661,6 @@ impl<ConcreteThreadSafeLayoutNode> NodeUtils for ConcreteThreadSafeLayoutNode where ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode { fn is_replaced_content(&self) -> bool { match self.type_id() { - None | Some(NodeTypeId::CharacterData(_)) | Some(NodeTypeId::DocumentType) | Some(NodeTypeId::DocumentFragment) | @@ -1673,6 +1674,7 @@ impl<ConcreteThreadSafeLayoutNode> NodeUtils for ConcreteThreadSafeLayoutNode Some(NodeTypeId::Element(ElementTypeId::HTMLElement( HTMLElementTypeId::HTMLObjectElement))) => self.has_object_data(), Some(NodeTypeId::Element(_)) => false, + None => self.get_pseudo_element_type().is_replaced_content(), } } diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 6bf95fad735..00c77631707 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -630,7 +630,7 @@ impl<T> PseudoElementType<T> { } } - pub fn is_before_or_after(&self) -> bool { + pub fn is_replaced_content(&self) -> bool { match *self { PseudoElementType::Before(_) | PseudoElementType::After(_) => true, _ => false, @@ -1041,7 +1041,7 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> { } fn text_content(&self) -> TextContent { - if self.pseudo.is_before_or_after() { + if self.pseudo.is_replaced_content() { let data = &self.borrow_layout_data().unwrap().style_data; let style = if self.pseudo.is_before() { diff --git a/tests/wpt/metadata/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html.ini b/tests/wpt/metadata/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html.ini deleted file mode 100644 index 978f663e01f..00000000000 --- a/tests/wpt/metadata/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[canvas-fallback.html] - type: reftest - expected: FAIL - bug: https://github.com/servo/servo/issues/10733 |