summaryrefslogtreecommitdiffstats
path: root/layout/reftests/bidi/1161752.html
blob: e3fa245f56f059fc4feada4569a251270f885403 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
 <head>
  <title>Testcase for bug 1161752</title>
<style>
  object.overlapping-green
    {
      height: 56px;
      width: 500px;
      vertical-align: top;
    }

  div.red-overlapped-reference
    {
      background-color: red;
      bottom: 56px;
      height: 50px;
      left: 300px;
      position: relative;
      width: 100px;
      z-index: -1;
    }
</style>
<script>
function runTest1() {
  var root = document.querySelector('#test1').contentDocument.documentElement;
  root.style.direction='rtl';
  root.offsetHeight;
}
function runTest2() {
  var root = document.querySelector('#test2').contentDocument.documentElement;
  root.style.display='none';
  root.offsetHeight;
  root.style.display='block';
  root.offsetHeight;
}
function runTest3() {
  var doc = document.querySelector('#test3').contentDocument;
  var root = doc.documentElement;
  doc.removeChild(root);
  var newRoot = root.cloneNode(true);
  newRoot.setAttribute('dir','rtl');
  doc.appendChild(newRoot);
}
function runTest4() {
  var root = document.querySelector('#test4').contentDocument.documentElement;
  root.style.direction='rtl';
  root.offsetHeight;
}
</script>
 </head>
 <body>

  <p>Test passes if there are three filled green rectangles and <strong>no red</strong>.</p>


  <div><object id="test1" data="1161752-1-embed.html" type="text/html" class="overlapping-green" onload="runTest1()">This test requires a browser with capability to embed an HTML document thanks to the HTML &lt;object&gt; element.</object></div>
  <div class="red-overlapped-reference"></div>

  <div><object id="test2" data="1161752-2-embed.html" type="text/html" class="overlapping-green" onload="runTest2()">This test requires a browser with capability to embed an HTML document thanks to the HTML &lt;object&gt; element.</object></div>
  <div class="red-overlapped-reference"></div>

  <div><object id="test3" data="1161752-3-embed.html" type="text/html" class="overlapping-green" onload="runTest3()">This test requires a browser with capability to embed an HTML document thanks to the HTML &lt;object&gt; element.</object></div>
  <div class="red-overlapped-reference"></div>

  <div><object id="test4" data="1161752-4-embed.html" type="text/html" class="overlapping-green" onload="runTest4()">This test requires a browser with capability to embed an HTML document thanks to the HTML &lt;object&gt; element.</object></div>
  <div class="red-overlapped-reference"></div>

  <div><object id="test5" data="1161752-5-embed.html" type="text/html" class="overlapping-green">This test requires a browser with capability to embed an HTML document thanks to the HTML &lt;object&gt; element.</object></div>
  <div class="red-overlapped-reference"></div>

 </body>
</html>