1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/bugs/495385-2f.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 1.4 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.5 +<head> 1.6 +<!-- Test that suppression works (or is turned off) for XBL content --> 1.7 +<bindings xmlns="http://www.mozilla.org/xbl"> 1.8 + <binding id="before"> 1.9 + <content>Hello<children/></content> 1.10 + </binding> 1.11 + <binding id="after"> 1.12 + <content><children/>Kitty</content> 1.13 + </binding> 1.14 + <binding id="empty1"> 1.15 + <content><div xmlns="http://www.w3.org/1999/xhtml">Hello</div><children/></content> 1.16 + </binding> 1.17 + <binding id="empty2"> 1.18 + <content><children/><div xmlns="http://www.w3.org/1999/xhtml">Kitty</div></content> 1.19 + <implementation> 1.20 + <constructor> 1.21 + // We used to do this in an onload handler, but getAnonymousNodes is no 1.22 + // longer accessible to content, and we can't use SpecialPowers in 1.23 + // reftests. So we enable XBL scopes and take advantage of the fact that XBL 1.24 + // scopes can access these functions. We apply this binding 1.25 + // programatically to make absolutely sure this constructor runs after all the 1.26 + // other bindings have been set up. 1.27 + document.body.offsetHeight; 1.28 + document.getAnonymousNodes(document.getElementById("d3"))[0].style.display = 'inline'; 1.29 + document.getAnonymousNodes(document.getElementById("d4"))[2].style.display = 'inline'; 1.30 + </constructor> 1.31 + </implementation> 1.32 + </binding> 1.33 +</bindings> 1.34 +<style> 1.35 +body > div { border:1px solid black; margin:1em; 1.36 + font-family:sans-serif; letter-spacing:2px; } 1.37 +#d1 { -moz-binding:url(#before); } 1.38 +#d2 { -moz-binding:url(#after); } 1.39 +#d3 { -moz-binding:url(#empty1); } 1.40 +</style> 1.41 +<script> 1.42 +function loaded() { 1.43 + document.getElementById('d4').style.MozBinding = "url(#empty2)"; 1.44 +} 1.45 +</script> 1.46 +</head> 1.47 +<body onload="loaded()"> 1.48 + <div id="d1"> <span>Kitty</span></div> 1.49 + <div id="d2"><span>Hello</span> </div> 1.50 + <div id="d3"> <span>Kitty</span></div> 1.51 + <div id="d4"><span>Hello</span> </div> 1.52 +</body> 1.53 +</html>