1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/xul/test/test_bug393970.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,91 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> 1.7 +<?xml-stylesheet href="data:text/css,description {min-width: 1px; padding: 2px;}" type="text/css"?> 1.8 +<!-- 1.9 +https://bugzilla.mozilla.org/show_bug.cgi?id=393970 1.10 +--> 1.11 +<window title="Mozilla Bug 393970" 1.12 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 1.13 + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> 1.14 + 1.15 + <!-- test results are displayed in the html:body --> 1.16 + <body xmlns="http://www.w3.org/1999/xhtml"> 1.17 + <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=393970" 1.18 + target="_blank">Mozilla Bug 393970</a> 1.19 + </body> 1.20 + 1.21 + <hbox flex="1" pack="start" style="visibility: hidden;"> 1.22 + <grid min-width="1000" width="1000"> 1.23 + <columns> 1.24 + <column flex="1"/> 1.25 + <column flex="2"/> 1.26 + <column flex="3"/> 1.27 + </columns> 1.28 + <rows id="rows1"> 1.29 + <row> 1.30 + <description id="cell11">test1</description> 1.31 + <description id="cell12">test2</description> 1.32 + <description id="cell13">test3</description> 1.33 + </row> 1.34 + <rows id="rows2" flex="1"> 1.35 + <row> 1.36 + <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> 1.37 + <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> 1.38 + <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> 1.39 + </row> 1.40 + <rows id="rows3"> 1.41 + <row> 1.42 + <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> 1.43 + <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> 1.44 + <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> 1.45 + </row> 1.46 + </rows> 1.47 + </rows> 1.48 + </rows> 1.49 + </grid> 1.50 + </hbox> 1.51 + 1.52 + <!-- test code goes here --> 1.53 + <script type="application/javascript"><![CDATA[ 1.54 + /** Test for Bug 393970 **/ 1.55 + 1.56 + if (navigator.platform.startsWith("Linux")) { 1.57 + SimpleTest.expectAssertions(0, 24); 1.58 + } 1.59 + 1.60 + var tests = [ 1.61 + 'overflow-x: hidden; overflow-y: hidden;', 1.62 + 'overflow-x: scroll; overflow-y: hidden;', 1.63 + 'overflow-x: hidden; overflow-y: scroll;', 1.64 + 'overflow-x: scroll; overflow-y: scroll;', 1.65 + ]; 1.66 + var currentTest = -1; 1.67 + 1.68 + function runNextTest() { 1.69 + currentTest++; 1.70 + if (currentTest >= tests.length) { 1.71 + SimpleTest.finish(); 1.72 + return; 1.73 + } 1.74 + 1.75 + $("rows2").setAttribute("style", tests[currentTest]); 1.76 + setTimeout(checkPositions, 0, tests[currentTest]); 1.77 + } 1.78 + 1.79 + function checkPositions(variant) { 1.80 + for (var col = 1; col <= 3; col++) { 1.81 + is($('cell1' + col).boxObject.x, $('cell2' + col).boxObject.x, "Cells (1," + col + ") and (2," + col + ") line up horizontally (with " + variant + ")"); 1.82 + is($('cell2' + col).boxObject.x, $('cell3' + col).boxObject.x, "Cells (2," + col + ") and (3," + col + ") line up horizontally (with " + variant + ")"); 1.83 + } 1.84 + for (var row = 1; row <= 3; row++) { 1.85 + is($('cell' + row + '1').boxObject.y, $('cell' + row + '2').boxObject.y, "Cells (" + row + ",1) and (" + row + ",2) line up vertically (with " + variant + ")"); 1.86 + is($('cell' + row + '2').boxObject.y, $('cell' + row + '3').boxObject.y, "Cells (" + row + ",2) and (" + row + ",3) line up vertically (with " + variant + ")"); 1.87 + } 1.88 + runNextTest(); 1.89 + } 1.90 + 1.91 + addLoadEvent(runNextTest); 1.92 + SimpleTest.waitForExplicitFinish() 1.93 + ]]></script> 1.94 +</window>