Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMLSerializer: Keep redundant but harmless default namespace declarations #15779

Merged
merged 1 commit into from
Mar 12, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Mar 12, 2019

Since crrev.com/632142, XMLSerializer has dropped redundant xmlns="..."
declarations. It matches to IE, Edge, and DOM P&S standard. This CL
reverts the behavior to unbreak existing applications. The restored
behavior matches to Firefox and Safari.

  • MarkupAccumulator::AppendElement():
    Even if ignore_namespace_definition_attribute_ is set, we drop a
    xmlns="..." only if its value is inconsistent with element's
    namespace.

  • MarkupAccumulator::AppendStartTagOpen():
    if local_default_namespace is "" and ns is null, do not emit xmlns="".
    This avoids to serialize xmlns="" twice.

Bug: w3c/DOM-Parsing#47
Bug: 940204
Change-Id: I2978ddc9a3f9511d227a9a1b902f1811ac1c3c07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1516124
Reviewed-by: Yoshifumi Inoue <[email protected]>
Commit-Queue: Kent Tamura <[email protected]>
Auto-Submit: Kent Tamura <[email protected]>
Cr-Commit-Position: refs/heads/master@{#639873}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

Already reviewed downstream.

@@ -145,8 +152,6 @@ <h1>domparsing_XMLSerializer_serializeToString</h1>

test(function() {
assert_equals(serialize(parse('<root><child/></root>')), '<root><child/></root>');
assert_equals(serialize(parse('<root><child xmlns=""/></root>')), '<root><child/></root>');
Copy link
Member

Choose a reason for hiding this comment

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

It seems we lost this particular input @tkent-google. A root without xmlns declaration and a child with one. Could you restore that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure!

…ions

Since crrev.com/632142, XMLSerializer has dropped redundant xmlns="..."
declarations. It matches to IE, Edge, and DOM P&S standard.  This CL
reverts the behavior to unbreak existing applications.  The restored
behavior matches to Firefox and Safari.

* MarkupAccumulator::AppendElement():
  Even if ignore_namespace_definition_attribute_ is set, we drop a
  xmlns="..." only if its value is inconsistent with element's
  namespace.

* MarkupAccumulator::AppendStartTagOpen():
  if local_default_namespace is "" and ns is null, do not emit xmlns="".
  This avoids to serialize xmlns="" twice.

Bug: w3c/DOM-Parsing#47
Bug: 940204
Change-Id: I2978ddc9a3f9511d227a9a1b902f1811ac1c3c07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1516124
Reviewed-by: Yoshifumi Inoue <[email protected]>
Commit-Queue: Kent Tamura <[email protected]>
Auto-Submit: Kent Tamura <[email protected]>
Cr-Commit-Position: refs/heads/master@{#639873}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants