[wpt-sync] Sync PR 15340 - XMLSerializer: Fix prefixed attribute serialization

RESOLVED FIXED in Firefox 67

Status

()

enhancement
P4
normal
RESOLVED FIXED
3 months ago
2 months ago

People

(Reporter: wptsync, Unassigned)

Tracking

unspecified
mozilla67
Points:
---

Firefox Tracking Flags

(firefox67 fixed)

Details

(Whiteboard: [wptsync downstream], )

Assignee

Description

3 months ago

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

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

Kent Tamura <tkent@chromium.org> wrote:

XMLSerializer: Fix prefixed attribute serialization

... in a case where its owner element has xmlns:prefix of which prefix
is same as the attribute and namespace is not same as the attribute.

e.g.
el.setAttributeNS("uri1", "p:n", "v");
el.setAttributeNS(XMLNS_URI, "xmlns:p", "uri2");

ShouldAddNamespaceAttribute() checked only existence of xmlns:prefix in
the element, but we should check existence of (prefix, namespace URI)
pair in the scope according to the specification.

So, this CL adds 'recording the namespace information' step [1] defined
by the specification, and ShouldAddNamespaceAttribute() checks all
available prefixes in the scope.

[1] https://w3c.github.io/DOM-Parsing/#recording-the-namespace

Bug: 929035
Change-Id: I575e8f652ae45f7583202443cc72d5afe5faf59d
Reviewed-on: https://chromium-review.googlesource.com/c/1460643
Reviewed-by: Yoshifumi Inoue \<yosin@chromium.org>
Commit-Queue: Kent Tamura \<tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631058}

Assignee

Updated

3 months ago
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Assignee

Comment 1

3 months ago
PR 15340 applied with additional changes from upstream: d2c49d8610185244a31e04ef32aae70da0dd35f7, c815526cd9d6fe1039b3736b06b05c348cdd64d8
Assignee

Updated

3 months ago
Component: web-platform-tests → DOM
Product: Testing → Core
Assignee

Updated

3 months ago
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Assignee

Comment 4

3 months ago
Ran 1 tests and 8 subtests
OK     : 1
PASS   : 4
FAIL   : 4

New tests that have failures or other problems:
/domparsing/XMLSerializer-serializeToString.html
    Check if "ns1" is generated even if the element already has xmlns:ns1.: FAIL
    Check if attribute serialization takes into account of following xmlns:* attributes: FAIL
    Check if attribute serialization takes into account of the same prefix declared in an ancestor element: FAIL
    Check if generated prefixes match to "ns${index}".: FAIL

Comment 5

3 months ago
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8de204a8ad00
[wpt PR 15340] - XMLSerializer: Fix prefixed attribute serialization, a=testonly

Comment 6

3 months ago
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4fce8beb3c9e
[wpt PR 15340] - XMLSerializer: Fix prefixed attribute serialization, a=testonly

Comment 7

3 months ago
bugherder
Status: NEW → RESOLVED
Last Resolved: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.