Open Bug 1499556 Opened 6 years ago Updated 2 years ago

Failure in WPT test dom/nodes/attributes.html

Categories

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

defect

Tracking

()

People

(Reporter: mccr8, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome, parity-safari)

There is one failure in the WPT test dom/nodes/attributes.html that does not happen in other browsers. The "First set attribute is returned with mapped attribute set first" test fails with "Failure message: assert_equals: expected "left" but got "right"".

That's not very specific, so I locally reduced the failure to this (using a Mochitest-style assertion):

  var el = document.createElement("div")
  document.body.appendChild(el)
  el.setAttributeNS("", "align", "left")
  el.setAttributeNS("xx", "align", "right")
  el.setAttributeNS("", "foo", "left")
  el.setAttributeNS("xx", "foo", "right")

  is(el.getAttribute("align"), "left", "Test5")
I'm guessing that the idea is that the getAttribute is supposed to look at the value in the "" namespace instead of the "xx" namespace.
I vaguely recall a bug related to this, old one, but not sure what its title would be. Something about namespaces.
Priority: -- → P5
Component: DOM → DOM: Core & HTML

(In reply to Olli Pettay [:smaug] (vacation May 27-31) from comment #2)

I vaguely recall a bug related to this, old one, but not sure what its title
would be. Something about namespaces.

Maybe you were thinking of bug 1303629?

The actual problem here has nothing to do with namespaces, but rather attribute ordering. We order attributes by mapped first then non-mapped, but per spec, getAttribute() should return the first attribute set with that name, but we don't keep information about the order in which attributes were set.

I was looking through this bug but it is still failing on https://wpt.fyi/results/dom/nodes/attributes.html?label=experimental&label=master&aligned but I see that your comment (https://bugzilla.mozilla.org/show_bug.cgi?id=1303629#c9) you thought it was fixed. Is there a bug in that implementation or is there a missing piece? SOrry if I have misunderstood

Flags: needinfo?(ehsan)

(In reply to David Burns :automatedtester from comment #4)

I was looking through this bug but it is still failing on https://wpt.fyi/results/dom/nodes/attributes.html?label=experimental&label=master&aligned but I see that your comment (https://bugzilla.mozilla.org/show_bug.cgi?id=1303629#c9) you thought it was fixed.

I think that bug may have been filed at a time when we didn't preserve any ordering for attributes? Not sure. Anyway the test case there doesn't show the behaviour that the bug is complaining about any more.

Is there a bug in that implementation or is there a missing piece? SOrry if I have misunderstood

There is a missing piece here, yes, see the second paragraph of comment 3. This WPT test is failing because of that missing piece as far as I can tell.

Flags: needinfo?(ehsan)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.