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

domparsing: Fix an issue that XMLSerializer generates new prefix for an attribute with an existing namespace #15343

Merged
merged 1 commit into from Feb 13, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

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

Add an implementation of "retrieving a preferred prefix string"
[1], and apply it to attribute serialization.

As the specification defines, this CL introduces another map [2] like:

namespace URI => [older prefix, ..., newer prefix]

in order to retrieve most-recently-declared prefix.

When we search the map for a prefix, we check availability of
the prefix by the existing prefix-namespace map.

There are two failing test cases in XMLSerializer-serializeToString.html.
They follow the specification.

  • The first failing one: An non-well-formed XML is produced if we follow
    the specification. Chrome's new behavior matches to Firefox. Safari also
    produces a bad XML.
  • The second failing one: Firefox, Safari, and Chrome without this CL
    preserve prefix in such case. This CL keeps the interoperable behavior.

[1] https://w3c.github.io/DOM-Parsing/#dfn-retrieving-a-preferred-prefix-string
[2] https://w3c.github.io/DOM-Parsing/#dfn-namespace-prefix-map

Bug: 906807
Change-Id: Idaea590ba19c9c21acbaf456ea91ce550c74db5a
Reviewed-on: https://chromium-review.googlesource.com/c/1445033
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631573}

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.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-1445033 branch 4 times, most recently from 4839e94 to 73fc06f Compare February 13, 2019 04:19
…an attribute with an existing namespace

Add an implementation of "retrieving a preferred prefix string"
[1], and apply it to attribute serialization.

As the specification defines, this CL introduces another map [2] like:

  namespace URI => [older prefix, ..., newer prefix]

in order to retrieve most-recently-declared prefix.

When we search the map for a prefix, we check availability of
the prefix by the existing prefix-namespace map.

There are two failing test cases in XMLSerializer-serializeToString.html.
They follow the specification.
  * The first failing one: An non-well-formed XML is produced if we follow
    the specification. Chrome's new behavior matches to Firefox. Safari also
    produces a bad XML.
  * The second failing one: Firefox, Safari, and Chrome without this CL
    preserve prefix in such case.  This CL keeps the interoperable behavior.

[1] https://w3c.github.io/DOM-Parsing/#dfn-retrieving-a-preferred-prefix-string
[2] https://w3c.github.io/DOM-Parsing/#dfn-namespace-prefix-map

Bug: 906807
Change-Id: Idaea590ba19c9c21acbaf456ea91ce550c74db5a
Reviewed-on: https://chromium-review.googlesource.com/c/1445033
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631573}
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.

None yet

3 participants