mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Update CSS tests to revision 31d63cc79bd4c929ed582229e936d7b389f3e6ab
This commit is contained in:
parent
1a81b18b9f
commit
2c9faf5363
91915 changed files with 5979820 additions and 0 deletions
128
tests/wpt/css-tests/css-regions-1_dev/html/mouse-events-001.htm
Normal file
128
tests/wpt/css-tests/css-regions-1_dev/html/mouse-events-001.htm
Normal file
|
@ -0,0 +1,128 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="UTF-8">
|
||||
<title>CSS Regions: mouse events don't trigger for region children</title>
|
||||
<link href="mailto:mibalan@adobe.com" rel="author" title="Mihai Balan">
|
||||
<link href="http://www.w3.org/TR/css3-regions/#the-flow-into-property" rel="help">
|
||||
<link href="http://www.w3.org/TR/css3-regions/#the-flow-from-property" rel="help">
|
||||
<meta content="Children of regions (elements with flow-from) are removed from the document flow and JavaScript event handlers set on them should not fire" name="assert">
|
||||
<meta content="dom interact" name="flags">
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
.box {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
float: left;
|
||||
margin: 20px;
|
||||
}
|
||||
#source {
|
||||
background-color: lightcyan;
|
||||
}
|
||||
#source p {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
background-color: green;
|
||||
flow-into: flow;
|
||||
}
|
||||
#region {
|
||||
background-color: yellow;
|
||||
flow-from: flow;
|
||||
}
|
||||
#region p {
|
||||
margin-top: 100px;
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
background-color: red;
|
||||
}
|
||||
#result {
|
||||
clear: both;
|
||||
font-weight: bold;
|
||||
}
|
||||
.pass {
|
||||
color: green;
|
||||
}
|
||||
.fail {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<ol>
|
||||
<li>Mouse over the green rectangle and click</li>
|
||||
<li>Mouse over the yellow rectangle and click</li>
|
||||
<li>You should see "PASS" appearing below</li>
|
||||
<li>You should not see any red, or the word "FAIL"</li>
|
||||
</ol>
|
||||
<div class="box" id="source">
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="box" id="region">
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="" id="result"></div>
|
||||
<script type="text/javascript">
|
||||
var contentCalls = 0,
|
||||
regionCalls = false;
|
||||
|
||||
function setResult(value) {
|
||||
var tag = document.querySelector("#result");
|
||||
tag.innerHTML = value;
|
||||
tag.classList.add(value.toLowerCase());
|
||||
}
|
||||
|
||||
function contentEventHandler(evt) {
|
||||
contentCalls++;
|
||||
|
||||
if (contentCalls == 3) {
|
||||
setResult("PASS");
|
||||
finishTest();
|
||||
}
|
||||
}
|
||||
|
||||
function regionChildEventHandler(evt) {
|
||||
regionCalls = true;
|
||||
setResult("FAIL");
|
||||
finishTest();
|
||||
}
|
||||
|
||||
function finishTest() {
|
||||
if (window.testRunner) {
|
||||
testRunner.notifyDone();
|
||||
}
|
||||
}
|
||||
|
||||
function runScriptedTest() {
|
||||
if (window.testRunner) {
|
||||
testRunner.dumpAsText();
|
||||
testRunner.waitUntilDone();
|
||||
|
||||
var boxLocation = document.querySelector("#region").getBoundingClientRect();
|
||||
eventSender.mouseMoveTo(boxLocation.left + 40, boxLocation.top + 50);
|
||||
eventSender.mouseDown();
|
||||
eventSender.mouseUp();
|
||||
|
||||
eventSender.mouseMoveTo(boxLocation.left + boxLocation.width - 40, boxLocation.top + boxLocation.height - 40);
|
||||
eventSender.mouseDown();
|
||||
eventSender.mouseUp();
|
||||
}
|
||||
}
|
||||
|
||||
var events = [ "mouseover", "mouseout", "click" ],
|
||||
regionChild = document.querySelector("#region p"),
|
||||
content = document.querySelector("#source p");
|
||||
|
||||
events.forEach(function(item) {
|
||||
regionChild.addEventListener(item, regionChildEventHandler);
|
||||
content.addEventListener(item, contentEventHandler);
|
||||
})
|
||||
|
||||
runScriptedTest();
|
||||
</script>
|
||||
|
||||
</body></html>
|
Loading…
Add table
Add a link
Reference in a new issue