Closed Bug 1550979 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 16703 - XMLSerializer: Don't add unnecessary prefix to an element in the default namespace

Categories

(Core :: DOM: Core & HTML, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 16703 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/16703
Details from upstream follow.

Kent Tamura <tkent@chromium.org> wrote:

XMLSerializer: Don't add unnecessary prefix to an element in the default namespace

This CL fixes a regression by crrev.com/632459.

Suppose that we have the following XML document:
\<root xmlns:x="uri1">
\<table xmlns="uri1"/>
\</root>
XMLSerializer generated the following result:
\<root xmlns:x="uri1">
\<x:table xmlns="uri1"/>
\</root>

We don't need to run "retrieving a preferred prefix string" algorithm if
the element has no prefix and its namespace matches to the default
namespace.

This is an error of the specification, and Edge, Firefox, and Safari
match to this CL's behavior. This CL adds a testcase following the
specification error, and the testcase fails with all major browsers.

Bug: 958298
Change-Id: I3af9e643a9f91221e56024192f7257a82b6f18cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1598929
Reviewed-by: Yoshifumi Inoue \<yosin@chromium.org>
Commit-Queue: Kent Tamura \<tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657586}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Failed to get results from try push
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/150b90b923e5
[wpt PR 16703] - XMLSerializer: Don't add unnecessary prefix to an element in the default namespace, a=testonly
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.