Bug 568392. Part 1: fix reftests so they pass if the scrollbars are visible. r=dbaron

This commit is contained in:
Robert O'Callahan 2010-06-18 21:17:35 +12:00
parent 308658bf07
commit 46b86c6732
35 changed files with 333 additions and 702 deletions

View File

@ -65,8 +65,6 @@ _TEST_FILES = \
bug369950-subframe.xml \
bug495648.rdf \
decoration_line_rendering.js \
region_lib.js \
scrolling_helper.html \
test_bug66619.html \
test_bug114649.html \
$(warning test_bug369950.html disabled due to random orange; see bug 492575) \
@ -108,7 +106,6 @@ _TEST_FILES = \
test_flush_on_paint.html \
test_mozPaintCount.html \
test_scroll_selection_into_view.html \
test_scrolling.html \
$(NULL)
# Tests for bugs 441782, 467672 and 570378 don't pass reliably on Windows, because of bug 469208

View File

@ -1,111 +0,0 @@
/*
* JS region library. This deals in rectangles which are arrays of 4 elements:
* left, top, right, bottom.
*
* The constructor constructs a region from a list of rects. If no list is
* passed, then we return an empty region.
*/
function Region(rects) {
this._rects = rects || [];
}
(function() {
function dumpRect(r) {
return "{" + r.join(",") + "}";
}
function generateSpan(coords) {
coords.sort(function(a,b) { return a - b; });
var result = [coords[0]];
for (var i = 1; i < coords.length; ++i) {
if (coords[i] != coords[i - 1]) {
result.push(coords[i]);
}
}
return result;
}
function rectContainsRect(r1, r2) {
return r1[0] <= r2[0] && r1[2] >= r2[2] &&
r1[1] <= r2[1] && r1[3] >= r2[3];
}
function rectIntersectsRect(r1, r2) {
return Math.max(r1[0], r2[0]) < Math.min(r1[2], r2[2]) &&
Math.max(r1[1], r2[1]) < Math.min(r1[3], r2[3]);
}
function subtractRect(r1, r2, rlist) {
var spanX = generateSpan([r1[0], r1[2], r2[0], r2[2]]);
var spanY = generateSpan([r1[1], r1[3], r2[1], r2[3]]);
for (var i = 1; i < spanX.length; ++i) {
for (var j = 1; j < spanY.length; ++j) {
var subrect = [spanX[i - 1], spanY[j - 1], spanX[i], spanY[j]];
if (rectContainsRect(r1, subrect) && !rectContainsRect(r2, subrect)) {
rlist.push(subrect);
}
}
}
}
// Return the contents of the region as a string
Region.prototype.toString = function Region_toString() {
var s = [];
for (var i = 0; i < this._rects.length; ++i) {
var r = this._rects[i];
s.push(dumpRect(r));
}
return "Region(" + s.join(",") + ")";
};
// Returns true if the region contains the entire rectangle r
Region.prototype.containsRect = function Region_containsRect(r) {
var rectList = [r];
for (var i = 0; i < this._rects.length; ++i) {
var newList = [];
for (var j = 0; j < rectList.length; ++j) {
subtractRect(rectList[j], this._rects[i], newList);
}
if (newList.length == 0)
return true;
rectList = newList;
}
return false;
};
Region.prototype.isEmpty = function Region_isEmpty() {
for (var i = 0; i < this._rects.length; ++i) {
var r = this._rects[i];
if (r[0] < r[2] && r[1] < r[3])
return false;
}
return true;
};
Region.prototype.intersectsRect = function Region_intersectsRect(r) {
for (var i = 0; i < this._rects.length; ++i) {
if (rectIntersectsRect(this._rects[i], r))
return true;
}
return false;
};
// Returns true if the region contains the entire region rgn
Region.prototype.containsRegion = function Region_containsRegion(rgn) {
for (var i = 0; i < rgn._rects.length; ++i) {
if (!this.containsRect(rgn._rects[i]))
return false;
}
return true;
};
// Return a region which is the union of this region and another region
Region.prototype.unionRegion = function Region_unionRegion(rgn) {
return new Region(this._rects.concat(rgn._rects));
};
// Returns true if the region covers exactly the same area as region rgn
Region.prototype.equalsRegion = function Region_equalsRegion(rgn) {
return this.containsRegion(rgn) && rgn.containsRegion(this);
};
})();

View File

