/[suikacvs]/www/test/dom/element/cssom/get-bounding-client-rect/dynamic-1.html
Suika

Contents of /www/test/dom/element/cssom/get-bounding-client-rect/dynamic-1.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download) (as text)
Mon Jan 19 02:46:14 2009 UTC (17 years, 6 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/html
Fx and WinIE7 pass, Opera 9.61 fails

1 wakaba 1.1 <!DOCTYPE HTML>
2     <title>appendChild and getBoundingClientRect</title>
3    
4     <body>
5    
6     <p id=result class=FAIL>FAIL (noscript)</p>
7    
8     <script>
9     document.getElementById ('result').firstChild.data = 'FAIL (script)';
10    
11     var el = document.createElement ('div');
12     el.style.position = 'absolute';
13     el.style.width = '120px';
14     el.style.height = '140px';
15    
16     document.body.appendChild (el);
17    
18     var bb = el.getBoundingClientRect (el);
19    
20     if (bb && bb.right - bb.left == 120 && bb.bottom - bb.top == 140) {
21     document.getElementById ('result').firstChild.data = 'PASS';
22     document.getElementById ('result').firstChild.className = 'PASS';
23     } else if (bb) {
24     document.getElementById ('result').firstChild.data = 'FAIL (width = ' + (bb.right - bb.left) + ', height = ' + (bb.bottom - bb.top) + ')';
25     } else {
26     document.getElementById ('result').firstChild.data = 'FAIL (return = ' + bb + ')';
27     }
28    
29     </script>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24