mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Do not render the contents of block-level replaced elements.
Fixes #10733
This commit is contained in:
parent
75d99eec0f
commit
5a90c8f2bd
3 changed files with 17 additions and 19 deletions
|
@ -619,6 +619,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||||
|
|
||||||
// List of absolute descendants, in tree order.
|
// List of absolute descendants, in tree order.
|
||||||
let mut abs_descendants = AbsoluteDescendants::new();
|
let mut abs_descendants = AbsoluteDescendants::new();
|
||||||
|
if !node.is_replaced_content() {
|
||||||
for kid in node.children() {
|
for kid in node.children() {
|
||||||
if kid.get_pseudo_element_type() != PseudoElementType::Normal {
|
if kid.get_pseudo_element_type() != PseudoElementType::Normal {
|
||||||
self.process(&kid);
|
self.process(&kid);
|
||||||
|
@ -632,6 +633,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||||
&mut inline_fragment_accumulator,
|
&mut inline_fragment_accumulator,
|
||||||
&mut abs_descendants);
|
&mut abs_descendants);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Perform a final flush of any inline fragments that we were gathering up to handle {ib}
|
// Perform a final flush of any inline fragments that we were gathering up to handle {ib}
|
||||||
// splits, after stripping ignorable whitespace.
|
// splits, after stripping ignorable whitespace.
|
||||||
|
@ -683,7 +685,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||||
HTMLElementTypeId::HTMLInputElement))) ||
|
HTMLElementTypeId::HTMLInputElement))) ||
|
||||||
node.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
|
node.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||||
HTMLElementTypeId::HTMLTextAreaElement)));
|
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 {
|
node_is_input_or_text_area {
|
||||||
// A TextArea's text contents are displayed through the input text
|
// A TextArea's text contents are displayed through the input text
|
||||||
// box, so don't construct them.
|
// box, so don't construct them.
|
||||||
|
@ -1659,7 +1661,6 @@ impl<ConcreteThreadSafeLayoutNode> NodeUtils for ConcreteThreadSafeLayoutNode
|
||||||
where ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode {
|
where ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode {
|
||||||
fn is_replaced_content(&self) -> bool {
|
fn is_replaced_content(&self) -> bool {
|
||||||
match self.type_id() {
|
match self.type_id() {
|
||||||
None |
|
|
||||||
Some(NodeTypeId::CharacterData(_)) |
|
Some(NodeTypeId::CharacterData(_)) |
|
||||||
Some(NodeTypeId::DocumentType) |
|
Some(NodeTypeId::DocumentType) |
|
||||||
Some(NodeTypeId::DocumentFragment) |
|
Some(NodeTypeId::DocumentFragment) |
|
||||||
|
@ -1673,6 +1674,7 @@ impl<ConcreteThreadSafeLayoutNode> NodeUtils for ConcreteThreadSafeLayoutNode
|
||||||
Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
|
Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||||
HTMLElementTypeId::HTMLObjectElement))) => self.has_object_data(),
|
HTMLElementTypeId::HTMLObjectElement))) => self.has_object_data(),
|
||||||
Some(NodeTypeId::Element(_)) => false,
|
Some(NodeTypeId::Element(_)) => false,
|
||||||
|
None => self.get_pseudo_element_type().is_replaced_content(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
match *self {
|
||||||
PseudoElementType::Before(_) | PseudoElementType::After(_) => true,
|
PseudoElementType::Before(_) | PseudoElementType::After(_) => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
|
@ -1041,7 +1041,7 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn text_content(&self) -> TextContent {
|
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 data = &self.borrow_layout_data().unwrap().style_data;
|
||||||
|
|
||||||
let style = if self.pseudo.is_before() {
|
let style = if self.pseudo.is_before() {
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[canvas-fallback.html]
|
|
||||||
type: reftest
|
|
||||||
expected: FAIL
|
|
||||||
bug: https://github.com/servo/servo/issues/10733
|
|
Loading…
Add table
Add a link
Reference in a new issue