@ -1,454 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
.testcase {
height:200px;
width:200px;
position:absolute;
overflow:hidden;
left:0;
top:0;
}
iframe {
border:none;
}
</style>
<script src="region_lib.js"></script>
</head>
<body style="margin:0">
<!-- We use gradients here to fill elements with an unpredictable image. Since
our scrolling optimizations take account of areas of an element which
are blank or filled with a solid color, it's fragile to use those in
tests which expect to observe scrolling happening. -->
<!-- Each of the "testcase" elements is one test. We scroll that element's
scrollTop (or scrollLeft, if the element's class is 'horizontal')
from 0 to 20 and then call the function given by the element's id,
passing the blit region and the paint region as a parameters. -->
<div id="testSimpleScroll" class="testcase">
<div style="height:300px; background:-moz-linear-gradient(top, red, black);"></div>
</div>
<div id="testFixedBackground" class="testcase">
<div style="height:300px; margin-bottom:-300px; background:-moz-linear-gradient(left, red, black) fixed;"></div>
<div style="height:300px; background:-moz-linear-gradient(top, rgba(0,0,0,0.7), rgba(255,0,0,0.7));"></div>
</div>
<div id="testFixedPosOverlay" class="testcase">
<div style="position:fixed; left:0; top:50px; width:100px; height:45px; background:yellow;"></div>
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
<p>Hello
</div>
<div style="border:1px solid black;" id="testBorder" class="testcase">
<div style="height:300px; background:-moz-linear-gradient(top, red, black);"></div>
</div>
<div id="testScrollOutOfView" class="testcase">
<div style="height:10px; margin-bottom:210px; background:-moz-linear-gradient(top, rgba(0,0,0,0.7), rgba(255,0,0,0.7));"></div>
</div>
<div id="testScrollIntoView" class="testcase">
<div style="height:10px; margin-top:210px; background:-moz-linear-gradient(top, rgba(0,0,0,0.7), rgba(255,0,0,0.7));"></div>
</div>
<div id="testSimpleScrollWithSubpixelOffset1" style="top:0.2px" class="testcase">
<div style="height:300px; background:-moz-linear-gradient(top, red, black);"></div>
</div>
<div id="testSimpleScrollWithSubpixelOffset2" style="top:0.8px" class="testcase">
<div style="height:300px; background:-moz-linear-gradient(top, red, black);"></div>
</div>
<div id="testSimpleScrollWithSubpixelOffset3" style="left:0.2px" class="horizontal testcase">
<div style="width:300px; height:200px; background:-moz-linear-gradient(left, red, black);"></div>
</div>
<div id="testSimpleScrollWithSubpixelOffset4" style="left:0.8px" class="horizontal testcase">
<div style="width:300px; height:200px; background:-moz-linear-gradient(left, red, black);"></div>
</div>
<div id="testMovingClipArea" class="testcase">
<div style="margin-top:20px; height:20px; margin-bottom:300px; background-color:blue; overflow:hidden;"></div>
</div>
<div id="testNonmovingClipArea" class="testcase">
<div style="height:300px; background:-moz-linear-gradient(top, red, black);"></div>
<div style="position:fixed; left:0; top:150px; width:200px; height:50px; background:yellow; overflow:hidden; opacity:0.5;">
<div style="height:50px; background:-moz-linear-gradient(top, green, yellow); opacity:0.3;"></div>
</div>
</div>
<div id="testFixedOverUniform" class="testcase">
<div style="height:300px; background:blue;"></div>
<div style="position:fixed; left:0; top:50px; width:100px; height:45px; background:yellow; opacity:0.5;"></div>
</div>
<iframe class="testcase" id="testClipIFRAME"
src="data:text/html,<body class='testcase' style='margin:0; height:300px; background:-moz-linear-gradient(top, red, black);'>">
</iframe>
<iframe class="testcase" id="testClipIFRAME2" style="top:-50px"
src="data:text/html,<body class='testcase' style='margin:0; height:300px; background:-moz-linear-gradient(top, red, black);'>">
</iframe>
<div id="testHiddenTable" class="testcase">
<table style="position:fixed; visibility:hidden; width:200px; height:200px; background:blue;">
<tr><td>Hidden stuff</td></tr>
</table>
<div style="height:300px; background:-moz-linear-gradient(top, red, black);"></div>
</div>
<div id="testTableNoBackground" class="testcase">
<table style="position:fixed; width:200px; height:200px;">
<tr><td></td></tr>
</table>
<div style="height:300px; background:-moz-linear-gradient(top, red, black);"></div>
</div>
<iframe class="testcase" id="testNoBlitInSVG" height="200" width="200"
src="data:text/html,<body class='testcase' style='margin:0; height:300px; background:-moz-linear-gradient(top, red, black);'>">
</iframe>
<script>
// We're not in XHTML, so we have to make our SVG elements with script.
var SVG_NS = "http://www.w3.org/2000/svg";
var svg = document.createElementNS(SVG_NS, "svg");
svg.setAttribute("style", "width: 300px; height: 300px");
var g = document.createElementNS(SVG_NS, "g");
g.setAttribute("transform", "translate(100,0) rotate(30)");
var fo = document.createElementNS(SVG_NS, "foreignObject");
fo.setAttribute("x", "0");
fo.setAttribute("y", "0");
fo.setAttribute("width", "200");
fo.setAttribute("height", "200");
var iframe = document.getElementById("testNoBlitInSVG");
iframe.parentNode.replaceChild(svg, iframe);
fo.appendChild(iframe);
g.appendChild(fo);
svg.appendChild(g);
</script>
<iframe class="testcase" id="testNoBlitInTransform" height="200" width="200" style="-moz-transform-origin: 0 0; -moz-transform: translateX(100px) rotate(30deg)"
src="data:text/html,<body class='testcase' style='margin:0; height:300px; background:-moz-linear-gradient(top, red, black);'>">
</iframe>
<script>
var testcases = document.querySelectorAll("div.testcase");
var tests = [];
var iframes = document.querySelectorAll("iframe.testcase");
var currentTest = -1;
function ok(a, msg) {
window.opener.ok(a, tests[currentTest].container.id + ": " + msg);
};
function todo(a, msg) {
window.opener.todo(a, tests[currentTest].container.id + ": " + msg);
};
function finish() {
window.opener.SimpleTest.finish();
window.close();
}
window.onerror = function (event) { window.opener.onerror(event); window.close(); };
// Simple sanity check that scrolling a window with moving content in it does
// the obvious thing: blit the content that was already visible, and repaint
// the content that has scrolled into view.
function testSimpleScroll(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,0,200,180]])),
"Should blit everything that was already visible: " + blitRegion.toString());
ok(paintRegion.equalsRegion(new Region([[0,180,200,200]])),
"Should repaint area that was scrolled into view: " + paintRegion.toString());
}
// Check that scrolling visible content over background-attachment:fixed
// content repaints everything
function testFixedBackground(blitRegion, paintRegion) {
ok(blitRegion.isEmpty(),
"Shouldn't blit anything: " + blitRegion.toString());
ok(paintRegion.equalsRegion(new Region([[0,0,200,200]])),
"Should repaint everything: " + paintRegion.toString());
}
// Check that we optimize scrolling in a reasonable way in the presence of a
// non-moving opaque overlay
function testFixedPosOverlay(blitRegion, paintRegion) {
// The area of the fixed element should not be repainted or blitted at all
var fixedElemRect = [0,50,100,95]
ok(!blitRegion.intersectsRect(fixedElemRect),
"blit region should not intersect fixed-pos element area: " + blitRegion.toString());
ok(!paintRegion.intersectsRect(fixedElemRect),
"paint region should not intersect fixed-pos element area: " + paintRegion.toString());
// The area to the right of the fixed element that we can fill with blitting
// existing content should not be repainted (but may be blitted, although
// it doesn't all need to be blitted either, since most of it is blank)
var noPaintRect = [100,0,200,180];
ok(!paintRegion.intersectsRect(noPaintRect),
"paint region should not intersect blittable area: " + paintRegion.toString());
}
// Check that scrolling an element with moving content in it does
// the obvious thing, even if the element has a border.
function testBorder(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[1,1,201,181]])),
"Should blit everything that was already visible: " + blitRegion.toString());
ok(paintRegion.equalsRegion(new Region([[1,181,201,201]])),
"Should repaint area that was scrolled into view: " + paintRegion.toString());
}
// Check that scrolling some content out of view updates the area that
// was displaying the content
function testScrollOutOfView(blitRegion, paintRegion) {
var all = blitRegion.unionRegion(paintRegion);
ok(all.containsRect([0,0,200,10]),
"Should update everything that was previously visible but scrolled out of view: " + all.toString());
}
// Check that scrolling some content into view updates the area that
// is displaying the content
function testScrollIntoView(blitRegion, paintRegion) {
var all = blitRegion.unionRegion(paintRegion);
ok(all.containsRect([0,190,200,200]),
"Should update everything that was previously visible: " + all.toString());
}
// When we scroll an area which has a very small subpixel offset, we should
// still be doing the obvious thing --- we shouldn't end up painting an extra
// row of pixels anywhere
function testSimpleScrollWithSubpixelOffset1(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,0,200,180]])),
"Should blit everything that was already visible: " + blitRegion.toString());
// The next test is contains, not equals, since we repaint down to 200.2
// which is OK
ok(paintRegion.containsRegion(new Region([[0,180,200,200]])),
"Should repaint area that was scrolled into view: " + paintRegion.toString());
// Check that we're not repainting anything in the area that's blitted
ok(!paintRegion.intersectsRect([0,0,200,180]),
"Should not repaint area that was blitted: " + paintRegion.toString());
}
function testSimpleScrollWithSubpixelOffset2(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,1,200,181]])),
"Should blit everything that was already visible: " + blitRegion.toString());
// The next test is contains, not equals, since we repaint down to 200.8
// which is OK
ok(paintRegion.containsRegion(new Region([[0,181,200,200]])),
"Should repaint area that was scrolled into view: " + paintRegion.toString());
// Check that we're not repainting anything in the area that's blitted
ok(!paintRegion.intersectsRect([0,0,200,180]),
"Should not repaint area that was blitted: " + paintRegion.toString());
}
function testSimpleScrollWithSubpixelOffset3(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,0,180,200]])),
"Should blit everything that was already visible: " + blitRegion.toString());
// The next test is contains, not equals, since we repaint across to 200.2
// which is OK
ok(paintRegion.containsRegion(new Region([[180,0,200,200]])),
"Should repaint area that was scrolled into view: " + paintRegion.toString());
// Check that we're not repainting anything in the area that's blitted
ok(!paintRegion.intersectsRect([0,0,180,200]),
"Should not repaint area that was blitted: " + paintRegion.toString());
}
function testSimpleScrollWithSubpixelOffset4(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[1,0,181,200]])),
"Should blit everything that was already visible: " + blitRegion.toString());
// The next test is contains, not equals, since we repaint down to 200.8
// which is OK
ok(paintRegion.containsRegion(new Region([[181,0,200,200]])),
"Should repaint area that was scrolled into view: " + paintRegion.toString());
// Check that we're not repainting anything in the area that's blitted
ok(!paintRegion.intersectsRect([0,0,180,200]),
"Should not repaint area that was blitted: " + paintRegion.toString());
}
function testMovingClipArea(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,0,200,40]])),
"Should blit everything that's affected: " + blitRegion.toString());
ok(paintRegion.isEmpty(),
"Shouldn't repaint anything: " + paintRegion.toString());
}
function testNonmovingClipArea(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,0,200,130]])),
"Should only blit necessary strip: " + blitRegion.toString());
ok(paintRegion.equalsRegion(new Region([[0,130,200,200]])),
"Should only repaint necessary strip: " + paintRegion.toString());
}
function testFixedOverUniform(blitRegion, paintRegion) {
ok(!blitRegion.intersectsRect([0,20,200,200]),
"Shouldn't blit anything except possibly to cover the area that has moved offscreen: " + blitRegion.toString());
ok(paintRegion.isEmpty(),
"Shouldn't repaint anything: " + paintRegion.toString());
}
function testClipIFRAME(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,0,200,180]])),
"Should blit everything that was already visible: " + blitRegion.toString());
ok(paintRegion.equalsRegion(new Region([[0,180,200,200]])),
"Should repaint area that was scrolled into view: " + paintRegion.toString());
}
function testClipIFRAME2(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,50,200,180]])),
"Should blit everything that was already visible: " + blitRegion.toString());
// ok(paintRegion.equalsRegion(new Region([[0,180,200,200]])),
// "Should repaint area that was scrolled into view: " + paintRegion.toString());
}
function testHiddenTable(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,0,200,180]])),
"Should blit everything that was already visible: " + blitRegion.toString());
ok(paintRegion.equalsRegion(new Region([[0,180,200,200]])),
"Should repaint area that was scrolled into view: " + paintRegion.toString());
}
function testTableNoBackground(blitRegion, paintRegion) {
ok(blitRegion.equalsRegion(new Region([[0,0,200,180]])),
"Should blit everything that was already visible: " + blitRegion.toString());
ok(paintRegion.equalsRegion(new Region([[0,180,200,200]])),
"Should repaint area that was scrolled into view: " + paintRegion.toString());
}
function testNoBlitInSVG(blitRegion, paintRegion) {
ok(blitRegion.isEmpty(), "should not blit when in transformed SVG");
// We're looking at regions in the coordinates of the inner iframe.
// (Not the most useful test, but it does test the particular bug that we
// should be repainting rather than blitting.)
ok(paintRegion.equalsRegion(new Region([[0,0,200,200]])),
"repaint rect must contain area completely inside scrolled region");
}
function testNoBlitInTransform(blitRegion, paintRegion) {
ok(blitRegion.isEmpty(), "should not blit when in CSS Transform");
// We're looking at regions in the coordinates of the inner iframe.
// (Not the most useful test, but it does test the particular bug that we
// should be repainting rather than blitting.)
ok(paintRegion.equalsRegion(new Region([[0,0,200,200]])),
"repaint rect must contain area completely inside scrolled region");
}
function clientRectToRect(cr)
{
return [cr.left, cr.top, cr.right, cr.bottom];
}
// Return the ancestor-or-self of |container| that is a child of body.
function bodyChild(container)
{
var prev;
var next = container;
do {
prev = next;
next = prev.parentNode;
} while (next != document.body);
return prev;
}
function regionForReason(requests, reason)
{
var rects = [];
for (var i = 0; i < requests.length; ++i) {
var r = requests[i];
if (r.reason == reason) {
rects.push(clientRectToRect(r.clientRect));
}
}
return new Region(rects);
}
function afterPaint(event) {
var requests = event.paintRequests;
if (!requests) {
todo(false, "cannot run tests since paintRequests not supported");
finish();
return;
}
var blitRegion = regionForReason(requests, "scroll copy");
var paintRegion = regionForReason(requests, "scroll repaint");
if (blitRegion.isEmpty() && paintRegion.isEmpty())
return;
var testFunc = window[tests[currentTest].container.id];
if (!testFunc) {
ok(false, "Cannot find test function for " + tests[currentTest].container.id);
} else {
testFunc(blitRegion, paintRegion);
}
bodyChild(tests[currentTest].container).style.display = 'none';
nextTest();
}
function nextTest() {
++currentTest;
if (currentTest >= tests.length) {
finish();
return;
}
var t = tests[currentTest];
bodyChild(t.container).style.display = "";
setTimeout(function() {
if (t.scrollable.getAttribute("class").match(/horizontal/)) {
t.scrollable.scrollLeft = 20;
} else {
t.scrollable.scrollTop = 20;
}
}, 0);
}
function runTests() {
for (var i = 0; i < testcases.length; ++i) {
tests.push({ scrollable:testcases[i], container:testcases[i] });
}
for (var i = 0; i < iframes.length; ++i) {
tests.push({ scrollable:iframes[i].contentDocument.body, container:iframes[i] });
}
for (var i = 0; i < tests.length; ++i) {
var t = tests[i];
bodyChild(t.container).style.display = "none";
// Make sure we don't remember a scroll position from history
t.scrollable.scrollTop = 0;
t.scrollable.scrollLeft = 0;
}
window.addEventListener("MozAfterPaint", afterPaint, false);
for (var i = 0; i < iframes.length; ++i) {
iframes[i].contentWindow.addEventListener("MozAfterPaint", afterPaint, false);
}
nextTest();
}
window.onload = function() { setTimeout(runTests, 0); };
</script>
</body>
</html>

View File

@ -1,20 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test calculation of blitting and repaint rects for scrolling</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
window.open("scrolling_helper.html", "", "width=620,height=320");
</script>
</pre>
</body>
</html>

View File

@ -33,6 +33,9 @@
height: 24.33333in;
border-bottom-color: blue;
}
.fill {
height: 75in;
}
</style>
</head>
<body>
@ -54,5 +57,7 @@
on a page <em>after</em> the first (assuming the page area
is shorter than 25 inches).
</p>
<div class="fill">
</div>
</body>
</html>

View File

@ -35,6 +35,9 @@
position: relative;
z-index: -1;
}
.fill {
height: 75in;
}
</style>
</head>
<body>
@ -56,5 +59,7 @@
on a page <em>after</em> the first (assuming the page area
is shorter than 25 inches).
</p>
<div class="fill">
</div>
</body>
</html>

View File

@ -1,15 +1,18 @@
<html><head>
<title>Testcase bug - Black vertical line showing with iframe when you shouldn't see that</title>
<style>
div#main {
width: 997px;
margin: 0px auto;
}
</style>
</head>
<body>
<div id="main">
<iframe frameborder="0"></iframe>
</div>
</body>
</html>
<html><head>
<title>Testcase bug - Black vertical line showing with iframe when you shouldn't see that</title>
<style>
body {
overflow:hidden;
}
div#main {
width: 997px;
margin: 0px auto;
}
</style>
</head>
<body>
<div id="main">
<iframe frameborder="0"></iframe>
</div>
</body>
</html>

