Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | <html xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 2 | <head> |
michael@0 | 3 | <!-- Test that suppression works (or is turned off) for XBL content --> |
michael@0 | 4 | <bindings xmlns="http://www.mozilla.org/xbl"> |
michael@0 | 5 | <binding id="before"> |
michael@0 | 6 | <content>Hello<children/></content> |
michael@0 | 7 | </binding> |
michael@0 | 8 | <binding id="after"> |
michael@0 | 9 | <content><children/>Kitty</content> |
michael@0 | 10 | </binding> |
michael@0 | 11 | <binding id="empty1"> |
michael@0 | 12 | <content><div xmlns="http://www.w3.org/1999/xhtml">Hello</div><children/></content> |
michael@0 | 13 | </binding> |
michael@0 | 14 | <binding id="empty2"> |
michael@0 | 15 | <content><children/><div xmlns="http://www.w3.org/1999/xhtml">Kitty</div></content> |
michael@0 | 16 | <implementation> |
michael@0 | 17 | <constructor> |
michael@0 | 18 | // We used to do this in an onload handler, but getAnonymousNodes is no |
michael@0 | 19 | // longer accessible to content, and we can't use SpecialPowers in |
michael@0 | 20 | // reftests. So we enable XBL scopes and take advantage of the fact that XBL |
michael@0 | 21 | // scopes can access these functions. We apply this binding |
michael@0 | 22 | // programatically to make absolutely sure this constructor runs after all the |
michael@0 | 23 | // other bindings have been set up. |
michael@0 | 24 | document.body.offsetHeight; |
michael@0 | 25 | document.getAnonymousNodes(document.getElementById("d3"))[0].style.display = 'inline'; |
michael@0 | 26 | document.getAnonymousNodes(document.getElementById("d4"))[2].style.display = 'inline'; |
michael@0 | 27 | </constructor> |
michael@0 | 28 | </implementation> |
michael@0 | 29 | </binding> |
michael@0 | 30 | </bindings> |
michael@0 | 31 | <style> |
michael@0 | 32 | body > div { border:1px solid black; margin:1em; |
michael@0 | 33 | font-family:sans-serif; letter-spacing:2px; } |
michael@0 | 34 | #d1 { -moz-binding:url(#before); } |
michael@0 | 35 | #d2 { -moz-binding:url(#after); } |
michael@0 | 36 | #d3 { -moz-binding:url(#empty1); } |
michael@0 | 37 | </style> |
michael@0 | 38 | <script> |
michael@0 | 39 | function loaded() { |
michael@0 | 40 | document.getElementById('d4').style.MozBinding = "url(#empty2)"; |
michael@0 | 41 | } |
michael@0 | 42 | </script> |
michael@0 | 43 | </head> |
michael@0 | 44 | <body onload="loaded()"> |
michael@0 | 45 | <div id="d1"> <span>Kitty</span></div> |
michael@0 | 46 | <div id="d2"><span>Hello</span> </div> |
michael@0 | 47 | <div id="d3"> <span>Kitty</span></div> |
michael@0 | 48 | <div id="d4"><span>Hello</span> </div> |
michael@0 | 49 | </body> |
michael@0 | 50 | </html> |