layout/reftests/dom/xbl-children-3.xhtml

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 <html xmlns="http://www.w3.org/1999/xhtml"
michael@0 2 xmlns:html="http://www.w3.org/1999/xhtml"
michael@0 3 xmlns:xbl="http://www.mozilla.org/xbl"
michael@0 4 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
michael@0 5 class="reftest-wait">
michael@0 6 <head>
michael@0 7 <xbl:bindings xmlns="http://www.mozilla.org/xbl">
michael@0 8 <binding id="base">
michael@0 9 <content>
michael@0 10 <html:div style="border: solid red">
michael@0 11 <children />
michael@0 12 </html:div>
michael@0 13 </content>
michael@0 14 <implementation>
michael@0 15 <property name="foo" onget="return 42" />
michael@0 16 </implementation>
michael@0 17 </binding>
michael@0 18 <binding id="derived" extends="#base">
michael@0 19 <content>
michael@0 20 <html:div style="border: dashed green">
michael@0 21 <children includes="span" />
michael@0 22 </html:div>
michael@0 23 </content>
michael@0 24 </binding>
michael@0 25 <binding id="nochildren">
michael@0 26 <content>
michael@0 27 PASS
michael@0 28 </content>
michael@0 29 </binding>
michael@0 30 </xbl:bindings>
michael@0 31 </head>
michael@0 32 <body>
michael@0 33 <!-- Control case: our (only) child matches the children element. -->
michael@0 34 <div id="first" style="-moz-binding: url(#derived)"><span style="color: green">should be green in a green border</span></div>
michael@0 35 <!-- Make sure we ignore xul:template and xul:observes elements! -->
michael@0 36 <div style="-moz-binding: url(#derived)"><xul:template /><xul:observes /><span style="color: green">should be green in a green border</span></div>
michael@0 37 <!-- Case where our (only) child doesn't match any children elements. -->
michael@0 38 <div id="second" style="-moz-binding: url(#derived)"><div>Should be uncolored with no border</div></div>
michael@0 39 <!-- But make sure the binding was still applied! -->
michael@0 40 <div id="output" />
michael@0 41 <script>
michael@0 42 var $ = document.getElementById.bind(document);
michael@0 43 // Note: Done in an onload handler because binding instantiation is
michael@0 44 // asynchronous.
michael@0 45 onload = function() {
michael@0 46 $('output').textContent =
michael@0 47 ($('first').foo === 42) + ", " + ($('first').foo === $('second').foo);
michael@0 48 document.documentElement.removeAttribute('class');
michael@0 49 }
michael@0 50 </script>
michael@0 51 <!-- Case where one of our children matches but the other one doesn't. -->
michael@0 52 <div id="third" style="-moz-binding: url(#derived)"><span>In a span</span><div>Should be uncolored with no border</div></div>
michael@0 53
michael@0 54 <!-- Control case with no <children> in the binding. -->
michael@0 55 <div style="-moz-binding: url(#nochildren)" />
michael@0 56 <!-- Case where we have a child but no <children> in the binding. -->
michael@0 57 <div style="-moz-binding: url(#nochildren)"><span style="color: green">PASS</span></div>
michael@0 58 <!-- But we must ignore xul:template and xul:observes elements! -->
michael@0 59 <div style="-moz-binding: url(#nochildren)"><xul:template /><xul:observes /></div>
michael@0 60 </body>
michael@0 61 </html>

mercurial