mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Serialize the children of void html elements as empty strings
This commit is contained in:
parent
e68585a26f
commit
a2d5d4f3da
3 changed files with 6 additions and 58 deletions
|
@ -1097,7 +1097,6 @@ impl Element {
|
|||
local_name!("input") |
|
||||
local_name!("keygen") |
|
||||
local_name!("link") |
|
||||
local_name!("menuitem") |
|
||||
local_name!("meta") |
|
||||
local_name!("param") |
|
||||
local_name!("source") |
|
||||
|
|
|
@ -210,6 +210,12 @@ impl<'a> Serialize for &'a Node {
|
|||
) -> io::Result<()> {
|
||||
let node = *self;
|
||||
|
||||
if let TraversalScope::ChildrenOnly(_) = traversal_scope {
|
||||
if node.downcast::<Element>().map_or(false, |e| e.is_void()) {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
let iter = SerializationIterator::new(node, traversal_scope != IncludeNode);
|
||||
|
||||
for cmd in iter {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue