Skip to content

Editorial: pass require well-formed when serializing a Document - #413

Merged
annevk merged 1 commit into
whatwg:mainfrom
shannonbooth:document-serialize-require-well-formed
Oct 28, 2026
Merged

annevk merged 1 commit into
whatwg:mainfrom
shannonbooth:document-serialize-require-well-formed

Conversation

@shannonbooth

@shannonbooth shannonbooth commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Matching the logic intended by 59c9cd9 of not throwing for documents that cannot be serialized as well formed XML.


Found fixing a bug in ladybird where we weren't doing the "converted" part to make it scalar, and noticed we were already passing this flag which spec didn't mention.


Preview | Diff

Matching the logic intended by 59c9cd9 of not throwing for
documents that cannot be serialized as well formed XML.
@annevk

annevk commented Oct 26, 2026

Copy link
Copy Markdown
Member

But are implementations performing the behavior specified for not throwing? Or are they just silently eating the exceptions? I would expect us to not send ill-formed XML across the network.

@shannonbooth

shannonbooth commented Oct 26, 2026 •

Copy link
Copy Markdown
Member Author

But are implementations performing the behavior specified for not throwing? Or are they just silently eating the exceptions? I would expect us to not send ill-formed XML across the network.

This is my interpretation, but maybe I am misunderstanding something from that commit and linked issue / corresponding tests. The WPT PR web-platform-tests/wpt#5123 for 59c9cd9 seems to test this behaviour, which all engines pass (now under https://wpt.fyi/results/xhr/send-entity-body-document-bogus.htm?label=experimental&label=master&aligned).

I'm going off of tests here, so there's always the possibility of misinterpreting the results where implementation behaviour is more complex than I realise (like I managed in #242 (comment) 😅) Not 100% sure what silently eating the exception means, is that not sending anything at all?

@annevk

annevk commented Oct 28, 2026

Copy link
Copy Markdown
Member

Oh wow that is horrible. I forgot that we did that.

@annevk
annevk merged commit b2c6fce into whatwg:main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants