diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /layout/inspector/tests/test_bug609549.xhtml | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/inspector/tests/test_bug609549.xhtml')
-rw-r--r-- | layout/inspector/tests/test_bug609549.xhtml | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/layout/inspector/tests/test_bug609549.xhtml b/layout/inspector/tests/test_bug609549.xhtml new file mode 100644 index 000000000..d7d115847 --- /dev/null +++ b/layout/inspector/tests/test_bug609549.xhtml @@ -0,0 +1,67 @@ +<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 type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> + + <bindings xmlns="http://www.mozilla.org/xbl"> + <binding id="testBinding"> + <!-- No linebreaks since this is html and whitespace is preserved. --> + <content><div anonid="box-A">x</div><div anonid="box-B"><children includes="span"/></div><div anonid="box-C">x</div><children/></content> + </binding> + </bindings> +</head> + +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=609549">Mozilla Bug 609549</a> +<div id="bound" style="-moz-binding: url(#testBinding);"><p id="p">lorem ipsum dolor sit amet</p><span id="sandwiched">sandwiched</span></div> + +<div id="content" style="display: none"> + +</div> +<pre id="test"> +<script type="application/javascript"> +<![CDATA[ + +/** Test for Bug 609549 **/ +SimpleTest.waitForExplicitFinish(); + +addLoadEvent(function() { + var domUtils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"]. + getService(SpecialPowers.Ci.inIDOMUtils); + ok("getChildrenForNode" in domUtils, "domUtils has no getChildrenForNode"); + var withoutAnons = SpecialPowers.unwrap(domUtils.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 = domUtils.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].id, "p", "didn't get paragraph - with anons"); + + var bKids = domUtils.getChildrenForNode(withAnons[1], true); + 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> |