forked from mirrors/gecko-dev
XBL will be disabled on android, so these tests must be skipped. Where possible tests are copied to create shadow DOM tests. Depends on D45615 Differential Revision: https://phabricator.services.mozilla.com/D45616 --HG-- rename : layout/inspector/tests/test_bug522601.xhtml => layout/inspector/tests/test_bug522601-shadow.xhtml rename : layout/inspector/tests/test_bug609549.xhtml => layout/inspector/tests/test_bug609549-shadow.xhtml rename : layout/reftests/bugs/334829-1a.xhtml => layout/reftests/bugs/334829-1a-shadow.xhtml rename : layout/reftests/bugs/334829-1b.xhtml => layout/reftests/bugs/334829-1b-shadow.xhtml rename : layout/reftests/bugs/386310-1b.html => layout/reftests/bugs/386310-1b-shadow.html rename : layout/reftests/bugs/386310-1c.html => layout/reftests/bugs/386310-1c-shadow.html rename : layout/reftests/bugs/386310-1d.html => layout/reftests/bugs/386310-1d-shadow.html rename : layout/reftests/bugs/482592-1a.xhtml => layout/reftests/bugs/482592-1a-shadow.xhtml rename : layout/reftests/bugs/482592-1b.xhtml => layout/reftests/bugs/482592-1b-shadow.xhtml rename : layout/reftests/css-selectors/sibling-combinators-on-anon-content-1.xhtml => layout/reftests/css-selectors/sibling-combinators-on-anon-content-1-shadow.xhtml rename : layout/reftests/css-selectors/sibling-combinators-on-anon-content-2.xhtml => layout/reftests/css-selectors/sibling-combinators-on-anon-content-2-shadow.xhtml rename : layout/reftests/dom/multipleinsertionpoints-appendmultiple.xhtml => layout/reftests/dom/multipleinsertionpoints-appendmultiple-shadow.xhtml rename : layout/reftests/dom/multipleinsertionpoints-appendsingle-1.xhtml => layout/reftests/dom/multipleinsertionpoints-appendsingle-1-shadow.xhtml rename : layout/reftests/dom/multipleinsertionpoints-appendsingle-2.xhtml => layout/reftests/dom/multipleinsertionpoints-appendsingle-2-shadow.xhtml rename : layout/reftests/dom/multipleinsertionpoints-insertmultiple.xhtml => layout/reftests/dom/multipleinsertionpoints-insertmultiple-shadow.xhtml rename : layout/reftests/dom/multipleinsertionpoints-insertsingle-1.xhtml => layout/reftests/dom/multipleinsertionpoints-insertsingle-1-shadow.xhtml rename : layout/reftests/dom/multipleinsertionpoints-insertsingle-2.xhtml => layout/reftests/dom/multipleinsertionpoints-insertsingle-2-shadow.xhtml rename : layout/reftests/dom/multipleinsertionpoints-ref2.xhtml => layout/reftests/dom/multipleinsertionpoints-ref2-shadow.xhtml rename : layout/reftests/ib-split/insert-into-split-inline-5.html => layout/reftests/ib-split/insert-into-split-inline-5-shadow.html extra : moz-landing-system : lando
73 lines
2.5 KiB
HTML
73 lines
2.5 KiB
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<!--
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=609549
|
|
-->
|
|
<head>
|
|
<title>Test for Bug 609549</title>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
</head>
|
|
|
|
<body>
|
|
<!-- No linebreaks since this is html and whitespace is preserved. -->
|
|
<template id="template"><div anonid="box-A">x</div><div anonid="box-B"><slot name="name-span"/></div><div anonid="box-C">x</div><slot/></template>
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=609549">Mozilla Bug 609549</a>
|
|
|
|
<custom-element id="bound"><p id="p">lorem ipsum dolor sit amet</p><span id="sandwiched" slot="name-span">sandwiched</span></custom-element>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
</div>
|
|
<pre id="test">
|
|
<script type="application/javascript">
|
|
<![CDATA[
|
|
|
|
/** Test for Bug 609549 **/
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
customElements.define("custom-element", class extends HTMLElement {
|
|
constructor() {
|
|
super();
|
|
const template = document.getElementById("template");
|
|
const shadowRoot = this.attachShadow({mode: "open"})
|
|
.appendChild(template.content.cloneNode(true));
|
|
}
|
|
});
|
|
|
|
const InspectorUtils = SpecialPowers.InspectorUtils;
|
|
|
|
addLoadEvent(function() {
|
|
ok("getChildrenForNode" in InspectorUtils, "InspectorUtils has no getChildrenForNode");
|
|
var withoutAnons =
|
|
SpecialPowers.unwrap(InspectorUtils.getChildrenForNode($("bound"), false));
|
|
|
|
is(withoutAnons.length, $("bound").childNodes.length,
|
|
"withoutAnons should be the same length as childNodes");
|
|
is(withoutAnons[0], $("p"), "didn't get paragraph - without anons");
|
|
is(withoutAnons[1], $("sandwiched"),
|
|
"didn't get sandwiched span - without anons");
|
|
|
|
var withAnons = InspectorUtils.getChildrenForNode($("bound"), true);
|
|
|
|
is(withAnons.length, 4, "bad withAnons.length");
|
|
is(withAnons[0].getAttribute("anonid"), "box-A",
|
|
"didn't get anonymous box-A");
|
|
is(withAnons[1].getAttribute("anonid"), "box-B",
|
|
"didn't get anonymous box-B");
|
|
is(withAnons[2].getAttribute("anonid"), "box-C",
|
|
"didn't get anonymous box-C");
|
|
is(withAnons[3].assignedNodes()[0].id, "p", "didn't get paragraph - with anons");
|
|
|
|
var bKids = InspectorUtils.getChildrenForNode(withAnons[1], true)[0].assignedNodes();
|
|
is(bKids.length, 1, "bKids.length is bad");
|
|
is(SpecialPowers.unwrap(bKids[0]), $("sandwiched"),
|
|
"didn't get sandwiched span inserted into box-B");
|
|
|
|
SimpleTest.finish();
|
|
});
|
|
|
|
]]>
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|