View File

@ -1,14 +1,14 @@
<html>
<head>
<title>Bug 383035 Black vertical line showing with iframe when you shouldn't see that</title>
</head>
<body>
<div style="width: 1400px;">
<center>
<table style="width: 815px;"><tr><td>
<iframe frameborder="0"></iframe>
</td></tr></table>
</center>
</div>
</body>
</html>
<html>
<head>
<title>Bug 383035 Black vertical line showing with iframe when you shouldn't see that</title>
</head>
<body style="overflow:hidden">
<div style="width: 1400px;">
<center>
<table style="width: 815px;"><tr><td>
<iframe frameborder="0"></iframe>
</td></tr></table>
</center>
</div>
</body>
</html>

View File

@ -3,7 +3,7 @@
<style type="text/css">
html, body { margin: 0; padding: 0; }
</style>
<div style="-moz-transform: translate(10px,10px)">
<div style="-moz-transform: translate(10px,10px); width:0">
<div style="height: 20px"></div>
<div style="position: fixed; height: 10px; width: 10px; background: blue"></div>
</div>

View File

@ -1,5 +1,8 @@
<!DOCTYPE HTML>
<html>
<body style="height:3000px;">
<body style="height:3000px; overflow:hidden;">
<script>
document.documentElement.scrollTop = 100;
</script>
</body>
</html>

