Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | <!-- |
michael@0 | 2 | Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 4 | |
michael@0 | 5 | Test document.mozSetImageElement() DOM API and check if ID targets are |
michael@0 | 6 | correctly overridden. |
michael@0 | 7 | --> |
michael@0 | 8 | <html> |
michael@0 | 9 | <head> |
michael@0 | 10 | <style> |
michael@0 | 11 | div { |
michael@0 | 12 | width: 10px; |
michael@0 | 13 | height: 10px; |
michael@0 | 14 | } |
michael@0 | 15 | </style> |
michael@0 | 16 | </head> |
michael@0 | 17 | <body style="margin:0"> |
michael@0 | 18 | <div style="background:-moz-element(#d1);"></div> |
michael@0 | 19 | <div style="background:-moz-element(#d2);"></div> |
michael@0 | 20 | <div style="background:-moz-element(#d3);"></div> |
michael@0 | 21 | |
michael@0 | 22 | <div style="overflow:hidden; height:0;"> |
michael@0 | 23 | <div id="d1" style="background:red;"></div> |
michael@0 | 24 | <div id="d2" style="background:blue;"></div> |
michael@0 | 25 | <!-- two elements with the same ID: the former one will be used --> |
michael@0 | 26 | <div id="d3" style="background:black;"></div> |
michael@0 | 27 | <div id="d3" style="background:yellow;"></div> |
michael@0 | 28 | </div> |
michael@0 | 29 | |
michael@0 | 30 | <script> |
michael@0 | 31 | var d1 = document.getElementById("d1"); |
michael@0 | 32 | var d2 = document.getElementById("d2"); |
michael@0 | 33 | var d3 = document.getElementById("d3"); |
michael@0 | 34 | document.mozSetImageElement("d1", d3); |
michael@0 | 35 | document.mozSetImageElement("d2", null); |
michael@0 | 36 | document.mozSetImageElement("d3", d1); |
michael@0 | 37 | document.mozSetImageElement("d3", null); |
michael@0 | 38 | document.mozSetImageElement("d4", d1); |
michael@0 | 39 | document.mozSetImageElement("", d1); |
michael@0 | 40 | d1.id = "d2"; |
michael@0 | 41 | d2.id = "d1"; |
michael@0 | 42 | </script> |
michael@0 | 43 | </body> |
michael@0 | 44 | </html> |