mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 5df56b25e1cb81f81fe16c88be839f9fd538b41e
This commit is contained in:
parent
1dd6ad7063
commit
f170d55d3e
152 changed files with 3527 additions and 85 deletions
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Foreign contexts with HTML tag children</title>
|
||||
<link rel="author" title="Mason Freed" href="mailto:masonfreed@chromium.org">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inbody">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
const contexts = ["svg", "math"];
|
||||
const elements = ["/p", "/br", "b", "big", "blockquote", "br", "center", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "img", "li", "listing", "menu", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var"];
|
||||
contexts.forEach(c => {
|
||||
elements.forEach(e => {
|
||||
const wrapper = document.createElement('div');
|
||||
const html = `<${c}><${e}></${c}`
|
||||
wrapper.innerHTML = html;
|
||||
assert_false(wrapper.innerHTML == html, "The inner HTML should get mutated");
|
||||
|
||||
const tagname = e[0]=='/' ? e.substr(1) : e;
|
||||
const element = wrapper.getElementsByTagName(tagname)[0];
|
||||
assert_true(element !== undefined,`Unable to locate the ${e} node in ${c}`)
|
||||
const parent = element.parentNode
|
||||
assert_true(element.parentNode === wrapper,`The ${e} tag did not exit the ${c}`)
|
||||
});
|
||||
});
|
||||
}, "HTML namespace nodes should exit foreign contexts");
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue