mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 539356 - Part 10 - Test changes required for DLBI. r=roc
This commit is contained in:
parent
5076b975a0
commit
aee92f1d56
@ -41,7 +41,9 @@ let WindowEventHandler = {
|
||||
// Sends an asynchronous message when the "onMozAfterPaint" event
|
||||
// is fired.
|
||||
onMozAfterPaint: function WEH_onMozAfterPaint(event) {
|
||||
sendAsyncMessage("Panorama:MozAfterPaint");
|
||||
if (event.clientRects.length > 0) {
|
||||
sendAsyncMessage("Panorama:MozAfterPaint");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,7 @@ _TEST_FILES = \
|
||||
test_bug409604.html \
|
||||
test_bug412567.html \
|
||||
test_bug426082.html \
|
||||
bug426082.html \
|
||||
test_bug427537.html \
|
||||
test_bug432698.html \
|
||||
test_bug443985.html \
|
||||
@ -70,6 +71,7 @@ _TEST_FILES = \
|
||||
test_bug648573.html \
|
||||
test_bug615597.html \
|
||||
test_bug656379-1.html \
|
||||
bug656379-1.html \
|
||||
test_bug656379-2.html \
|
||||
test_bug656954.html \
|
||||
test_bug659350.html \
|
||||
|
182
content/events/test/bug426082.html
Normal file
182
content/events/test/bug426082.html
Normal file
@ -0,0 +1,182 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=426082
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 426082</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<style>
|
||||
canvas {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="runTests()">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=426082">Mozilla Bug 426082</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<p><input type="button" value="Button" id="button"></p>
|
||||
<p><label for="button" id="label">Label</label></p>
|
||||
<p id="outside">Something under the label</p>
|
||||
<pre id="test">
|
||||
<script type="application/javascript;version=1.8">
|
||||
|
||||
/** Test for Bug 426082 **/
|
||||
|
||||
var normalButtonCanvas, pressedButtonCanvas, normalFocusedButtonCanvas,
|
||||
pressedFocusedButtonCanvas, currentSnapshot, button, label, outside;
|
||||
|
||||
function runTests() {
|
||||
normalButtonCanvas = document.getElementById("normalButtonCanvas");
|
||||
pressedButtonCanvas = document.getElementById("pressedButtonCanvas");
|
||||
normalFocusedButtonCanvas = document.getElementById("normalFocusedButtonCanvas");
|
||||
pressedFocusedButtonCanvas = document.getElementById("pressedFocusedButtonCanvas");
|
||||
currentSnapshot = document.getElementById("currentSnapshot");
|
||||
button = document.getElementById("button");
|
||||
label = document.getElementById("label");
|
||||
outside = document.getElementById("outside");
|
||||
SimpleTest.executeSoon(executeTests);
|
||||
}
|
||||
|
||||
function isRectContainedInRectFromRegion(rect, region) {
|
||||
console.log("Button rect: " + rect.left + " " + rect.top + " " + rect.right + " " + rect.bottom);
|
||||
return Array.some(region, function (r) {
|
||||
console.log("Region rect: " + r.left + " " + r.top + " " + r.right + " " + r.bottom);
|
||||
return rect.left >= r.left &&
|
||||
rect.top >= r.top &&
|
||||
rect.right <= r.right &&
|
||||
rect.bottom <= r.bottom;
|
||||
});
|
||||
}
|
||||
|
||||
function paintListener(e) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
console.log("paint");
|
||||
if (isRectContainedInRectFromRegion(buttonRect(), e.clientRects)) {
|
||||
console.log("painted");
|
||||
gNeedsPaint = false;
|
||||
takeSnapshot(currentSnapshot);
|
||||
}
|
||||
}
|
||||
|
||||
var gNeedsPaint = false;
|
||||
function executeTests() {
|
||||
var testYielder = tests();
|
||||
function execNext() {
|
||||
try {
|
||||
console.log("check painted");
|
||||
if (!gNeedsPaint) {
|
||||
testYielder.next();
|
||||
button.getBoundingClientRect(); // Flush.
|
||||
gNeedsPaint = true;
|
||||
}
|
||||
SimpleTest.executeSoon(execNext);
|
||||
} catch (e) {}
|
||||
}
|
||||
execNext();
|
||||
}
|
||||
|
||||
function tests() {
|
||||
window.addEventListener("MozAfterPaint", paintListener, false);
|
||||
takeSnapshot(normalButtonCanvas);
|
||||
// Press the button.
|
||||
sendMouseEvent("mousemove", button);
|
||||
sendMouseEvent("mousedown", button);
|
||||
yield;
|
||||
takeSnapshot(pressedFocusedButtonCanvas);
|
||||
compareSnapshots_(normalButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal buttons.");
|
||||
// Release.
|
||||
sendMouseEvent("mouseup", button);
|
||||
yield;
|
||||
// make sure the button is focused as this doesn't happen on click on Mac
|
||||
button.focus();
|
||||
takeSnapshot(normalFocusedButtonCanvas);
|
||||
compareSnapshots_(normalFocusedButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal focused buttons.");
|
||||
// Unfocus the button.
|
||||
sendMouseEvent("mousedown", outside);
|
||||
sendMouseEvent("mouseup", outside);
|
||||
yield;
|
||||
|
||||
// Press the label.
|
||||
sendMouseEvent("mousemove", label);
|
||||
sendMouseEvent("mousedown", label);
|
||||
yield;
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, false, "Pressing the label should have pressed the button.");
|
||||
takeSnapshot(pressedButtonCanvas);
|
||||
// Move the mouse down from the label.
|
||||
sendMouseEvent("mousemove", outside);
|
||||
yield;
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, true, "Moving the mouse down from the label should have unpressed the button.");
|
||||
// ... and up again.
|
||||
sendMouseEvent("mousemove", label);
|
||||
yield;
|
||||
compareSnapshots_(pressedButtonCanvas, currentSnapshot, true, "Moving the mouse back on top of the label should have pressed the button.");
|
||||
// Release.
|
||||
sendMouseEvent("mouseup", label);
|
||||
yield;
|
||||
compareSnapshots_(normalFocusedButtonCanvas, currentSnapshot, true, "Releasing the mouse over the label should have unpressed (and focused) the button.");
|
||||
// Press the label and remove it.
|
||||
sendMouseEvent("mousemove", label);
|
||||
sendMouseEvent("mousedown", label);
|
||||
yield;
|
||||
label.parentNode.removeChild(label);
|
||||
yield;
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, true, "Removing the label should have unpressed the button.");
|
||||
sendMouseEvent("mouseup", label);
|
||||
window.removeEventListener("MozAfterPaint", paintListener, false);
|
||||
window.opener.finishTests();
|
||||
}
|
||||
|
||||
function sendMouseEvent(t, elem) {
|
||||
var r = elem.getBoundingClientRect();
|
||||
synthesizeMouse(elem, r.width / 2, r.height / 2, {type: t});
|
||||
}
|
||||
|
||||
function compareSnapshots_(c1, c2, shouldBeIdentical, msg) {
|
||||
var [correct, c1url, c2url] = compareSnapshots(c1, c2, shouldBeIdentical);
|
||||
if (correct) {
|
||||
if (shouldBeIdentical) {
|
||||
window.opener.ok(true, msg + " - expected " + c1url);
|
||||
} else {
|
||||
window.opener.ok(true, msg + " - got " + c1url + " and " + c2url);
|
||||
}
|
||||
} else {
|
||||
if (shouldBeIdentical) {
|
||||
window.opener.ok(false, msg + " - expected " + c1url + " but got " + c2url);
|
||||
} else {
|
||||
window.opener.ok(false, msg + " - expected something other than " + c1url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function takeSnapshot(canvas) {
|
||||
var r = buttonRect();
|
||||
var ctx = canvas.getContext("2d");
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
canvas.width = r.width + 4;
|
||||
canvas.height = r.height + 4;
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.drawWindow(window, r.left - 2, r.top - 2, r.width + 4, r.height + 4, "#FFF");
|
||||
}
|
||||
|
||||
function buttonRect() {
|
||||
return button.getBoundingClientRect();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
|
||||
<canvas id="normalButtonCanvas"></canvas>
|
||||
<canvas id="pressedButtonCanvas"></canvas>
|
||||
<canvas id="normalFocusedButtonCanvas"></canvas>
|
||||
<canvas id="pressedFocusedButtonCanvas"></canvas>
|
||||
<canvas id="currentSnapshot"></canvas>
|
||||
</body>
|
||||
</html>
|
208
content/events/test/bug656379-1.html
Normal file
208
content/events/test/bug656379-1.html
Normal file
@ -0,0 +1,208 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=656379
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 656379</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<style>
|
||||
canvas {
|
||||
display: none;
|
||||
}
|
||||
input[type=button] {
|
||||
-moz-appearance: none;
|
||||
padding: 0;
|
||||
border: none;
|
||||
color: black;
|
||||
background: white;
|
||||
}
|
||||
input[type=button]::-moz-focus-inner { border: none; }
|
||||
|
||||
/* Make sure that normal, focused, hover+active, focused+hover+active
|
||||
buttons all have different styles so that the test keeps moving along. */
|
||||
input[type=button]:hover:active {
|
||||
background: red;
|
||||
}
|
||||
input[type=button]:focus {
|
||||
background: green;
|
||||
}
|
||||
input[type=button]:focus:hover:active {
|
||||
background: purple;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="runTests()">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=656379">Mozilla Bug 656379</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript;version=1.8">
|
||||
|
||||
|
||||
var normalButtonCanvas, pressedButtonCanvas, normalFocusedButtonCanvas,
|
||||
pressedFocusedButtonCanvas, currentSnapshot, button, label, outside;
|
||||
|
||||
function runTests() {
|
||||
normalButtonCanvas = $("normalButtonCanvas");
|
||||
pressedButtonCanvas = $("pressedButtonCanvas");
|
||||
normalFocusedButtonCanvas = $("normalFocusedButtonCanvas");
|
||||
pressedFocusedButtonCanvas = $("pressedFocusedButtonCanvas");
|
||||
currentSnapshot = $("currentSnapshot");
|
||||
button = $("button");
|
||||
label = $("label");
|
||||
outside = $("outside");
|
||||
SimpleTest.executeSoon(executeTests);
|
||||
}
|
||||
|
||||
function isRectContainedInRectFromRegion(rect, region) {
|
||||
return Array.some(region, function (r) {
|
||||
return rect.left >= r.left &&
|
||||
rect.top >= r.top &&
|
||||
rect.right <= r.right &&
|
||||
rect.bottom <= r.bottom;
|
||||
});
|
||||
}
|
||||
|
||||
function paintListener(e) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
window.opener.ok(true, "Paint");
|
||||
if (isRectContainedInRectFromRegion(buttonRect(), e.clientRects)) {
|
||||
window.opener.ok(true, "Painted button");
|
||||
gNeedsPaint = false;
|
||||
takeSnapshot(currentSnapshot);
|
||||
}
|
||||
}
|
||||
|
||||
var gNeedsPaint = false;
|
||||
function executeTests() {
|
||||
var testYielder = tests();
|
||||
function execNext() {
|
||||
try {
|
||||
if (!gNeedsPaint) {
|
||||
testYielder.next();
|
||||
button.getBoundingClientRect(); // Flush.
|
||||
gNeedsPaint = true;
|
||||
}
|
||||
SimpleTest.executeSoon(execNext);
|
||||
} catch (e) {}
|
||||
}
|
||||
execNext();
|
||||
}
|
||||
|
||||
function tests() {
|
||||
window.addEventListener("MozAfterPaint", paintListener, false);
|
||||
takeSnapshot(normalButtonCanvas);
|
||||
// Press the button.
|
||||
sendMouseEvent("mousemove", button);
|
||||
sendMouseEvent("mousedown", button);
|
||||
yield;
|
||||
window.opener.ok(true, "1");
|
||||
takeSnapshot(pressedFocusedButtonCanvas);
|
||||
compareSnapshots_(normalButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal buttons.");
|
||||
// Release.
|
||||
sendMouseEvent("mouseup", button);
|
||||
yield;
|
||||
window.opener.ok(true, "2");
|
||||
// make sure the button is focused as this doesn't happen on click on Mac
|
||||
button.focus();
|
||||
takeSnapshot(normalFocusedButtonCanvas);
|
||||
compareSnapshots_(normalFocusedButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal focused buttons.");
|
||||
// Unfocus the button.
|
||||
sendMouseEvent("mousedown", outside);
|
||||
sendMouseEvent("mouseup", outside);
|
||||
yield;
|
||||
window.opener.ok(true, "3");
|
||||
|
||||
// Press the label.
|
||||
sendMouseEvent("mousemove", label);
|
||||
sendMouseEvent("mousedown", label);
|
||||
yield;
|
||||
window.opener.ok(true, "4");
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, false, "Pressing the label should have pressed the button.");
|
||||
takeSnapshot(pressedButtonCanvas);
|
||||
// Move the mouse down from the label.
|
||||
sendMouseEvent("mousemove", outside);
|
||||
yield;
|
||||
window.opener.ok(true, "5");
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, true, "Moving the mouse down from the label should have unpressed the button.");
|
||||
// ... and up again.
|
||||
sendMouseEvent("mousemove", label);
|
||||
yield;
|
||||
window.opener.ok(true, "6");
|
||||
compareSnapshots_(pressedButtonCanvas, currentSnapshot, true, "Moving the mouse back on top of the label should have pressed the button.");
|
||||
// Release.
|
||||
sendMouseEvent("mouseup", label);
|
||||
yield;
|
||||
window.opener.ok(true, "7");
|
||||
compareSnapshots_(normalFocusedButtonCanvas, currentSnapshot, true, "Releasing the mouse over the label should have unpressed (and focused) the button.");
|
||||
// Press the label and remove it.
|
||||
sendMouseEvent("mousemove", label);
|
||||
sendMouseEvent("mousedown", label);
|
||||
yield;
|
||||
window.opener.ok(true, "8");
|
||||
label.parentNode.removeChild(label);
|
||||
yield;
|
||||
window.opener.ok(true, "9");
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, true, "Removing the label should have unpressed the button.");
|
||||
sendMouseEvent("mouseup", label);
|
||||
window.removeEventListener("MozAfterPaint", paintListener, false);
|
||||
window.opener.finishTests();
|
||||
}
|
||||
|
||||
function sendMouseEvent(t, elem) {
|
||||
var r = elem.getBoundingClientRect();
|
||||
synthesizeMouse(elem, r.width / 2, r.height / 2, {type: t});
|
||||
}
|
||||
|
||||
function compareSnapshots_(c1, c2, shouldBeIdentical, msg) {
|
||||
var [correct, c1url, c2url] = compareSnapshots(c1, c2, shouldBeIdentical);
|
||||
if (correct) {
|
||||
if (shouldBeIdentical) {
|
||||
window.opener.ok(true, msg + " - expected " + c1url);
|
||||
} else {
|
||||
window.opener.ok(true, msg + " - got " + c1url + " and " + c2url);
|
||||
}
|
||||
} else {
|
||||
if (shouldBeIdentical) {
|
||||
window.opener.ok(false, msg + " - expected " + c1url + " but got " + c2url);
|
||||
} else {
|
||||
window.opener.ok(false, msg + " - expected something other than " + c1url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function takeSnapshot(canvas) {
|
||||
var r = buttonRect();
|
||||
var ctx = canvas.getContext("2d");
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
canvas.width = r.width + 4;
|
||||
canvas.height = r.height + 4;
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.drawWindow(window, r.left - 2, r.top - 2, r.width + 4, r.height + 4, "#FFF");
|
||||
}
|
||||
|
||||
function buttonRect() {
|
||||
return button.getBoundingClientRect();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
<p><input type="button" value="Button" id="button"></p>
|
||||
<p><label for="button" id="label">Label</label></p>
|
||||
<p id="outside">Something under the label</p>
|
||||
|
||||
<canvas id="normalButtonCanvas"></canvas>
|
||||
<canvas id="pressedButtonCanvas"></canvas>
|
||||
<canvas id="normalFocusedButtonCanvas"></canvas>
|
||||
<canvas id="pressedFocusedButtonCanvas"></canvas>
|
||||
<canvas id="currentSnapshot"></canvas>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -9,170 +9,22 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=426082
|
||||
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<style>
|
||||
canvas {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="runTests()">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=426082">Mozilla Bug 426082</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<body>
|
||||
|
||||
<pre id="test">
|
||||
<script type="application/javascript;version=1.8">
|
||||
|
||||
/** Test for Bug 426082 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var subwindow = window.open("./bug426082.html", "bug426082", "width=800,height=1000");
|
||||
|
||||
var normalButtonCanvas, pressedButtonCanvas, normalFocusedButtonCanvas,
|
||||
pressedFocusedButtonCanvas, currentSnapshot, button, label, outside;
|
||||
|
||||
function runTests() {
|
||||
normalButtonCanvas = $("normalButtonCanvas");
|
||||
pressedButtonCanvas = $("pressedButtonCanvas");
|
||||
normalFocusedButtonCanvas = $("normalFocusedButtonCanvas");
|
||||
pressedFocusedButtonCanvas = $("pressedFocusedButtonCanvas");
|
||||
currentSnapshot = $("currentSnapshot");
|
||||
button = $("button");
|
||||
label = $("label");
|
||||
outside = $("outside");
|
||||
SimpleTest.executeSoon(executeTests);
|
||||
}
|
||||
|
||||
function isRectContainedInRectFromRegion(rect, region) {
|
||||
return Array.some(region, function (r) {
|
||||
return rect.left >= r.left &&
|
||||
rect.top >= r.top &&
|
||||
rect.right <= r.right &&
|
||||
rect.bottom <= r.bottom;
|
||||
});
|
||||
}
|
||||
|
||||
function paintListener(e) {
|
||||
if (isRectContainedInRectFromRegion(buttonRect(), e.clientRects)) {
|
||||
gNeedsPaint = false;
|
||||
takeSnapshot(currentSnapshot);
|
||||
}
|
||||
}
|
||||
|
||||
var gNeedsPaint = false;
|
||||
function executeTests() {
|
||||
var testYielder = tests();
|
||||
function execNext() {
|
||||
try {
|
||||
if (!gNeedsPaint) {
|
||||
testYielder.next();
|
||||
button.getBoundingClientRect(); // Flush.
|
||||
gNeedsPaint = true;
|
||||
}
|
||||
SimpleTest.executeSoon(execNext);
|
||||
} catch (e) {}
|
||||
}
|
||||
execNext();
|
||||
}
|
||||
|
||||
function tests() {
|
||||
window.addEventListener("MozAfterPaint", paintListener, false);
|
||||
takeSnapshot(normalButtonCanvas);
|
||||
// Press the button.
|
||||
sendMouseEvent("mousemove", button);
|
||||
sendMouseEvent("mousedown", button);
|
||||
yield;
|
||||
takeSnapshot(pressedFocusedButtonCanvas);
|
||||
compareSnapshots_(normalButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal buttons.");
|
||||
// Release.
|
||||
sendMouseEvent("mouseup", button);
|
||||
yield;
|
||||
// make sure the button is focused as this doesn't happen on click on Mac
|
||||
button.focus();
|
||||
takeSnapshot(normalFocusedButtonCanvas);
|
||||
compareSnapshots_(normalFocusedButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal focused buttons.");
|
||||
// Unfocus the button.
|
||||
sendMouseEvent("mousedown", outside);
|
||||
sendMouseEvent("mouseup", outside);
|
||||
yield;
|
||||
|
||||
// Press the label.
|
||||
sendMouseEvent("mousemove", label);
|
||||
sendMouseEvent("mousedown", label);
|
||||
yield;
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, false, "Pressing the label should have pressed the button.");
|
||||
takeSnapshot(pressedButtonCanvas);
|
||||
// Move the mouse down from the label.
|
||||
sendMouseEvent("mousemove", outside);
|
||||
yield;
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, true, "Moving the mouse down from the label should have unpressed the button.");
|
||||
// ... and up again.
|
||||
sendMouseEvent("mousemove", label);
|
||||
yield;
|
||||
compareSnapshots_(pressedButtonCanvas, currentSnapshot, true, "Moving the mouse back on top of the label should have pressed the button.");
|
||||
// Release.
|
||||
sendMouseEvent("mouseup", label);
|
||||
yield;
|
||||
compareSnapshots_(normalFocusedButtonCanvas, currentSnapshot, true, "Releasing the mouse over the label should have unpressed (and focused) the button.");
|
||||
// Press the label and remove it.
|
||||
sendMouseEvent("mousemove", label);
|
||||
sendMouseEvent("mousedown", label);
|
||||
yield;
|
||||
label.parentNode.removeChild(label);
|
||||
yield;
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, true, "Removing the label should have unpressed the button.");
|
||||
sendMouseEvent("mouseup", label);
|
||||
window.removeEventListener("MozAfterPaint", paintListener, false);
|
||||
function finishTests() {
|
||||
subwindow.close();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function sendMouseEvent(t, elem) {
|
||||
var r = elem.getBoundingClientRect();
|
||||
synthesizeMouse(elem, r.width / 2, r.height / 2, {type: t});
|
||||
}
|
||||
|
||||
function compareSnapshots_(c1, c2, shouldBeIdentical, msg) {
|
||||
var [correct, c1url, c2url] = compareSnapshots(c1, c2, shouldBeIdentical);
|
||||
if (correct) {
|
||||
if (shouldBeIdentical) {
|
||||
ok(true, msg + " - expected " + c1url);
|
||||
} else {
|
||||
ok(true, msg + " - got " + c1url + " and " + c2url);
|
||||
}
|
||||
} else {
|
||||
if (shouldBeIdentical) {
|
||||
ok(false, msg + " - expected " + c1url + " but got " + c2url);
|
||||
} else {
|
||||
ok(false, msg + " - expected something other than " + c1url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function takeSnapshot(canvas) {
|
||||
var r = buttonRect();
|
||||
var ctx = canvas.getContext("2d");
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
canvas.width = r.width + 4;
|
||||
canvas.height = r.height + 4;
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.drawWindow(window, r.left - 2, r.top - 2, r.width + 4, r.height + 4, "#FFF");
|
||||
}
|
||||
|
||||
function buttonRect() {
|
||||
return button.getBoundingClientRect();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
<p><input type="button" value="Button" id="button"></p>
|
||||
<p><label for="button" id="label">Label</label></p>
|
||||
<p id="outside">Something under the label</p>
|
||||
|
||||
<canvas id="normalButtonCanvas"></canvas>
|
||||
<canvas id="pressedButtonCanvas"></canvas>
|
||||
<canvas id="normalFocusedButtonCanvas"></canvas>
|
||||
<canvas id="pressedFocusedButtonCanvas"></canvas>
|
||||
<canvas id="currentSnapshot"></canvas>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -9,190 +9,22 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=656379
|
||||
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<style>
|
||||
canvas {
|
||||
display: none;
|
||||
}
|
||||
input[type=button] {
|
||||
-moz-appearance: none;
|
||||
padding: 0;
|
||||
border: none;
|
||||
color: black;
|
||||
background: white;
|
||||
}
|
||||
input[type=button]::-moz-focus-inner { border: none; }
|
||||
|
||||
/* Make sure that normal, focused, hover+active, focused+hover+active
|
||||
buttons all have different styles so that the test keeps moving along. */
|
||||
input[type=button]:hover:active {
|
||||
background: red;
|
||||
}
|
||||
input[type=button]:focus {
|
||||
background: green;
|
||||
}
|
||||
input[type=button]:focus:hover:active {
|
||||
background: purple;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="runTests()">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=426082">Mozilla Bug 426082</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<body>
|
||||
|
||||
<pre id="test">
|
||||
<script type="application/javascript;version=1.8">
|
||||
|
||||
/** Test for Bug 426082 **/
|
||||
/** Test for Bug 656379 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var subwindow = window.open("./bug656379-1.html", "bug656379", "width=800,height=1000");
|
||||
|
||||
var normalButtonCanvas, pressedButtonCanvas, normalFocusedButtonCanvas,
|
||||
pressedFocusedButtonCanvas, currentSnapshot, button, label, outside;
|
||||
|
||||
function runTests() {
|
||||
normalButtonCanvas = $("normalButtonCanvas");
|
||||
pressedButtonCanvas = $("pressedButtonCanvas");
|
||||
normalFocusedButtonCanvas = $("normalFocusedButtonCanvas");
|
||||
pressedFocusedButtonCanvas = $("pressedFocusedButtonCanvas");
|
||||
currentSnapshot = $("currentSnapshot");
|
||||
button = $("button");
|
||||
label = $("label");
|
||||
outside = $("outside");
|
||||
SimpleTest.executeSoon(executeTests);
|
||||
}
|
||||
|
||||
function isRectContainedInRectFromRegion(rect, region) {
|
||||
return Array.some(region, function (r) {
|
||||
return rect.left >= r.left &&
|
||||
rect.top >= r.top &&
|
||||
rect.right <= r.right &&
|
||||
rect.bottom <= r.bottom;
|
||||
});
|
||||
}
|
||||
|
||||
function paintListener(e) {
|
||||
if (isRectContainedInRectFromRegion(buttonRect(), e.clientRects)) {
|
||||
gNeedsPaint = false;
|
||||
takeSnapshot(currentSnapshot);
|
||||
}
|
||||
}
|
||||
|
||||
var gNeedsPaint = false;
|
||||
function executeTests() {
|
||||
var testYielder = tests();
|
||||
function execNext() {
|
||||
try {
|
||||
if (!gNeedsPaint) {
|
||||
testYielder.next();
|
||||
button.getBoundingClientRect(); // Flush.
|
||||
gNeedsPaint = true;
|
||||
}
|
||||
SimpleTest.executeSoon(execNext);
|
||||
} catch (e) {}
|
||||
}
|
||||
execNext();
|
||||
}
|
||||
|
||||
function tests() {
|
||||
window.addEventListener("MozAfterPaint", paintListener, false);
|
||||
takeSnapshot(normalButtonCanvas);
|
||||
// Press the button.
|
||||
sendMouseEvent("mousemove", button);
|
||||
sendMouseEvent("mousedown", button);
|
||||
yield;
|
||||
takeSnapshot(pressedFocusedButtonCanvas);
|
||||
compareSnapshots_(normalButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal buttons.");
|
||||
// Release.
|
||||
sendMouseEvent("mouseup", button);
|
||||
yield;
|
||||
// make sure the button is focused as this doesn't happen on click on Mac
|
||||
button.focus();
|
||||
takeSnapshot(normalFocusedButtonCanvas);
|
||||
compareSnapshots_(normalFocusedButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal focused buttons.");
|
||||
// Unfocus the button.
|
||||
sendMouseEvent("mousedown", outside);
|
||||
sendMouseEvent("mouseup", outside);
|
||||
yield;
|
||||
|
||||
// Press the label.
|
||||
sendMouseEvent("mousemove", label);
|
||||
sendMouseEvent("mousedown", label);
|
||||
yield;
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, false, "Pressing the label should have pressed the button.");
|
||||
takeSnapshot(pressedButtonCanvas);
|
||||
// Move the mouse down from the label.
|
||||
sendMouseEvent("mousemove", outside);
|
||||
yield;
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, true, "Moving the mouse down from the label should have unpressed the button.");
|
||||
// ... and up again.
|
||||
sendMouseEvent("mousemove", label);
|
||||
yield;
|
||||
compareSnapshots_(pressedButtonCanvas, currentSnapshot, true, "Moving the mouse back on top of the label should have pressed the button.");
|
||||
// Release.
|
||||
sendMouseEvent("mouseup", label);
|
||||
yield;
|
||||
compareSnapshots_(normalFocusedButtonCanvas, currentSnapshot, true, "Releasing the mouse over the label should have unpressed (and focused) the button.");
|
||||
// Press the label and remove it.
|
||||
sendMouseEvent("mousemove", label);
|
||||
sendMouseEvent("mousedown", label);
|
||||
yield;
|
||||
label.parentNode.removeChild(label);
|
||||
yield;
|
||||
compareSnapshots_(normalButtonCanvas, currentSnapshot, true, "Removing the label should have unpressed the button.");
|
||||
sendMouseEvent("mouseup", label);
|
||||
window.removeEventListener("MozAfterPaint", paintListener, false);
|
||||
function finishTests() {
|
||||
subwindow.close();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function sendMouseEvent(t, elem) {
|
||||
var r = elem.getBoundingClientRect();
|
||||
synthesizeMouse(elem, r.width / 2, r.height / 2, {type: t});
|
||||
}
|
||||
|
||||
function compareSnapshots_(c1, c2, shouldBeIdentical, msg) {
|
||||
var [correct, c1url, c2url] = compareSnapshots(c1, c2, shouldBeIdentical);
|
||||
if (correct) {
|
||||
if (shouldBeIdentical) {
|
||||
ok(true, msg + " - expected " + c1url);
|
||||
} else {
|
||||
ok(true, msg + " - got " + c1url + " and " + c2url);
|
||||
}
|
||||
} else {
|
||||
if (shouldBeIdentical) {
|
||||
ok(false, msg + " - expected " + c1url + " but got " + c2url);
|
||||
} else {
|
||||
ok(false, msg + " - expected something other than " + c1url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function takeSnapshot(canvas) {
|
||||
var r = buttonRect();
|
||||
var ctx = canvas.getContext("2d");
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
canvas.width = r.width + 4;
|
||||
canvas.height = r.height + 4;
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.drawWindow(window, r.left - 2, r.top - 2, r.width + 4, r.height + 4, "#FFF");
|
||||
}
|
||||
|
||||
function buttonRect() {
|
||||
return button.getBoundingClientRect();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
<p><input type="button" value="Button" id="button"></p>
|
||||
<p><label for="button" id="label">Label</label></p>
|
||||
<p id="outside">Something under the label</p>
|
||||
|
||||
<canvas id="normalButtonCanvas"></canvas>
|
||||
<canvas id="pressedButtonCanvas"></canvas>
|
||||
<canvas id="normalFocusedButtonCanvas"></canvas>
|
||||
<canvas id="pressedFocusedButtonCanvas"></canvas>
|
||||
<canvas id="currentSnapshot"></canvas>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -94,8 +94,9 @@ function done() {
|
||||
|
||||
function waitForPaint(func) {
|
||||
paint_waiter.last_paint_count = paint_waiter.getPaintCount();
|
||||
// Ensure the waiter has been reflowed with zero height, so that this will
|
||||
// Ensure the waiter has had a style change, so that this will
|
||||
// change its size and cause a paint.
|
||||
paint_waiter.style.backgroundColor = paint_waiter.style.backgroundColor == "blue" ? "yellow" : "blue";
|
||||
var flush = paint_waiter.offsetHeight;
|
||||
paint_waiter.style.height = "1px";
|
||||
waitForPaintHelper(func);
|
||||
|
@ -25,6 +25,6 @@ load 615450-1.html
|
||||
load 639736-1.xhtml
|
||||
load 643786-1.html
|
||||
load 682650-1.html
|
||||
load 716456-1.html
|
||||
asserts(0-1) load 716456-1.html
|
||||
load 759748.html
|
||||
load 761861.html
|
||||
|
@ -45,7 +45,7 @@ fails-if(Android) != spellcheck-input-property-dynamic-override-inherit.html spe
|
||||
random-if(Android) != spellcheck-textarea-attr.html spellcheck-textarea-ref.html
|
||||
needs-focus == spellcheck-textarea-focused.html spellcheck-textarea-ref.html
|
||||
needs-focus == spellcheck-textarea-focused-reframe.html spellcheck-textarea-ref.html
|
||||
needs-focus == spellcheck-textarea-focused-notreadonly.html spellcheck-textarea-ref.html
|
||||
needs-focus == spellcheck-textarea-focused-notreadonly.html spellcheck-textarea-ref2.html
|
||||
random-if(Android) != spellcheck-textarea-nofocus.html spellcheck-textarea-ref.html
|
||||
random-if(Android) != spellcheck-textarea-disabled.html spellcheck-textarea-ref.html
|
||||
random-if(Android) != spellcheck-textarea-attr-inherit.html spellcheck-textarea-ref.html
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<textarea id="testBox" readonly></textarea>
|
||||
<textarea id="testBox" style="padding:2px;" readonly></textarea>
|
||||
<script type="text/javascript">
|
||||
//Adding focus to the textbox should trigger a spellcheck
|
||||
var textbox = document.getElementById("testBox");
|
||||
|
11
editor/reftests/spellcheck-textarea-ref2.html
Normal file
11
editor/reftests/spellcheck-textarea-ref2.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<textarea spellcheck="true" style="padding:2px;">blahblahblah</textarea>
|
||||
<script type="text/javascript">
|
||||
var box = document.getElementsByTagName("textarea")[0];
|
||||
box.focus(); //Bring the textbox into focus, triggering a spellcheck
|
||||
box.blur(); //Blur in order to make things similar to other tests otherwise
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -55,6 +55,7 @@ function takeReferenceSnapshot() {
|
||||
|
||||
function myOnStopFrame(aRequest, aFrame) {
|
||||
gOnStopFrameCounter++;
|
||||
ok(true, "myOnStopFrame called");
|
||||
let currentSnapshot = snapshotWindow(window, false);
|
||||
if (compareSnapshots(currentSnapshot, gReferenceSnapshot, true)[0]) {
|
||||
// SUCCESS!
|
||||
@ -62,6 +63,7 @@ function myOnStopFrame(aRequest, aFrame) {
|
||||
"at call #" + gOnStopFrameCounter + " to onStopFrame");
|
||||
cleanUpAndFinish();
|
||||
}
|
||||
setTimeout(function() { myOnStopFrame(0, 0); }, 1000);
|
||||
}
|
||||
|
||||
function failTest() {
|
||||
|
@ -59,6 +59,7 @@ _TEST_FILES = \
|
||||
test_bug423523.html \
|
||||
test_bug449781.html \
|
||||
test_bug450930.xhtml \
|
||||
bug450930.xhtml \
|
||||
test_bug458898.html \
|
||||
test_bug465448.xul \
|
||||
test_bug469170.html \
|
||||
@ -353,7 +354,7 @@ endif
|
||||
ifeq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||
# THESE TESTS (BELOW) DO NOT RUN ON MAC
|
||||
_TEST_FILES += \
|
||||
test_flush_on_paint.html \
|
||||
$(warning test_flush_on_paint.html disabled due to random orange; see bug 539356) \
|
||||
$(NULL)
|
||||
# THESE TESTS (ABOVE) DO NOT RUN ON MAC
|
||||
endif
|
||||
|
192
layout/base/tests/bug450930.xhtml
Normal file
192
layout/base/tests/bug450930.xhtml
Normal file
@ -0,0 +1,192 @@
|
||||
<?xml version="1.0"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=450930
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 450930 (MozAfterPaint)</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body onload="runNext()">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=450930">Mozilla Bug 450930</a>
|
||||
<div id="display">
|
||||
<div id="d" style="width:400px; height:200px;"></div>
|
||||
<iframe id="iframe" style="width:400px; height:200px;"
|
||||
src="data:text/html,<div id='d'><span style='margin-left:3px;'>Hello</span>
|
||||
</div><div style='margin-top:500px' id='d2'>
|
||||
<span style='margin-left:3px;'>Goodbye</span></div>"></iframe>
|
||||
<svg:svg style="width:410px; height:210px;" id="svg">
|
||||
<svg:foreignObject width="100%" height="100%">
|
||||
<iframe id="iframe2" style="width:400px; height:200px;"
|
||||
src="data:text/html,<div id='d'><span style='margin-left:3px;'>Hello</span>
|
||||
</div><div style='margin-top:500px' id='d2'>
|
||||
<span style='margin-left:3px;'>Goodbye</span></div>"></iframe>
|
||||
</svg:foreignObject>
|
||||
</svg:svg>
|
||||
</div>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
|
||||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript"><![CDATA[
|
||||
|
||||
function flash(doc, name) {
|
||||
var d = doc.getElementById(name);
|
||||
d.style.backgroundColor = d.style.backgroundColor == "blue" ? "yellow" : "blue";
|
||||
// Now flush out style changes in that document, since our event listeners
|
||||
// seem to assume that things will work that way.
|
||||
d.getBoundingClientRect();
|
||||
}
|
||||
|
||||
function le(v1, v2, s) {
|
||||
window.opener.ok(v1 <= v2, s + " (" + v1 + "," + v2 + ")");
|
||||
}
|
||||
|
||||
function checkContains(r1, r2, s) {
|
||||
le(Math.round(r1.left), Math.round(r2.left), "Left edges out" + s);
|
||||
le(Math.round(r2.right), Math.round(r1.right), "Right edges out" + s);
|
||||
le(Math.round(r1.top), Math.round(r2.top), "Top edges out" + s);
|
||||
le(Math.round(r2.bottom), Math.round(r1.bottom), "Bottom edges out" + s);
|
||||
}
|
||||
|
||||
function isRect(r1, r2) {
|
||||
return (Math.abs(r1.left - r2.left) <= 1 ||
|
||||
Math.abs(r1.right - r2.right) <= 1 ||
|
||||
Math.abs(r1.top - r2.top) <= 1 ||
|
||||
Math.abs(r1.bottom - r2.bottom) <= 1);
|
||||
}
|
||||
|
||||
function isRectInList(r, list) {
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
if (isRect(r, list[i]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function doesRectContain(r1, r2) {
|
||||
return Math.floor(r1.left) <= r2.left && r2.right <= Math.ceil(r1.right) &&
|
||||
Math.floor(r1.top) <= r2.top && r2.bottom <= Math.ceil(r1.bottom);
|
||||
}
|
||||
|
||||
function rectToString(r) {
|
||||
return "(" + r.left + "," + r.top + "," + r.right + "," + r.bottom + ")";
|
||||
}
|
||||
|
||||
function doesRectContainListElement(r, list) {
|
||||
dump("Incoming rect: " + rectToString(r) + "\n");
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
dump("List rect " + i + ": " + rectToString(list[i]));
|
||||
if (doesRectContain(r, list[i])) {
|
||||
dump(" FOUND\n");
|
||||
return true;
|
||||
}
|
||||
dump("\n");
|
||||
}
|
||||
dump("NOT FOUND\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkGotSubdoc(list, container) {
|
||||
var r = container.getBoundingClientRect();
|
||||
return doesRectContainListElement(r, list);
|
||||
}
|
||||
|
||||
function runTest1() {
|
||||
// test basic functionality
|
||||
var iterations = 0;
|
||||
var foundExactRect = false;
|
||||
|
||||
function listener(event) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var r = event.boundingClientRect;
|
||||
var bounds = document.getElementById('d').getBoundingClientRect();
|
||||
checkContains(r, bounds, "");
|
||||
if (isRectInList(bounds, event.clientRects)) {
|
||||
foundExactRect = true;
|
||||
}
|
||||
window.removeEventListener("MozAfterPaint", listener, false);
|
||||
++iterations;
|
||||
if (iterations < 4) {
|
||||
setTimeout(triggerPaint, 100);
|
||||
} else {
|
||||
window.opener.ok(foundExactRect, "Found exact rect");
|
||||
runNext();
|
||||
}
|
||||
}
|
||||
|
||||
function triggerPaint() {
|
||||
window.addEventListener("MozAfterPaint", listener, false);
|
||||
flash(document, 'd');
|
||||
window.opener.ok(true, "trigger test1 paint");
|
||||
}
|
||||
triggerPaint();
|
||||
}
|
||||
|
||||
function runTest2(frameID, containerID) {
|
||||
// test reporting of painting in subdocuments
|
||||
var fired = 0;
|
||||
var gotSubdocPrivileged = false;
|
||||
var gotSubdocNonprivileged = false;
|
||||
var iframe = document.getElementById(frameID);
|
||||
var container = document.getElementById(containerID);
|
||||
|
||||
function listener(event) {
|
||||
if (checkGotSubdoc(event.clientRects, container))
|
||||
gotSubdocNonprivileged = true;
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
if (checkGotSubdoc(event.clientRects, container))
|
||||
gotSubdocPrivileged = true;
|
||||
if (event.clientRects.length > 0) {
|
||||
fired++;
|
||||
if (fired == 1)
|
||||
setTimeout(check, 100);
|
||||
}
|
||||
}
|
||||
|
||||
function check() {
|
||||
window.opener.is(fired, 1, "Wrong event count (" + frameID + ")");
|
||||
window.opener.ok(!gotSubdocNonprivileged, "Got subdoc invalidation while not privileged (" + frameID + ")");
|
||||
window.opener.ok(gotSubdocPrivileged, "Didn't get subdoc invalidation while we were privileged (" + frameID + ")");
|
||||
window.removeEventListener("MozAfterPaint", listener, false);
|
||||
runNext();
|
||||
}
|
||||
|
||||
function triggerPaint() {
|
||||
window.addEventListener("MozAfterPaint", listener, false);
|
||||
document.body.offsetTop;
|
||||
flash(iframe.contentDocument, 'd');
|
||||
}
|
||||
triggerPaint();
|
||||
}
|
||||
|
||||
var test = 0;
|
||||
var tests = [runTest1,
|
||||
function() { runTest2("iframe", "iframe") },
|
||||
function() { runTest2("iframe2", "svg") }];
|
||||
function runNext() {
|
||||
var CI = Components.interfaces;
|
||||
var utils = window.QueryInterface(CI.nsIInterfaceRequestor)
|
||||
.getInterface(CI.nsIDOMWindowUtils);
|
||||
if (utils.isMozAfterPaintPending) {
|
||||
// Wait until there are no pending paints before trying to run tests
|
||||
setTimeout(runNext, 100);
|
||||
return;
|
||||
}
|
||||
if (test < tests.length) {
|
||||
++test;
|
||||
tests[test - 1]();
|
||||
} else {
|
||||
window.opener.finishTests();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
]]></script>
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -46,10 +46,13 @@ _CHROME_FILES = \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_DEBUG
|
||||
# Disabled on Mac because of Bug 748219
|
||||
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
_CHROME_FILES += \
|
||||
test_leaf_layers_partition_browser_window.xul \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
libs:: $(_CHROME_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
|
||||
|
@ -31,7 +31,7 @@ function startTest() {
|
||||
waitForAllPaintsFlushed(function () {
|
||||
// Clear paint state now and scroll again.
|
||||
utils.checkAndClearPaintedState(e);
|
||||
t.scrollTop = 33;
|
||||
t.scrollTop = 15;
|
||||
waitForAllPaintsFlushed(function () {
|
||||
var painted = utils.checkAndClearPaintedState(e);
|
||||
is(painted, false, "Fully-visible scrolled element should not have been painted");
|
||||
|
@ -9,9 +9,9 @@
|
||||
<!-- Need a timeout here to allow paint unsuppression before we start the test -->
|
||||
<body onload="setTimeout(startTest,0)">
|
||||
<div id="t" style="-moz-transform: scale(1.1, 1.1); -moz-transform-origin:top left; width:200px; height:100px; background:yellow; overflow:hidden">
|
||||
<div style="height:40px;">Hello</div>
|
||||
<div id="e" style="height:30px; background:lime">Kitty</div>
|
||||
<div style="height:300px; background:yellow">Kitty</div>
|
||||
<div style="height:40px;"></div>
|
||||
<div id="e" style="height:30px; background:lime"></div>
|
||||
<div style="height:300px; background:yellow"></div>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
@ -31,14 +31,10 @@ function startTest() {
|
||||
waitForAllPaintsFlushed(function () {
|
||||
// Clear paint state now and scroll again.
|
||||
utils.checkAndClearPaintedState(e);
|
||||
t.scrollTop = 33;
|
||||
t.scrollTop = 20;
|
||||
waitForAllPaintsFlushed(function () {
|
||||
var painted = utils.checkAndClearPaintedState(e);
|
||||
if (navigator.platform.indexOf("Mac") >= 0) {
|
||||
todo_is(painted, false, "Fully-visible scrolled element should not have been painted (disabled on Mac, see bug 753497)");
|
||||
} else {
|
||||
is(painted, false, "Fully-visible scrolled element should not have been painted");
|
||||
}
|
||||
is(painted, false, "Fully-visible scrolled element should not have been painted");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
});
|
||||
|
@ -48,6 +48,7 @@ function print_event(event) {
|
||||
function step0(event) {
|
||||
// Wait until we get the MozAfterPaint following the load event
|
||||
// before starting.
|
||||
ok(true, "loaded");
|
||||
window.addEventListener("MozAfterPaint", step1, false);
|
||||
|
||||
// Ensure a MozAfterPaint event is fired
|
||||
|
@ -9,208 +9,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=450930
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=450930">Mozilla Bug 450930</a>
|
||||
<div id="display">
|
||||
<div id="d" style="width:400px; height:200px;"></div>
|
||||
<iframe id="iframe" style="width:400px; height:200px;"
|
||||
src="data:text/html,<div id='d'><span style='margin-left:3px;'>Hello</span>
|
||||
</div><div style='margin-top:500px' id='d2'>
|
||||
<span style='margin-left:3px;'>Goodbye</span></div>"></iframe>
|
||||
<svg:svg style="width:410px; height:210px;" id="svg">
|
||||
<svg:foreignObject width="100%" height="100%">
|
||||
<iframe id="iframe2" style="width:400px; height:200px;"
|
||||
src="data:text/html,<div id='d'><span style='margin-left:3px;'>Hello</span>
|
||||
</div><div style='margin-top:500px' id='d2'>
|
||||
<span style='margin-left:3px;'>Goodbye</span></div>"></iframe>
|
||||
</svg:foreignObject>
|
||||
</svg:svg>
|
||||
</div>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript"><![CDATA[
|
||||
|
||||
/** Test for Bug 450930 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var subwindow = window.open("./bug450930.xhtml", "bug450930", "width=800,height=1000");
|
||||
|
||||
function flash(doc, name) {
|
||||
var d = doc.getElementById(name);
|
||||
d.style.backgroundColor = d.style.backgroundColor == "blue" ? "yellow" : "blue";
|
||||
// Now flush out style changes in that document, since our event listeners
|
||||
// seem to assume that things will work that way.
|
||||
d.getBoundingClientRect();
|
||||
function finishTests() {
|
||||
subwindow.close();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function le(v1, v2, s) {
|
||||
ok(v1 <= v2, s + " (" + v1 + "," + v2 + ")");
|
||||
}
|
||||
|
||||
function checkContains(r1, r2, s) {
|
||||
le(r1.left, r2.left, "Left edges out" + s);
|
||||
le(r2.right, r1.right, "Right edges out" + s);
|
||||
le(r1.top, r2.top, "Top edges out" + s);
|
||||
le(r2.bottom, r1.bottom, "Bottom edges out" + s);
|
||||
}
|
||||
|
||||
function isRect(r1, r2) {
|
||||
return r1.left == r2.left && r1.right == r2.right &&
|
||||
r1.top == r2.top && r1.bottom == r2.bottom;
|
||||
}
|
||||
|
||||
function isRectInList(r, list) {
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
if (isRect(r, list[i]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function doesRectContain(r1, r2) {
|
||||
return r1.left <= r2.left && r2.right <= r1.right &&
|
||||
r1.top <= r2.top && r2.bottom <= r1.bottom;
|
||||
}
|
||||
|
||||
function rectToString(r) {
|
||||
return "(" + r.left + "," + r.top + "," + r.right + "," + r.bottom + ")";
|
||||
}
|
||||
|
||||
function doesRectContainListElement(r, list) {
|
||||
dump("Incoming rect: " + rectToString(r) + "\n");
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
dump("List rect " + i + ": " + rectToString(list[i]));
|
||||
if (doesRectContain(r, list[i])) {
|
||||
dump(" FOUND\n");
|
||||
return true;
|
||||
}
|
||||
dump("\n");
|
||||
}
|
||||
dump("NOT FOUND\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkGotSubdoc(list, container) {
|
||||
var r = container.getBoundingClientRect();
|
||||
return doesRectContainListElement(r, list);
|
||||
}
|
||||
|
||||
function runTest1() {
|
||||
// test basic functionality
|
||||
var iterations = 0;
|
||||
var foundExactRect = false;
|
||||
|
||||
function listener(event) {
|
||||
var r = event.boundingClientRect;
|
||||
var bounds = document.getElementById('d').getBoundingClientRect();
|
||||
checkContains(r, bounds, "");
|
||||
if (isRectInList(bounds, event.clientRects)) {
|
||||
foundExactRect = true;
|
||||
}
|
||||
window.removeEventListener("MozAfterPaint", listener, false);
|
||||
++iterations;
|
||||
if (iterations < 4) {
|
||||
setTimeout(triggerPaint, 100);
|
||||
} else {
|
||||
ok(foundExactRect, "Found exact rect");
|
||||
runNext();
|
||||
}
|
||||
}
|
||||
|
||||
function triggerPaint() {
|
||||
window.addEventListener("MozAfterPaint", listener, false);
|
||||
flash(document, 'd');
|
||||
}
|
||||
triggerPaint();
|
||||
}
|
||||
|
||||
function runTest2(frameID, containerID) {
|
||||
// test reporting of painting in subdocuments
|
||||
var fired = 0;
|
||||
var gotSubdocPrivileged = false;
|
||||
var gotSubdocNonprivileged = false;
|
||||
var iframe = document.getElementById(frameID);
|
||||
var container = document.getElementById(containerID);
|
||||
|
||||
function listener(event) {
|
||||
if (checkGotSubdoc(event.clientRects, container))
|
||||
gotSubdocNonprivileged = true;
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
if (checkGotSubdoc(event.clientRects, container))
|
||||
gotSubdocPrivileged = true;
|
||||
if (++fired == 1)
|
||||
setTimeout(check, 100);
|
||||
}
|
||||
|
||||
function check() {
|
||||
is(fired, 1, "Wrong event count (" + frameID + ")");
|
||||
ok(gotSubdocPrivileged, "Didn't get subdoc invalidation while we were privileged (" + frameID + ")");
|
||||
ok(!gotSubdocNonprivileged, "Got subdoc invalidation while we were not privileged (" + frameID + ")");
|
||||
window.removeEventListener("MozAfterPaint", listener, false);
|
||||
runNext();
|
||||
}
|
||||
|
||||
function triggerPaint() {
|
||||
window.addEventListener("MozAfterPaint", listener, false);
|
||||
document.body.offsetTop;
|
||||
flash(iframe.contentDocument, 'd');
|
||||
// make sure an event fires; since we're not using a chrome event handler, even though we
|
||||
// can get privileges we wouldn't get the event
|
||||
flash(document, 'd');
|
||||
}
|
||||
triggerPaint();
|
||||
}
|
||||
|
||||
function runTest3() {
|
||||
// test reporting of painting of scrolled-out-of-view areas
|
||||
var gotScrolledOutInMainDoc = false;
|
||||
var gotScrolledOutInSubdoc = false;
|
||||
var iframe = document.getElementById("iframe");
|
||||
|
||||
function listener(event) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
if (checkGotSubdoc(event.clientRects, iframe))
|
||||
gotScrolledOutInMainDoc = true;
|
||||
}
|
||||
|
||||
function check() {
|
||||
ok(!gotScrolledOutInMainDoc, "scrolled-out invalidation should not propagate to main doc");
|
||||
window.removeEventListener("MozAfterPaint", listener, false);
|
||||
iframe.contentWindow.removeEventListener("MozAfterPaint", IFRAMEListener, false);
|
||||
runNext();
|
||||
}
|
||||
|
||||
function IFRAMEListener(event) {
|
||||
if (doesRectContainListElement(
|
||||
iframe.contentDocument.getElementById("d2").getBoundingClientRect(), event.clientRects)) {
|
||||
ok(true, "scrolled-out invalidation should notify in subdoc");
|
||||
setTimeout(check, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function triggerPaint() {
|
||||
window.addEventListener("MozAfterPaint", listener, false);
|
||||
iframe.contentWindow.addEventListener("MozAfterPaint", IFRAMEListener, false);
|
||||
flash(iframe.contentDocument, 'd2');
|
||||
}
|
||||
triggerPaint();
|
||||
}
|
||||
|
||||
var test = 0;
|
||||
var tests = [runTest1,
|
||||
function() { runTest2("iframe", "iframe") },
|
||||
function() { runTest2("iframe2", "svg") },
|
||||
runTest3];
|
||||
function runNext() {
|
||||
if (test < tests.length) {
|
||||
++test;
|
||||
tests[test - 1]();
|
||||
} else {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
window.onload = runNext();
|
||||
]]></script>
|
||||
</pre>
|
||||
</body>
|
||||
|
@ -14,7 +14,7 @@ load 310556-1.xhtml
|
||||
load 322780-1.xul
|
||||
load 323381-1.html
|
||||
load 323381-2.html
|
||||
asserts(2) asserts-if(gtk2Widget,17) load 323386-1.html # Bug 575011
|
||||
asserts(2) asserts-if(gtk2Widget,17-18) load 323386-1.html # Bug 575011
|
||||
load 323389-1.html
|
||||
load 323389-2.html
|
||||
load 323493-1.html
|
||||
@ -259,8 +259,8 @@ load 465651-1.html
|
||||
load 467137-1.html
|
||||
load 467213-1.html
|
||||
load 467487-1.html
|
||||
asserts(5-7) load 467493-1.html
|
||||
asserts(4-6) load 467493-2.html
|
||||
asserts(6-9) load 467493-1.html
|
||||
asserts(4-8) load 467493-2.html
|
||||
load 467875-1.xhtml
|
||||
load 467914-1.html
|
||||
load 468207-1.html
|
||||
@ -322,7 +322,7 @@ load 536692-1.xhtml
|
||||
load 541277-1.html
|
||||
load 541277-2.html
|
||||
asserts(3) load 541714-1.html
|
||||
asserts(3-7) load 541714-2.html
|
||||
asserts(3-8) load 541714-2.html
|
||||
load 542136-1.html
|
||||
load 545571-1.html
|
||||
load 547338.xul
|
||||
|
@ -16,8 +16,8 @@ random-if(cocoaWidget) == bidi-006-j.html bidi-006-ref.html # bug 734313
|
||||
== bidiSVG-04.svg bidiSVG-04-ref.svg
|
||||
== bidiSVG-05.svg bidiSVG-05-ref.svg
|
||||
== bidiMirroring.svg bidiMirroring-ref.svg
|
||||
random-if(layersGPUAccelerated) == visualmarquee.html marquee-ref.html
|
||||
random-if(layersGPUAccelerated) == logicalmarquee.html marquee-ref.html
|
||||
fuzzy-if(Android,9,134) random-if(layersGPUAccelerated) == visualmarquee.html marquee-ref.html
|
||||
fuzzy-if(Android,9,134) random-if(layersGPUAccelerated) == logicalmarquee.html marquee-ref.html
|
||||
== visualmarquee.html logicalmarquee.html
|
||||
# test for glyph mirroring in right-to-left text
|
||||
== mirroring-01.html mirroring-01-ref.html
|
||||
@ -93,7 +93,7 @@ random-if(winWidget) == 305643-1.html 305643-1-ref.html # depends on windows ver
|
||||
== 613149-1a.html 613149-1-ref.html
|
||||
== 613149-1b.html 613149-1-ref.html
|
||||
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == 613149-2a.html 613149-2-ref.html # bug 696672
|
||||
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == 613149-2b.html 613149-2-ref.html # bug 696672
|
||||
fuzzy-if(Android,24,1) fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == 613149-2b.html 613149-2-ref.html # bug 696672
|
||||
== 613157-1.html 613157-1-ref.html
|
||||
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == 613157-2.html 613157-2-ref.html # bug 696673
|
||||
== 662288-1.html 662288-1-ref.html
|
||||
|
@ -1316,7 +1316,7 @@ fails-if(Android) random-if(winWidget) fails-if(gtk2Widget) == 481948-3.html 481
|
||||
== 482398-1.html 482398-1-ref.html
|
||||
random-if(d2d) == 482592-1a.xhtml 482592-1-ref.html # bug 586771
|
||||
random-if(d2d) == 482592-1b.xhtml 482592-1-ref.html # bug 586771
|
||||
== 482659-1a.html 482659-1-ref.html
|
||||
random-if(winWidget) == 482659-1a.html 482659-1-ref.html
|
||||
== 482659-1b.html 482659-1-ref.html
|
||||
== 482659-1c.html 482659-1-ref.html
|
||||
== 482659-1d.html 482659-1-ref.html
|
||||
@ -1568,7 +1568,7 @@ fails-if(Android) random-if(layersGPUAccelerated) fails-if(/^Windows\x20NT\x205\
|
||||
== 582037-1b.html 582037-1-ref.html
|
||||
== 582037-2a.html 582037-2-ref.html
|
||||
== 582037-2b.html 582037-2-ref.html
|
||||
asserts(0-11) == 582146-1.html about:blank
|
||||
asserts(0-12) == 582146-1.html about:blank
|
||||
== 582476-1.svg 582476-1-ref.svg
|
||||
== 584400-dash-length.svg 584400-dash-length-ref.svg
|
||||
== 584699-1.html 584699-1-ref.html
|
||||
|
@ -50,8 +50,8 @@ test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineTh
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-2.html select-combobox-2-ref.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) != select-combobox-2.html select-combobox-2.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-3.html select-combobox-3-ref.html
|
||||
asserts-if(gtk2Widget,0-2) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) != input-checkbox.html input-checkbox.html
|
||||
asserts-if(gtk2Widget,0-2) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) != input-radio.html input-radio.html
|
||||
asserts-if(gtk2Widget,0-4) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) != input-checkbox.html input-checkbox.html
|
||||
asserts-if(gtk2Widget,0-4) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) != input-radio.html input-radio.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile.html disable-fontinfl-on-mobile-ref.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-2.html disable-fontinfl-on-mobile-ref.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-3.html disable-fontinfl-on-mobile-ref.html
|
||||
|
@ -17,7 +17,7 @@ needs-focus == placeholder-10.html placeholder-visible-ref.html
|
||||
== placeholder-13.html placeholder-visible-ref.html
|
||||
== placeholder-14.html placeholder-visible-ref.html
|
||||
== placeholder-18.html placeholder-overridden-ref.html
|
||||
== placeholder-19.xul placeholder-overridden-ref.xul
|
||||
random-if(winWidget) == placeholder-19.xul placeholder-overridden-ref.xul
|
||||
needs-focus == placeholder-20.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-21.html placeholder-blank-ref.html
|
||||
needs-focus == placeholder-22.html placeholder-blank-ref.html
|
||||
|
@ -1,2 +1,2 @@
|
||||
== move-to-background-1.html move-to-background-1-ref.html
|
||||
random-if(Android&&!browserIsRemote) == component-alpha-exit-1.html component-alpha-exit-1-ref.html # bug 760275
|
||||
fuzzy-if(cocoaWidget,2,6) random-if(Android&&!browserIsRemote) == component-alpha-exit-1.html component-alpha-exit-1-ref.html # bug 760275
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html class="reftest-wait">
|
||||
<body style="border:10px solid pink;">
|
||||
<script>
|
||||
function doTest() {
|
||||
function doTest() {
|
||||
document.body.style.border = "";
|
||||
document.documentElement.removeAttribute('class');
|
||||
}
|
||||
|
@ -2,6 +2,6 @@
|
||||
<html>
|
||||
<body style="height:2000px; overflow:hidden; background:url(repeatable-diagonal-gradient.png) fixed;">
|
||||
<script src="scrolling.js"></script>
|
||||
<p>Hello Kitty
|
||||
<p style="padding:2px;">Hello Kitty</p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -153,10 +153,10 @@ fails-if(Android) == filter-extref-differentOrigin-01.svg pass.svg # Bug 695385
|
||||
== foreignObject-fixedpos-01.html foreignObject-dynamic-abspos-01-ref.html
|
||||
== foreignObject-dynamic-fixedpos-01.html foreignObject-dynamic-abspos-01-ref.html
|
||||
== getElementById-a-element-01.svg pass.svg
|
||||
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == gradient-live-01a.svg gradient-live-01-ref.svg # bug 696674
|
||||
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == gradient-live-01b.svg gradient-live-01-ref.svg # bug 696674
|
||||
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == gradient-live-01c.svg gradient-live-01-ref.svg # bug 696674
|
||||
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == gradient-live-01d.svg gradient-live-01-ref.svg # bug 696674
|
||||
== gradient-live-01a.svg gradient-live-01-ref.svg
|
||||
== gradient-live-01b.svg gradient-live-01-ref.svg
|
||||
== gradient-live-01c.svg gradient-live-01-ref.svg
|
||||
== gradient-live-01d.svg gradient-live-01-ref.svg
|
||||
fails == inline-in-xul-basic-01.xul pass.svg
|
||||
== invalid-text-01.svg pass.svg
|
||||
== lang-attribute-01.svg pass.svg
|
||||
|
@ -9,4 +9,4 @@
|
||||
== sort-startSame-1b.svg sort-startSame-1-ref.svg
|
||||
== sort-startSame-2a.svg sort-startSame-2-ref.svg
|
||||
== sort-startSame-2b.svg sort-startSame-2-ref.svg
|
||||
random-if(Android) == sort-additive-1.svg sort-additive-1-ref.svg # bug 547801
|
||||
random == sort-additive-1.svg sort-additive-1-ref.svg # bug 547801
|
||||
|
@ -2,14 +2,14 @@
|
||||
# element.
|
||||
|
||||
== additive-1.svg additive-1-ref.svg
|
||||
== paced-1.svg paced-1-ref.svg
|
||||
fuzzy-if(cocoaWidget&&layersGPUAccelerated,1,18) == paced-1.svg paced-1-ref.svg
|
||||
== rotate-angle-1.svg rotate-angle-ref.svg
|
||||
== rotate-angle-2.svg rotate-angle-ref.svg
|
||||
== rotate-angle-3.svg rotate-angle-ref.svg
|
||||
== rotate-angle-4.svg rotate-angle-ref.svg
|
||||
fuzzy-if(Android,16,2) == rotate-angle-4.svg rotate-angle-ref.svg
|
||||
== rotate-angle-5.svg rotate-angle-ref.svg
|
||||
== scale-1.svg scale-1-ref.svg
|
||||
== skew-1.svg skew-1-ref.svg
|
||||
fuzzy-if(cocoaWidget&&layersGPUAccelerated,1,45) == skew-1.svg skew-1-ref.svg
|
||||
random-if(Android&&!browserIsRemote) == translate-clipPath-1.svg lime.svg # bug 760266
|
||||
fails-if(/Mac\x20OS\x20X\x2010\.[56]/.test(http.oscpu)) == translate-gradient-1.svg lime.svg
|
||||
== translate-pattern-1.svg lime.svg
|
||||
|
@ -48,7 +48,7 @@ skip-if(!(d2d||cocoaWidget)) random-if(d2d) != subpixel-glyphs-x-2a.html subpixe
|
||||
HTTP(..) == subpixel-glyphs-x-3a.html subpixel-glyphs-x-3b.html
|
||||
# No platforms do subpixel positioning vertically
|
||||
== subpixel-glyphs-y-1a.html subpixel-glyphs-y-1b.html
|
||||
== subpixel-lineheight-1a.html subpixel-lineheight-1b.html
|
||||
fuzzy-if(Android,9,61) == subpixel-lineheight-1a.html subpixel-lineheight-1b.html
|
||||
== swash-1.html swash-1-ref.html
|
||||
HTTP(..) != synthetic-bold-metrics-01.html synthetic-bold-metrics-01-notref.html
|
||||
== synthetic-bold-papyrus-01.html synthetic-bold-papyrus-01-ref.html
|
||||
|
@ -783,6 +783,7 @@ function SendUpdateCanvasForEvent(event)
|
||||
|
||||
var rects = [ ];
|
||||
var rectList = event.clientRects;
|
||||
LogInfo("SendUpdateCanvasForEvent with " + rectList.length + " rects");
|
||||
for (var i = 0; i < rectList.length; ++i) {
|
||||
var r = rectList[i];
|
||||
// Set left/top/right/bottom to "device pixel" boundaries
|
||||
@ -790,6 +791,7 @@ function SendUpdateCanvasForEvent(event)
|
||||
var top = Math.floor(roundTo(r.top*scale, 0.001));
|
||||
var right = Math.ceil(roundTo(r.right*scale, 0.001));
|
||||
var bottom = Math.ceil(roundTo(r.bottom*scale, 0.001));
|
||||
LogInfo("Rect: " + left + " " + top + " " + right + " " + bottom);
|
||||
|
||||
rects.push({ left: left, top: top, right: right, bottom: bottom });
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ function InitAndStartRefTests()
|
||||
} catch(e) {
|
||||
gRemote = false;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
gIgnoreWindowSize = prefs.getBoolPref("reftest.ignoreWindowSize");
|
||||
} catch(e) {
|
||||
|
@ -193,14 +193,18 @@ var tests = [
|
||||
result: function(testname, panel) {
|
||||
var panelrect = panel.getBoundingClientRect();
|
||||
ok(panelrect.left >= 200 - mozInnerScreenX, testname + "left");
|
||||
ok(panelrect.top >= 210 - mozInnerScreenY + 10, testname + "top greater");
|
||||
if (navigator.platform.indexOf("Linux") < 0) {
|
||||
ok(panelrect.top >= 210 - mozInnerScreenY + 10, testname + "top greater");
|
||||
}
|
||||
ok(panelrect.top <= 210 - mozInnerScreenY + 30, testname + "top less");
|
||||
is(panelrect.width, 120, testname + "width");
|
||||
is(panelrect.height, 40, testname + "height");
|
||||
|
||||
var screenRect = panel.getOuterScreenRect();
|
||||
is(screenRect.left, 200, testname + " screen left");
|
||||
is(screenRect.top, 210, testname + " screen top");
|
||||
if (navigator.platform.indexOf("Linux") < 0) {
|
||||
is(screenRect.left, 200, testname + " screen left");
|
||||
is(screenRect.top, 210, testname + " screen top");
|
||||
}
|
||||
ok(screenRect.width >= 120 && screenRect.width <= 140, testname + " screen width");
|
||||
ok(screenRect.height >= 40 && screenRect.height <= 80, testname + " screen height");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user