2012-08-20 04:02:42 +04:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html id="html" style="height:100%">
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=780847
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test radii for mouse events</title>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
<style>
|
|
|
|
.target { position:absolute; left:100px; top:100px; width:100px; height:100px; background:blue; }
|
|
|
|
</style>
|
|
|
|
</head>
|
2014-01-29 17:54:25 +04:00
|
|
|
<body id="body" onload="setTimeout(startTest, 0)" style="margin:0; width:100%; height:100%; overflow:hidden">
|
2012-08-20 04:02:42 +04:00
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content">
|
2017-04-10 22:53:29 +03:00
|
|
|
<!-- XXX Though B2G isn't supported anymore, we probably want to keep this
|
|
|
|
test's B2G special-cases around, and just make them apply to Android.
|
|
|
|
(We may need to do so, for this test to be runnable on Android...?)
|
|
|
|
See bug 1355206 for more.
|
|
|
|
-->
|
2016-01-06 07:08:07 +03:00
|
|
|
<!-- the iframe holding this test is only 300px tall on B2G, so we need to
|
|
|
|
make the t target shorter than normal to test the bottom edge fluffing
|
|
|
|
-->
|
|
|
|
<div class="target" style="height:80px" id="t" onmousedown="x=1"></div>
|
2012-08-20 04:02:42 +04:00
|
|
|
|
|
|
|
<div class="target" id="t2" hidden></div>
|
|
|
|
|
|
|
|
<input class="target" id="t3_1" hidden></input>
|
|
|
|
<a href="#" class="target" id="t3_2" hidden></a>
|
|
|
|
<label class="target" id="t3_3" hidden></label>
|
|
|
|
<button class="target" id="t3_4" hidden></button>
|
|
|
|
<select class="target" id="t3_5" hidden></select>
|
|
|
|
<textarea class="target" id="t3_6" hidden></textarea>
|
|
|
|
<div role="button" class="target" id="t3_7" hidden></div>
|
2014-02-26 18:03:32 +04:00
|
|
|
<div role="key" class="target" id="t3_8" hidden></div>
|
|
|
|
<img class="target" id="t3_9" hidden></img>
|
2012-08-20 04:02:42 +04:00
|
|
|
|
|
|
|
<div class="target" style="transform:translate(-80px,0);" id="t4" onmousedown="x=1" hidden></div>
|
|
|
|
|
|
|
|
<div class="target" style="left:0; z-index:1" id="t5_left" onmousedown="x=1" hidden></div>
|
|
|
|
<div class="target" style="left:106px;" id="t5_right" onmousedown="x=1" hidden></div>
|
|
|
|
<div class="target" style="left:0; top:210px;" id="t5_below" onmousedown="x=1" hidden></div>
|
|
|
|
|
2016-01-06 07:08:07 +03:00
|
|
|
<div class="target" id="t6" onmousedown="x=1" style="width: 300px" hidden>
|
Bug 1181763 - Allow the target fluffing code to fluff even when directly hitting something clickable. r=roc
There is a common pattern on the web where a click listener is registered on a
container element high up in the DOM tree, and based on the target of the click
events, it performs the appropriate action. In such cases, our existing fluffing
code was not getting activated anywhere inside the container, because the entire
container was considered clickable. However, this is not user-friendly because
often the actual targets inside the container are small and hard to hit. Also,
the fluffing code will often take the container element itself as the target,
even if the user actually hit something inside the container.
This patch changes this behaviour so when an event hits inside a clickable
container, fluffing still occurs, but is restricted to DOM descendants of the
container. This allows fluffing to work in the above scenarios, and since the
events will bubble up to the container, the listeners on the container are
guaranteed to still trigger.
2015-07-17 15:36:00 +03:00
|
|
|
<div id="t6_inner" style="position:absolute; left:-40px; top:20px; width:60px; height:60px; background:yellow;"></div>
|
2015-08-15 18:15:29 +03:00
|
|
|
<div id="t6_inner_clickable" style="position:absolute; left:-40px; top: 80px; width: 60px; height: 5px; background:red" onmousedown="x=1"></div>
|
2012-08-20 04:02:42 +04:00
|
|
|
</div>
|
2016-01-06 07:08:07 +03:00
|
|
|
<div id="t6_outer" style="position:absolute; left:360px; top:120px; width:60px; height:60px; background:green;" onmousedown="x=1" hidden></div>
|
2013-08-03 20:01:49 +04:00
|
|
|
|
|
|
|
<div class="target" id="t7" onmousedown="x=1" hidden></div>
|
|
|
|
<div class="target" id="t7_over" hidden></div>
|
|
|
|
|
2013-08-06 14:33:29 +04:00
|
|
|
<div id="t8" contenteditable="true" class="target" hidden></div>
|
|
|
|
|
2013-10-17 22:42:48 +04:00
|
|
|
<div id="t9" class="target" ontouchend="x=1" hidden></div>
|
|
|
|
|
2014-01-29 17:54:25 +04:00
|
|
|
<div id="t10_left" class="target" style="left:-50px;" onmousedown="x=1" hidden></div>
|
|
|
|
<div id="t10_right" class="target" style="left:auto;right:-50px" onmousedown="x=1" hidden></div>
|
|
|
|
<div id="t10_top" class="target" style="top:-50px;" onmousedown="x=1" hidden></div>
|
|
|
|
<div id="t10_bottom" class="target" style="top:auto;bottom:-50px;" onmousedown="x=1" hidden></div>
|
|
|
|
<div id="t10_over" style="position:absolute; left:0; top:0; width:100%; height:100%; background:yellow;" hidden></div>
|
2012-08-20 04:02:42 +04:00
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript">
|
2013-09-11 15:52:42 +04:00
|
|
|
function startTest() {
|
|
|
|
SpecialPowers.pushPrefEnv({"set": [["ui.mouse.radius.enabled", true],
|
|
|
|
["ui.mouse.radius.inputSource.touchOnly", false],
|
|
|
|
["ui.mouse.radius.leftmm", 12],
|
|
|
|
["ui.mouse.radius.topmm", 8],
|
|
|
|
["ui.mouse.radius.rightmm", 4],
|
|
|
|
["ui.mouse.radius.bottommm", 4],
|
|
|
|
["ui.mouse.radius.visitedweight", 50]]}, runTest);
|
|
|
|
}
|
2012-08-20 04:02:42 +04:00
|
|
|
|
|
|
|
|
2013-09-11 15:52:42 +04:00
|
|
|
SimpleTest.waitForExplicitFinish();
|
2012-08-20 04:02:42 +04:00
|
|
|
|
|
|
|
function endTest() {
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
var eventTarget;
|
|
|
|
window.onmousedown = function(event) { eventTarget = event.target; };
|
|
|
|
|
2013-01-24 18:53:18 +04:00
|
|
|
function testMouseClick(idPosition, dx, dy, idTarget, msg, options) {
|
2012-08-20 04:02:42 +04:00
|
|
|
eventTarget = null;
|
2013-01-24 18:53:18 +04:00
|
|
|
synthesizeMouse(document.getElementById(idPosition), dx, dy, options || {});
|
2012-08-20 04:02:42 +04:00
|
|
|
try {
|
|
|
|
is(eventTarget.id, idTarget,
|
|
|
|
"checking '" + idPosition + "' offset " + dx + "," + dy + " [" + msg + "]");
|
|
|
|
} catch (ex) {
|
|
|
|
ok(false, "checking '" + idPosition + "' offset " + dx + "," + dy + " [" + msg + "]; got " + eventTarget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function setShowing(id, show) {
|
|
|
|
var e = document.getElementById(id);
|
|
|
|
e.hidden = !show;
|
|
|
|
}
|
|
|
|
|
2013-09-11 15:52:42 +04:00
|
|
|
var mm;
|
2012-08-20 04:02:42 +04:00
|
|
|
function runTest() {
|
2016-01-06 07:08:07 +03:00
|
|
|
let resolution = 1;
|
|
|
|
if (SpecialPowers.Services.appinfo.name == "B2G") {
|
|
|
|
// This test runs on B2G as well, zoomed out. Therefore we need to account
|
|
|
|
// for the resolution as well, because the fluff area is relative to screen
|
|
|
|
// pixels rather than CSS pixels.
|
|
|
|
let out = {};
|
|
|
|
SpecialPowers.getDOMWindowUtils(window.top).getResolution(out);
|
|
|
|
resolution = 1.0 / out.value;
|
|
|
|
}
|
2017-11-12 17:56:12 +03:00
|
|
|
mm = SpecialPowers.getDOMWindowUtils(window.top).physicalMillimeterInCSSPixels * resolution;
|
2013-09-11 15:52:42 +04:00
|
|
|
ok(4*mm >= 10, "WARNING: mm " + mm + " too small in this configuration. Test results will be bogus");
|
|
|
|
|
2012-08-20 04:02:42 +04:00
|
|
|
// Test basic functionality: clicks sufficiently close to the element
|
|
|
|
// should be allowed to hit the element. We test points just inside and
|
|
|
|
// just outside the edges we set up in the prefs.
|
|
|
|
testMouseClick("t", 100 + 13*mm, 10, "body", "basic functionality");
|
|
|
|
testMouseClick("t", 100 + 11*mm, 10, "t", "basic functionality");
|
2016-01-06 07:08:07 +03:00
|
|
|
testMouseClick("t", 10, 80 + 9*mm, "body", "basic functionality");
|
|
|
|
testMouseClick("t", 10, 80 + 7*mm, "t", "basic functionality");
|
2012-08-20 04:02:42 +04:00
|
|
|
testMouseClick("t", -5*mm, 10, "body", "basic functionality");
|
|
|
|
testMouseClick("t", -3*mm, 10, "t", "basic functionality");
|
|
|
|
testMouseClick("t", 10, -5*mm, "body", "basic functionality");
|
|
|
|
testMouseClick("t", 10, -3*mm, "t", "basic functionality");
|
2013-01-24 18:53:18 +04:00
|
|
|
|
|
|
|
// When inputSource.touchOnly is true, mouse input is not retargeted.
|
2013-09-11 15:52:42 +04:00
|
|
|
SpecialPowers.pushPrefEnv({"set": [["ui.mouse.radius.inputSource.touchOnly", true]]}, test2);
|
|
|
|
}
|
|
|
|
|
|
|
|
function test2() {
|
2013-01-24 18:53:18 +04:00
|
|
|
testMouseClick("t", 100 + 11*mm, 10, "body", "disabled for mouse input");
|
|
|
|
testMouseClick("t", 100 + 11*mm, 10, "t", "enabled for touch input", {
|
2018-03-20 07:16:06 +03:00
|
|
|
inputSource: MouseEvent.MOZ_SOURCE_TOUCH
|
2013-01-24 18:53:18 +04:00
|
|
|
});
|
|
|
|
testMouseClick("t", 100 + 13*mm, 10, "body", "basic functionality for touch", {
|
2018-03-20 07:16:06 +03:00
|
|
|
inputSource: MouseEvent.MOZ_SOURCE_TOUCH
|
2013-01-24 18:53:18 +04:00
|
|
|
});
|
2013-09-11 15:52:42 +04:00
|
|
|
SpecialPowers.pushPrefEnv({"set": [["ui.mouse.radius.inputSource.touchOnly", false]]}, test3);
|
|
|
|
}
|
2013-01-24 18:53:18 +04:00
|
|
|
|
2013-09-11 15:52:42 +04:00
|
|
|
function test3() {
|
2012-08-20 04:02:42 +04:00
|
|
|
setShowing("t", false);
|
|
|
|
|
|
|
|
// Now test the criteria we use to determine which elements are hittable
|
|
|
|
// this way.
|
|
|
|
|
|
|
|
setShowing("t2", true);
|
|
|
|
var t2 = document.getElementById("t2");
|
|
|
|
// Unadorned DIVs are not click radius targets
|
|
|
|
testMouseClick("t2", 100 + 11*mm, 10, "body", "unadorned DIV");
|
|
|
|
// DIVs with the right event handlers are click radius targets
|
|
|
|
t2.onmousedown = function() {};
|
|
|
|
testMouseClick("t2", 100 + 11*mm, 10, "t2", "DIV with onmousedown");
|
|
|
|
t2.onmousedown = null;
|
|
|
|
testMouseClick("t2", 100 + 11*mm, 10, "body", "DIV with onmousedown removed");
|
|
|
|
t2.onmouseup = function() {};
|
|
|
|
testMouseClick("t2", 100 + 11*mm, 10, "t2", "DIV with onmouseup");
|
|
|
|
t2.onmouseup = null;
|
|
|
|
t2.onclick = function() {};
|
|
|
|
testMouseClick("t2", 100 + 11*mm, 10, "t2", "DIV with onclick");
|
|
|
|
t2.onclick = null;
|
|
|
|
// Keypresses don't make click radius targets
|
|
|
|
t2.onkeypress = function() {};
|
|
|
|
testMouseClick("t2", 100 + 11*mm, 10, "body", "DIV with onkeypress");
|
|
|
|
t2.onkeypress = null;
|
|
|
|
setShowing("t2", false);
|
|
|
|
|
|
|
|
// Now check that certain elements are click radius targets and others are not
|
2014-02-26 18:03:32 +04:00
|
|
|
for (var i = 1; i <= 9; ++i) {
|
2012-08-20 04:02:42 +04:00
|
|
|
var id = "t3_" + i;
|
2014-02-26 18:03:32 +04:00
|
|
|
var shouldHit = i <= 8;
|
2012-08-20 04:02:42 +04:00
|
|
|
setShowing(id, true);
|
|
|
|
testMouseClick(id, 100 + 11*mm, 10, shouldHit ? id : "body",
|
|
|
|
"<" + document.getElementById(id).tagName + "> element");
|
|
|
|
setShowing(id, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check that our targeting computations take into account the effects of
|
|
|
|
// CSS transforms
|
|
|
|
setShowing("t4", true);
|
|
|
|
testMouseClick("t4", -1, 10, "t4", "translated DIV");
|
|
|
|
setShowing("t4", false);
|
|
|
|
|
|
|
|
// Test the prioritization of multiple targets based on distance to
|
|
|
|
// the target.
|
|
|
|
setShowing("t5_left", true);
|
|
|
|
setShowing("t5_right", true);
|
|
|
|
setShowing("t5_below", true);
|
|
|
|
testMouseClick("t5_left", 102, 10, "t5_left", "closest DIV is left");
|
|
|
|
testMouseClick("t5_left", 102.5, 10, "t5_left",
|
|
|
|
"closest DIV to midpoint is left because of its higher z-index");
|
|
|
|
testMouseClick("t5_left", 104, 10, "t5_right", "closest DIV is right");
|
|
|
|
testMouseClick("t5_left", 10, 104, "t5_left", "closest DIV is left");
|
|
|
|
testMouseClick("t5_left", 10, 105, "t5_left",
|
|
|
|
"closest DIV to midpoint is left because of its higher z-index");
|
|
|
|
testMouseClick("t5_left", 10, 106, "t5_below", "closest DIV is below");
|
|
|
|
setShowing("t5_left", false);
|
|
|
|
setShowing("t5_right", false);
|
|
|
|
setShowing("t5_below", false);
|
|
|
|
|
|
|
|
// Test behavior of nested elements.
|
|
|
|
// The following behaviors are questionable and may need to be changed.
|
|
|
|
setShowing("t6", true);
|
Bug 1181763 - Allow the target fluffing code to fluff even when directly hitting something clickable. r=roc
There is a common pattern on the web where a click listener is registered on a
container element high up in the DOM tree, and based on the target of the click
events, it performs the appropriate action. In such cases, our existing fluffing
code was not getting activated anywhere inside the container, because the entire
container was considered clickable. However, this is not user-friendly because
often the actual targets inside the container are small and hard to hit. Also,
the fluffing code will often take the container element itself as the target,
even if the user actually hit something inside the container.
This patch changes this behaviour so when an event hits inside a clickable
container, fluffing still occurs, but is restricted to DOM descendants of the
container. This allows fluffing to work in the above scenarios, and since the
events will bubble up to the container, the listeners on the container are
guaranteed to still trigger.
2015-07-17 15:36:00 +03:00
|
|
|
setShowing("t6_outer", true);
|
2012-08-20 04:02:42 +04:00
|
|
|
testMouseClick("t6_inner", -1, 10, "t6_inner",
|
|
|
|
"inner element is clickable because its parent is, even when it sticks outside parent");
|
Bug 1181763 - Allow the target fluffing code to fluff even when directly hitting something clickable. r=roc
There is a common pattern on the web where a click listener is registered on a
container element high up in the DOM tree, and based on the target of the click
events, it performs the appropriate action. In such cases, our existing fluffing
code was not getting activated anywhere inside the container, because the entire
container was considered clickable. However, this is not user-friendly because
often the actual targets inside the container are small and hard to hit. Also,
the fluffing code will often take the container element itself as the target,
even if the user actually hit something inside the container.
This patch changes this behaviour so when an event hits inside a clickable
container, fluffing still occurs, but is restricted to DOM descendants of the
container. This allows fluffing to work in the above scenarios, and since the
events will bubble up to the container, the listeners on the container are
guaranteed to still trigger.
2015-07-17 15:36:00 +03:00
|
|
|
testMouseClick("t6_inner", 39, -1, "t6_inner",
|
2012-08-20 04:02:42 +04:00
|
|
|
"when outside both inner and parent, but in range of both, the inner is selected");
|
Bug 1181763 - Allow the target fluffing code to fluff even when directly hitting something clickable. r=roc
There is a common pattern on the web where a click listener is registered on a
container element high up in the DOM tree, and based on the target of the click
events, it performs the appropriate action. In such cases, our existing fluffing
code was not getting activated anywhere inside the container, because the entire
container was considered clickable. However, this is not user-friendly because
often the actual targets inside the container are small and hard to hit. Also,
the fluffing code will often take the container element itself as the target,
even if the user actually hit something inside the container.
This patch changes this behaviour so when an event hits inside a clickable
container, fluffing still occurs, but is restricted to DOM descendants of the
container. This allows fluffing to work in the above scenarios, and since the
events will bubble up to the container, the listeners on the container are
guaranteed to still trigger.
2015-07-17 15:36:00 +03:00
|
|
|
testMouseClick("t6_inner", 45, -1, "t6_inner",
|
|
|
|
"clicking in clickable parent close to inner activates inner, not parent");
|
2015-08-15 18:15:29 +03:00
|
|
|
testMouseClick("t6_inner_clickable", 1, -1, "t6_inner",
|
|
|
|
"clicking on inner doesn't get redirected to inner_clickable because they are both clickable");
|
|
|
|
testMouseClick("t6_inner_clickable", 1, 1, "t6_inner_clickable",
|
|
|
|
"clicking on inner_clickable doesn't get redirected to inner because they are both clickable");
|
|
|
|
testMouseClick("t6_inner_clickable", 45, -1, "t6_inner",
|
|
|
|
"clicking on inner while backed by its parent still doesn't get redirected to inner_clickable");
|
|
|
|
testMouseClick("t6_inner_clickable", 45, 1, "t6_inner_clickable",
|
|
|
|
"clicking on inner_clickable while backed by its parent still doesn't get redirected to inner");
|
|
|
|
testMouseClick("t6_inner_clickable", 45, 6, "t6_inner_clickable",
|
|
|
|
"clicking on parent near inner_clickable gets redirected to inner_clickable rather than inner because it is closer");
|
2016-01-06 07:08:07 +03:00
|
|
|
// 280 is the distance from t6_inner's right edge to t6's right edge
|
|
|
|
// 240 is the distance from t6_inner's right edge to t6_outer's right edge.
|
|
|
|
// we want to click on t6, but at least 13mm away from t6_inner, so that
|
|
|
|
// t6_inner doesn't steal the click.
|
|
|
|
ok(13*mm < 280, "no point inside t6 that's not within radius of t6_inner; adjust layout of t6/inner/outer as needed");
|
|
|
|
testMouseClick("t6_outer", -240 + 13*mm, -1, "t6",
|
Bug 1181763 - Allow the target fluffing code to fluff even when directly hitting something clickable. r=roc
There is a common pattern on the web where a click listener is registered on a
container element high up in the DOM tree, and based on the target of the click
events, it performs the appropriate action. In such cases, our existing fluffing
code was not getting activated anywhere inside the container, because the entire
container was considered clickable. However, this is not user-friendly because
often the actual targets inside the container are small and hard to hit. Also,
the fluffing code will often take the container element itself as the target,
even if the user actually hit something inside the container.
This patch changes this behaviour so when an event hits inside a clickable
container, fluffing still occurs, but is restricted to DOM descendants of the
container. This allows fluffing to work in the above scenarios, and since the
events will bubble up to the container, the listeners on the container are
guaranteed to still trigger.
2015-07-17 15:36:00 +03:00
|
|
|
"clicking in clickable container close to outer activates parent, not outer");
|
|
|
|
testMouseClick("t6_outer", 1, 1, "t6_outer",
|
|
|
|
"clicking directly on the outer activates it");
|
2012-08-20 04:02:42 +04:00
|
|
|
setShowing("t6", false);
|
Bug 1181763 - Allow the target fluffing code to fluff even when directly hitting something clickable. r=roc
There is a common pattern on the web where a click listener is registered on a
container element high up in the DOM tree, and based on the target of the click
events, it performs the appropriate action. In such cases, our existing fluffing
code was not getting activated anywhere inside the container, because the entire
container was considered clickable. However, this is not user-friendly because
often the actual targets inside the container are small and hard to hit. Also,
the fluffing code will often take the container element itself as the target,
even if the user actually hit something inside the container.
This patch changes this behaviour so when an event hits inside a clickable
container, fluffing still occurs, but is restricted to DOM descendants of the
container. This allows fluffing to work in the above scenarios, and since the
events will bubble up to the container, the listeners on the container are
guaranteed to still trigger.
2015-07-17 15:36:00 +03:00
|
|
|
setShowing("t6_outer", false);
|
2012-08-20 04:02:42 +04:00
|
|
|
|
2013-08-03 20:01:49 +04:00
|
|
|
setShowing("t7", true);
|
|
|
|
setShowing("t7_over", true);
|
|
|
|
testMouseClick("t7", 100 + 11*mm, 10, "body", "covered div is not clickable");
|
|
|
|
testMouseClick("t7", 10, 10, "t7_over", "covered div is not clickable even within its bounds");
|
|
|
|
setShowing("t7", false);
|
|
|
|
setShowing("t7_over", false);
|
|
|
|
|
2013-08-06 14:33:29 +04:00
|
|
|
// Check that contenteditable elements are considered clickable for fluffing.
|
|
|
|
setShowing("t8", true);
|
|
|
|
var rect = document.getElementById("t8").getBoundingClientRect();
|
|
|
|
testMouseClick("t8", rect.left + 1, rect.top + 1, "t8", "content editable enabled for mouse input");
|
|
|
|
testMouseClick("t8", rect.left + 1, rect.top + 1, "t8", "content editable enabled for touch input", {
|
2018-03-20 07:16:06 +03:00
|
|
|
inputSource: MouseEvent.MOZ_SOURCE_TOUCH
|
2013-08-06 14:33:29 +04:00
|
|
|
});
|
|
|
|
setShowing("t8", false);
|
|
|
|
|
2013-10-17 22:42:48 +04:00
|
|
|
// Check that elements are touchable
|
|
|
|
setShowing("t9", true);
|
|
|
|
var rect = document.getElementById("t9").getBoundingClientRect();
|
|
|
|
testMouseClick("t9", rect.left + 1, rect.top + 1, "t9", "div enabled with mouse input");
|
|
|
|
testMouseClick("t9", rect.left + 1, rect.top + 1, "t9", "div enabled with touch input", {
|
2018-03-20 07:16:06 +03:00
|
|
|
inputSource: MouseEvent.MOZ_SOURCE_TOUCH
|
2013-10-17 22:42:48 +04:00
|
|
|
});
|
|
|
|
setShowing("t9", false);
|
|
|
|
|
2014-01-29 17:54:25 +04:00
|
|
|
setShowing("t10_over", true);
|
|
|
|
setShowing("t10_left", true);
|
|
|
|
setShowing("t10_right", true);
|
|
|
|
setShowing("t10_top", true);
|
|
|
|
setShowing("t10_bottom", true);
|
|
|
|
testMouseClick("t10_left", 51, 10, "t10_over", "element outside of visible area is not selected");
|
|
|
|
if (self.frameElement &&
|
|
|
|
(self.frameElement.offsetLeft + self.innerWidth >
|
|
|
|
SpecialPowers.wrap(top).innerWidth)) {
|
|
|
|
info("WARNING: Window is too narrow, can't test t10_right");
|
|
|
|
} else {
|
|
|
|
testMouseClick("t10_right", 49, 10, "t10_over", "element outside of visible area is not selected");
|
|
|
|
}
|
|
|
|
testMouseClick("t10_top", 10, 51, "t10_over", "element outside of visible area is not selected");
|
|
|
|
if (self.frameElement &&
|
|
|
|
(self.frameElement.offsetTop + self.innerHeight >
|
|
|
|
SpecialPowers.wrap(top).innerHeight)) {
|
|
|
|
info("WARNING: Window is too short, can't test t10_bottom");
|
|
|
|
} else {
|
|
|
|
testMouseClick("t10_bottom", 10, 49, "t10_over", "element outside of visible area is not selected");
|
|
|
|
}
|
|
|
|
setShowing("t10_over", false);
|
|
|
|
setShowing("t10_left", false);
|
|
|
|
setShowing("t10_right", false);
|
|
|
|
setShowing("t10_top", false);
|
|
|
|
setShowing("t10_bottom", false);
|
|
|
|
|
2012-08-20 04:02:42 +04:00
|
|
|
// Not yet tested:
|
|
|
|
// -- visited link weight
|
|
|
|
// -- "Closest" using Euclidean distance
|
|
|
|
endTest();
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|