Bug 817406 (part 2) - Tests for propagating 'direction' to the viewport.

This commit is contained in:
Mats Palmgren 2015-05-27 22:18:37 +00:00
parent ff1545fe71
commit e58ed06dcc
9 changed files with 308 additions and 0 deletions

View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
html { direction: ltr; }
div
{
background-color: green;
border-left: green none 0px;
border-right: green none 0px;
height: 50px;
left: 20%;
margin-left: 0px;
margin-right: 0px;
position: absolute;
right: 20%;
top: 0px;
width: 20%;
}
</style>
</head>
<body>
<div></div>
</body>
</html>

View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
html { direction: rtl; }
div
{
background-color: green;
border-left: green none 0px;
border-right: green none 0px;
height: 50px;
left: 20%;
margin-left: 0px;
margin-right: 0px;
position: absolute;
right: 20%;
top: 0px;
width: 20%;
}
</style>
</head>
<body>
<div></div>
</body>
</html>

View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
div
{
background-color: green;
border-left: green none 0px;
border-right: green none 0px;
height: 50px;
left: 20%;
margin-left: 0px;
margin-right: 0px;
position: absolute;
right: 20%;
top: 0px;
width: 20%;
}
</style>
</head>
<body>
<div></div>
</body>
</html>

View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
html { direction: ltr; }
div
{
background-color: green;
border-left: green none 0px;
border-right: green none 0px;
height: 50px;
left: 20%;
margin-left: 0px;
margin-right: 0px;
position: fixed;
right: 20%;
top: 0px;
width: 20%;
}
</style>
</head>
<body>
<div></div>
</body>
</html>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html class="reftest-print">
<head>
<title>Testcase for bug 1161752</title>
<style>
body,html { margin:0; padding:0; }
div
{
height: 56px;
width: 100px;
vertical-align: top;
margin-bottom: 50px;
margin-right: 100px;
margin-left: auto;
}
div div
{
height: 50px;
width: 100px;
background-color: green;
}
</style>
</head>
<body>
<div><div></div></div>
</body>
</html>

View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html class="reftest-print">
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
html { direction: rtl; }
div
{
background-color: green;
border-left: green none 0px;
border-right: green none 0px;
height: 50px;
left: 100px;
margin-left: 0px;
margin-right: 0px;
position: fixed;
right: 100px;
top: 0px;
width: 100px;
}
</style>
</head>
<body>
<div></div>
</body>
</html>

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>Testcase for bug 1161752</title>
<style>
div
{
height: 56px;
width: 100px;
vertical-align: top;
margin-bottom: 50px;
}
div div
{
height: 50px;
width: 100px;
background-color: green;
margin-left: 300px;
}
</style>
</head>
<body>
<p>Test passes if there are three filled green rectangles and <strong>no red</strong>.</p>
<div><div></div></div>
<div><div></div></div>
<div><div></div></div>
<div><div></div></div>
<div><div></div></div>
</body>
</html>

View File

@ -0,0 +1,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>

View File

@ -152,3 +152,5 @@ skip-if((B2G&&browserIsRemote)||Mulet) == 869833-1.xul 869833-1-ref.xul # Initia
== 1069941-inline-bidi-margin-1.html 1069941-inline-bidi-margin-1-ref.html
skip-if(B2G||Mulet) != 1155359-1.xul 1155359-1-ref.xul
== 1157726-1.html 1157726-1-ref.html
== 1161752.html 1161752-ref.html
== 1161752-5-embed.html 1161752-5-embed-ref.html