View File

@ -1,6 +1,6 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<body style="height:3000px;">
<body style="height:3000px; overflow:hidden;">
<script>
function doTest() {
document.documentElement.scrollTop = 100;

View File

@ -1,3 +1,4 @@
<body style="overflow:hidden">
<div style="position: absolute;
top: 40px; left: 337px;
width: 6px;
@ -26,3 +27,4 @@
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed feugiat libero vel diam. Pellentesque pulvinar commodo lacus. Sed fringilla. Sed lectus. Praesent laoreet orci vitae nisi. Duis venenatis tristique massa.
</div>
</div>
</body>

View File

@ -1,3 +1,4 @@
<body style="overflow:hidden">
<div style="padding: 20px;
position: absolute;
top: 20px; left: 20px;
@ -10,3 +11,4 @@
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed feugiat libero vel diam. Pellentesque pulvinar commodo lacus. Sed fringilla. Sed lectus. Praesent laoreet orci vitae nisi. Duis venenatis tristique massa.
</div>
</div>
</body>

View File

@ -1,3 +1,4 @@
<body style="overflow:hidden">
<div style="background: -moz-linear-gradient(black, black 50px, white 50px, white 100px, black 100px, black 150px, white 150px, white 200px);
background-size: 300px 200px; background-repeat: no-repeat;
width: 800px; height: 800px;
@ -8,3 +9,4 @@
the reference. -->
<div style="background: black; width: 300px; height: 50px;"></div>
<div style="background: white; width: 300px; height: 50px;"></div>
</body>

View File

@ -13,16 +13,16 @@ fails == out-of-flow-1d.html out-of-flow-1-ref.html # bug 396645
== parent-style-3.html parent-style-3-ref.html
# stress-tests
== stress-1.html about:blank # assertion test
load stress-1.html # assertion test
== stress-2.html stress-2-ref.html # assertion + rendering test
== stress-3.html about:blank # assertion test
asserts(2) == stress-4.html about:blank # assertion/crash test
== stress-5.html about:blank # assertion/crash test
== stress-6.html about:blank # assertion/crash test
== stress-7.html about:blank # assertion/crash test
load stress-3.html # assertion test
asserts(2) load stress-4.html # assertion/crash test
load stress-5.html # assertion/crash test
load stress-6.html # assertion/crash test
load stress-7.html # assertion/crash test
== stress-8.html stress-8-ref.html # assertion/crash test
== stress-9.html stress-9-ref.html # assertion/crash test
== stress-10.html about:blank # crash test
load stress-10.html # crash test
== stress-11.xhtml stress-11-ref.xhtml
== border-not-apply.html border-not-apply-ref.html

View File

@ -1,6 +1,5 @@
<style>
*::first-line { }
*::before { content:"before text";}
html { visibility: hidden }
</style>
<object style="position: fixed;-moz-column-count: 100;"><ol style="float: right;">

View File

@ -3,7 +3,6 @@
<head>
<style>
#a:first-child::first-line { }
body { visibility: hidden; }
</style>
<script>
function runTest() {

View File

@ -6,7 +6,7 @@
#c::first-line { }
</style>
</head>
<body style="visibility: hidden">
<body>
This page should not crash Mozilla
<div id="c">
<table>

View File

@ -9,8 +9,6 @@ nobr::after{ content:"anonymous text"; }
#b::before { content:"before text";}
#b td::before { content:"before text";}
body { visibility: hidden; }
</style>
</head>
<body>

View File

@ -3,7 +3,6 @@
<style>
body > span::first-line { }
span::before { content:"before text"; border:3px solid black;}
body { visibility: hidden; }
</style>
</head>
<body>

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
Checks if the full zoom (x1.3) on -moz-image-rect() produces the same
result as the same full zoom on the CSS sprites produced by hacking
background-position.
This file is identical to background-common-usage-pixel.html except the
zoom factor.
-->
<html reftest-zoom="1.3">
<head>
<title>Testcases: -moz-image-rect() [bug 113577]</title>
<style>
div.wrapper {
width: 32px;
height: 32px;
margin: 10px;
background-color: red;
}
div.wrapper div {
width: 32px;
height: 32px;
background: no-repeat;
}
#test1 {
background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 32, 32, 0);
}
</style>
</head>
<body>
<div class="wrapper"><div id="test1"></div></div>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
Checks if the full zoom (x1.3) on -moz-image-rect() produces the same
result as the same full zoom on the CSS sprites produced by hacking
background-position.
This file is identical to background-common-usage-pixel.html except the
zoom factor.
-->
<html reftest-zoom="1.3">
<head>
<title>Testcases: -moz-image-rect() [bug 113577]</title>
<style>
div.wrapper {
width: 32px;
height: 32px;
margin: 10px;
background-color: red;
}
div.wrapper div {
width: 32px;
height: 32px;
background: no-repeat;
}
#test1 {
background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 32, 32, 0);
}
</style>
</head>
<body>
<div class="wrapper"><div id="test1"></div></div>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
Checks if the full zoom (x1.3) on -moz-image-rect() produces the same
result as the same full zoom on the CSS sprites produced by hacking
background-position.
This file is identical to background-common-usage-pixel.html except the
zoom factor.
-->
<html reftest-zoom="1.3">
<head>
<title>Testcases: -moz-image-rect() [bug 113577]</title>
<style>
div.wrapper {
width: 32px;
height: 32px;
margin: 10px;
background-color: red;
}
div.wrapper div {
width: 32px;
height: 32px;
background: no-repeat;
}
#test2 {
background-image: -moz-image-rect(url(transparent-16x16-in-blue-32x32.png), 0, 32, 16, 0);
}
</style>
</head>
<body>
<div class="wrapper"><div id="test2"></div></div>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
Checks if the full zoom (x1.3) on -moz-image-rect() produces the same
result as the same full zoom on the CSS sprites produced by hacking
background-position.
This file is identical to background-common-usage-pixel.html except the
zoom factor.
-->
<html reftest-zoom="1.3">
<head>
<title>Testcases: -moz-image-rect() [bug 113577]</title>
<style>
div.wrapper {
width: 32px;
height: 32px;
margin: 10px;
background-color: red;
}
div.wrapper div {
width: 32px;
height: 32px;
background: no-repeat;
}
#test2 {
background-image: -moz-image-rect(url(transparent-16x16-in-blue-32x32.png), 0, 32, 16, 0);
}
</style>
</head>
<body>
<div class="wrapper"><div id="test2"></div></div>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
Checks if the full zoom (x1.3) on -moz-image-rect() produces the same
result as the same full zoom on the CSS sprites produced by hacking
background-position.
This file is identical to background-common-usage-pixel.html except the
zoom factor.
-->
<html reftest-zoom="1.3">
<head>
<title>Testcases: -moz-image-rect() [bug 113577]</title>
<style>
div.wrapper {
width: 32px;
height: 32px;
margin: 10px;
background-color: red;
}
div.wrapper div {
width: 32px;
height: 32px;
background: no-repeat;
}
#test3 {
background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 16, 16, 0);
}
</style>
</head>
<body>
<div class="wrapper"><div id="test3"></div></div>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
Checks if the full zoom (x1.3) on -moz-image-rect() produces the same
result as the same full zoom on the CSS sprites produced by hacking
background-position.
This file is identical to background-common-usage-pixel.html except the
zoom factor.
-->
<html reftest-zoom="1.3">
<head>
<title>Testcases: -moz-image-rect() [bug 113577]</title>
<style>
div.wrapper {
width: 32px;
height: 32px;
margin: 10px;
background-color: red;
}
div.wrapper div {
width: 32px;
height: 32px;
background: no-repeat;
}
#test3 {
background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 16, 16, 0);
}
</style>
</head>
<body>
<div class="wrapper"><div id="test3"></div></div>
</body>
</html>

View File

@ -25,15 +25,6 @@
height: 32px;
background: no-repeat;
}
#test1 {
background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 32, 32, 0);
}
#test2 {
background-image: -moz-image-rect(url(transparent-16x16-in-blue-32x32.png), 0, 32, 16, 0);
}
#test3 {
background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 16, 16, 0);
}
#test4 {
background-color: yellow;
background-image: -moz-image-rect(url(transparent-16x16-in-blue-32x32.png), 16, 32, 32, 16);
@ -41,9 +32,6 @@
</style>
</head>
<body>
<div class="wrapper"><div id="test1"></div></div>
<div class="wrapper"><div id="test2"></div></div>
<div class="wrapper"><div id="test3"></div></div>
<div class="wrapper"><div id="test4"></div></div>
</body>
</html>

View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
Checks if the full zoom (x1.3) on -moz-image-rect() produces the same
result as the same full zoom on the CSS sprites produced by hacking
background-position.
This file is identical to background-common-usage-pixel.html except the
zoom factor.
-->
<html reftest-zoom="1.3">
<head>
<title>Testcases: -moz-image-rect() [bug 113577]</title>
<style>
div.wrapper {
width: 32px;
height: 32px;
margin: 10px;
background-color: red;
}
div.wrapper div {
width: 32px;
height: 32px;
background: no-repeat;
}
#test4 {
background-color: yellow;
background-image: -moz-image-rect(url(transparent-16x16-in-blue-32x32.png), 16, 32, 32, 16);
}
</style>
</head>
<body>
<div class="wrapper"><div id="test4"></div></div>
</body>
</html>

View File

@ -1,55 +0,0 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
This file is identical to background-common-usage-ref.html except the
zoom factor.
-->
<html reftest-zoom="1.3">
<head>
<title>Testcases: -moz-image-rect() [bug 113577]</title>
<style>
div.wrapper {
width: 32px;
height: 32px;
margin: 10px;
background-color: red;
}
div.wrapper div {
background-repeat: no-repeat;
}
#test1 {
width: 32px;
height: 32px;
background-position: 0px 0px;
background-image: url('green-16x16-in-blue-32x32.png');
}
#test2 {
width: 32px;
height: 16px;
background-position: 0px 0px;
background-image: url('transparent-16x16-in-blue-32x32.png');
}
#test3 {
width: 16px;
height: 16px;
background-position: 0px 0px;
background-image: url('green-16x16-in-blue-32x32.png');
}
#test4 {
width: 32px;
height: 32px;
background-color: yellow;
background-position: -16px -16px;
background-image: url('transparent-16x16-in-blue-32x32.png');
}
</style>
</head>
<body>
<div class="wrapper"><div id="test1"></div></div>
<div class="wrapper"><div id="test2"></div></div>
<div class="wrapper"><div id="test3"></div></div>
<div class="wrapper"><div id="test4"></div></div>
</body>
</html>

View File

@ -8,6 +8,9 @@ asserts(0-1) == background-draw-nothing-malformed-images.html background-draw-no
== background-over-size-rect.html background-over-size-rect-ref.html
== background-test-parser.html background-test-parser-ref.html
== background-with-other-properties.html background-with-other-properties-ref.html
== background-zoom.html background-zoom-ref.html
== background-zoom-1.html background-zoom-1-ref.html
== background-zoom-2.html background-zoom-2-ref.html
== background-zoom-3.html background-zoom-3-ref.html
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == background-zoom-4.html background-zoom-4-ref.html # bug 567370
== dom-api-computed-style.html dom-api-ref.html
== dom-api.html dom-api-ref.html

View File

@ -2,7 +2,7 @@
<html class="reftest-wait">
<title>Resize Reflow Harness</title>
<style>
html,body { height: 100%; }
html,body { height: 100%; overflow:hidden; }
</style>
<body onload="
var iframe = document.getElementById('outer')

View File

@ -22,6 +22,8 @@ span {
width: 50px;
}
body { width: 900px; }
</style>
</head>
<body>

View File

@ -12,6 +12,10 @@
{
-moz-transform-origin: top left;
}
body
{
overflow:hidden;
}
</style>
</head>
<body>

View File

@ -12,6 +12,10 @@
{
-moz-transform-origin: top left;
}
body
{
overflow:hidden;
}
</style>
</head>
<body>

View File

@ -5,5 +5,8 @@
<div style="margin-left: 50px;">
Test Text
</div>
<div style="position:relative; left:50px; height:10px;">
<!-- make the body overflow by 50px horizontally -->
</div>
</body>
</html>