8000 Add web platform test · servo/servo@d4f2a05 · GitHub
[go: up one dir, main page]

Skip to content

Commit d4f2a05

Browse files
committed
Add web platform test
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
1 parent 58e4184 commit d4f2a05

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

tests/wpt/meta/MANIFEST.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648688,6 +648688,13 @@
648688648688
{}
648689648689
]
648690648690
],
648691+
"elements-are-parents-of-their-attributes.html": [
648692+
"63e6cfe4cc586c799a1b7f625407e64260e44b55",
648693+
[
648694+
null,
648695+
{}
648696+
]
648697+
],
648691648698
"evaluator-constructor.html": [
648692648699
"8350ceb4499d570c577f9aec674435b415b6672b",
648693648700
[
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Relationship between elements and their attributes</title>
5+
<link rel="author" title="Simon Wülker" href="mailto:simon.wuelker@arcor.de">
6+
<link rel="help" href="https://www.w3.org/TR/1999/REC-xpath-19991116/#attribute-nodes">
7+
<script src="/resources/testharness.js"></script>
8+
<script src="/resources/testharnessreport.js"></script>
9+
</head>
10+
<body>
11+
<div id="context" foo="bar"></div>
12+
<script>
13+
const context = document.getElementById("context");
14+
15+
test(() => {
16+
const result = document.evaluate(
17+
"@foo/parent::*",
18+
context,
19+
null,
20+
XPathResult.ORDERED_NODE_ITERATOR_TYPE,
21+
null
22+
);
23+
24+
assert_equals(result.iterateNext(), context);
25+
assert_equals(result.iterateNext(), null);
26+
}, "Elements are parents of their attributes");
27+
28+
test(() => {
29+
const result = document.evaluate(
30+
"node()",
31+
context,
32+
null,
33+
XPathResult.ORDERED_NODE_ITERATOR_TYPE,
34+
null
35+
);
36+
37+
assert_equals(result.iterateNext(), null);
38+
}, "Attributes are not children of their parents");
39+
</script>
40+
</body>
41+
</html>

0 commit comments

Comments
 (0)
0