Skip to content

script: update to new XML serializer - #47305

Open
Ms2ger wants to merge 2 commits into
servo:mainfrom
Ms2ger:xml-serialization
Open

script: update to new XML serializer #47305
Ms2ger wants to merge 2 commits into
servo:mainfrom
Ms2ger:xml-serialization

Conversation

@Ms2ger

@Ms2ger Ms2ger commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

servo/html5ever#772 introduces a new standard-compliant XML serializer. We can no longer reuse the tree walking implementation of the HTML serializer, but reimplement a similar design.

Testing: many WPTs now pass

Ms2ger added 2 commits August 17, 2026 21:05
Testing: many WPTs now pass

Signed-off-by: Ms2ger <Ms2ger@gmail.com>
@Ms2ger
Ms2ger requested a review from gterzian as a code owner August 17, 2026 19:13
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 17, 2026
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#61996) with upstreamable changes.

@Narfinger Narfinger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that familiar with xml parsing so just style comments.

) -> io::Result<()> {
debug_assert!(!node.is::<Attr>(), "Should have handled Attr in caller");
let mut stack = Vec::new();
fn push_node(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a fan of deffining functions in a function. Can we split these out?

prefix_map: NamespacePrefixMap,
) {
if let Some(template_element) = node.downcast::<HTMLTemplateElement>() {
for child in template_element.Content(cx).upcast::<Node>().rev_children() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have rev_children_unrooted?

let value = attr.value().clone();
(qname, value)
})
.collect();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this collect? It looks like we just take a reference of the value anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants