mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Auto merge of #6554 - dzbarsky:master, r=Ms2ger
Test namespace prefix for element equality <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6554) <!-- Reviewable:end -->
This commit is contained in:
commit
91ce002241
3 changed files with 29 additions and 2 deletions
|
@ -1,3 +1,6 @@
|
|||
[Node-isEqualNode.xhtml]
|
||||
type: testharness
|
||||
disabled: xml
|
||||
expected: TIMEOUT
|
||||
[isEqualNode should return true when only the internal subsets of DocumentTypes differ.]
|
||||
expected: NOTRUN
|
||||
|
||||
|
|
|
@ -33,6 +33,30 @@ test(function() {
|
|||
assert_true(a.isEqualNode(b))
|
||||
}, "isEqualNode should return true when the attributes are in a different order")
|
||||
|
||||
test(function() {
|
||||
var a = document.createElementNS("ns", "prefix:foo")
|
||||
var b = document.createElementNS("ns", "prefix:foo")
|
||||
assert_true(a.isEqualNode(b))
|
||||
}, "isEqualNode should return true if elements have same namespace, prefix, and local name")
|
||||
|
||||
test(function() {
|
||||
var a = document.createElementNS("ns1", "prefix:foo")
|
||||
var b = document.createElementNS("ns2", "prefix:foo")
|
||||
assert_false(a.isEqualNode(b))
|
||||
}, "isEqualNode should return false if elements have different namespace")
|
||||
|
||||
test(function() {
|
||||
var a = document.createElementNS("ns", "prefix1:foo")
|
||||
var b = document.createElementNS("ns", "prefix2:foo")
|
||||
assert_false(a.isEqualNode(b))
|
||||
}, "isEqualNode should return false if elements have different prefix")
|
||||
|
||||
test(function() {
|
||||
var a = document.createElementNS("ns", "prefix:foo1")
|
||||
var b = document.createElementNS("ns", "prefix:foo2")
|
||||
assert_false(a.isEqualNode(b))
|
||||
}, "isEqualNode should return false if elements have different local name")
|
||||
|
||||
test(function() {
|
||||
var a = document.createElement("foo")
|
||||
a.setAttributeNS("ns", "x:a", "bar")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue