layout/xul/test/test_bug393970.xul

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

michael@0 1 <?xml version="1.0"?>
michael@0 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
michael@0 3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
michael@0 4 <?xml-stylesheet href="data:text/css,description {min-width: 1px; padding: 2px;}" type="text/css"?>
michael@0 5 <!--
michael@0 6 https://bugzilla.mozilla.org/show_bug.cgi?id=393970
michael@0 7 -->
michael@0 8 <window title="Mozilla Bug 393970"
michael@0 9 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
michael@0 10 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
michael@0 11
michael@0 12 <!-- test results are displayed in the html:body -->
michael@0 13 <body xmlns="http://www.w3.org/1999/xhtml">
michael@0 14 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=393970"
michael@0 15 target="_blank">Mozilla Bug 393970</a>
michael@0 16 </body>
michael@0 17
michael@0 18 <hbox flex="1" pack="start" style="visibility: hidden;">
michael@0 19 <grid min-width="1000" width="1000">
michael@0 20 <columns>
michael@0 21 <column flex="1"/>
michael@0 22 <column flex="2"/>
michael@0 23 <column flex="3"/>
michael@0 24 </columns>
michael@0 25 <rows id="rows1">
michael@0 26 <row>
michael@0 27 <description id="cell11">test1</description>
michael@0 28 <description id="cell12">test2</description>
michael@0 29 <description id="cell13">test3</description>
michael@0 30 </row>
michael@0 31 <rows id="rows2" flex="1">
michael@0 32 <row>
michael@0 33 <description id="cell21">test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1</description>
michael@0 34 <description id="cell22">test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2</description>
michael@0 35 <description id="cell23">test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3</description>
michael@0 36 </row>
michael@0 37 <rows id="rows3">
michael@0 38 <row>
michael@0 39 <description id="cell31">test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1</description>
michael@0 40 <description id="cell32">test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2</description>
michael@0 41 <description id="cell33">test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3</description>
michael@0 42 </row>
michael@0 43 </rows>
michael@0 44 </rows>
michael@0 45 </rows>
michael@0 46 </grid>
michael@0 47 </hbox>
michael@0 48
michael@0 49 <!-- test code goes here -->
michael@0 50 <script type="application/javascript"><![CDATA[
michael@0 51 /** Test for Bug 393970 **/
michael@0 52
michael@0 53 if (navigator.platform.startsWith("Linux")) {
michael@0 54 SimpleTest.expectAssertions(0, 24);
michael@0 55 }
michael@0 56
michael@0 57 var tests = [
michael@0 58 'overflow-x: hidden; overflow-y: hidden;',
michael@0 59 'overflow-x: scroll; overflow-y: hidden;',
michael@0 60 'overflow-x: hidden; overflow-y: scroll;',
michael@0 61 'overflow-x: scroll; overflow-y: scroll;',
michael@0 62 ];
michael@0 63 var currentTest = -1;
michael@0 64
michael@0 65 function runNextTest() {
michael@0 66 currentTest++;
michael@0 67 if (currentTest >= tests.length) {
michael@0 68 SimpleTest.finish();
michael@0 69 return;
michael@0 70 }
michael@0 71
michael@0 72 $("rows2").setAttribute("style", tests[currentTest]);
michael@0 73 setTimeout(checkPositions, 0, tests[currentTest]);
michael@0 74 }
michael@0 75
michael@0 76 function checkPositions(variant) {
michael@0 77 for (var col = 1; col <= 3; col++) {
michael@0 78 is($('cell1' + col).boxObject.x, $('cell2' + col).boxObject.x, "Cells (1," + col + ") and (2," + col + ") line up horizontally (with " + variant + ")");
michael@0 79 is($('cell2' + col).boxObject.x, $('cell3' + col).boxObject.x, "Cells (2," + col + ") and (3," + col + ") line up horizontally (with " + variant + ")");
michael@0 80 }
michael@0 81 for (var row = 1; row <= 3; row++) {
michael@0 82 is($('cell' + row + '1').boxObject.y, $('cell' + row + '2').boxObject.y, "Cells (" + row + ",1) and (" + row + ",2) line up vertically (with " + variant + ")");
michael@0 83 is($('cell' + row + '2').boxObject.y, $('cell' + row + '3').boxObject.y, "Cells (" + row + ",2) and (" + row + ",3) line up vertically (with " + variant + ")");
michael@0 84 }
michael@0 85 runNextTest();
michael@0 86 }
michael@0 87
michael@0 88 addLoadEvent(runNextTest);
michael@0 89 SimpleTest.waitForExplicitFinish()
michael@0 90 ]]></script>
michael@0 91 </window>

mercurial