mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Merge pull request #1656 from lightpanda-io/dump_attribute
Dump Attribute to empty string
This commit is contained in:
@@ -172,7 +172,11 @@ fn _deep(node: *Node, opts: Opts, comptime force_slot: bool, writer: *std.Io.Wri
|
|||||||
try writer.writeAll(">\n");
|
try writer.writeAll(">\n");
|
||||||
},
|
},
|
||||||
.document_fragment => try children(node, opts, writer, page),
|
.document_fragment => try children(node, opts, writer, page),
|
||||||
.attribute => unreachable,
|
.attribute => {
|
||||||
|
// Not called normally, but can be called via XMLSerializer.serializeToString
|
||||||
|
// in which case it should return an empty string
|
||||||
|
try writer.writeAll("");
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,3 +129,14 @@
|
|||||||
testing.expectEqual(original, serialized);
|
testing.expectEqual(original, serialized);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script id=serializeAttribute>
|
||||||
|
{
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.setAttribute('over', '9000');
|
||||||
|
|
||||||
|
const serializer = new XMLSerializer();
|
||||||
|
const serialized = serializer.serializeToString(div.getAttributeNode('over'));
|
||||||
|
testing.expectEqual('', serialized);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user