Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444

This commit is contained in:
Josh Matthews 2017-04-17 12:06:02 +10:00 committed by Anthony Ramine
parent 25e8bf69e6
commit 665817d2a6
35333 changed files with 1818077 additions and 16036 deletions

View file

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Regions Test: Selection begins at the top of the region and ends at the bottom of the region</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the
mouse the movement.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region
<div id="end-select" class="select-point"></div>
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Regions Test: Selection begins at the bottom of the region and ends at the top of the region</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the
mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
<div id="end-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region
<div id="start-select" class="select-point"></div>
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Regions Test: Selection begins at the top of the region and ends in the middle of region</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region
<div id="end-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Regions Test: Selection begins at the bottom of the region and ends in the middle of region</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in
<div id="end-select" class="select-point"></div>
region in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region
<div id="start-select" class="select-point"></div>
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions: Selection begins in the middle of the region and ends in the middle of the region moving
downward
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region in
region in in region in region region in region in region in region in region in region in region in region
in region
<div id="end-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region
in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection begins in the middle of the region and ends in the middle of the region
moving upward</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region
<div id="end-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in region
in region
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region
in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection begins at the top of the region and ends outside the region moving
downward
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region
<div id="end-select" class="select-point"></div>
after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection begins at the bottom of the region and ends outside the region moving
upward
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region
<div id="end-select" class="select-point"></div>
before region before region before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region
<div id="start-select" class="select-point"></div>
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection begins in the middle of the region and ends outside the region
moving downward
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in region
in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
<div id="end-select" class="select-point"></div>
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection begins in the middle of the region and ends outside the region moving
upward
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region
<div id="end-select" class="select-point"></div>
before region before region before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in region
in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection begins outside of the region and ends at the bottom of the region moving
downward
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region
<div id="start-select" class="select-point"></div>
before region before region before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region
<div id="end-select" class="select-point"></div></div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection begins outside of the region and ends at the top the region moving
upward
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
<div id="end-select" class="select-point"></div>in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region
after region after region after region <div id="start-select" class="select-point"></div>
after region after region after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection begins outside of the region and ends in the middle of the region moving
downward
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region
<div id="start-select" class="select-point"></div>
before region before region before region before region before region before region before region
before region before region before region before region before region before region before region
before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region
<div id="end-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection begins outside of the region and ends in the middle of the region moving
upward
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region
<div id="end-select" class="select-point"></div>
in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region in
region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
<div id="start-select" class="select-point"></div>
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Regions Test: Selection begins and ends outside of the region moving downward</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region
<div id="start-select" class="select-point"></div>
before region before region before region before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
<div id="end-select" class="select-point"></div>
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Regions Test: Selection begins and ends outside of the region moving upward</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region
<div id="end-select" class="select-point"></div>
before region before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region
<div id="start-select" class="select-point"></div>
after region after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection is downward, begins and ends inside a region containing one other element -
div
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse,
including nested elements.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region
<div id="nestedDiv"> nested div nested div </div>
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region
<div id="end-select" class="select-point"></div>
in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest( [ { nodeName: "nestedImgInRegion", expected: true },
{ nodeName: "nestedImgAfterRegion", expected: true } ]);
</script>
</body>
</html>

View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection is downward, begins and ends inside a region containing one other element -
img
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse,
including nested elements.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in
<img id="nestedImg" src="support/img/cat.png"></img>
region in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region
<div id="end-select" class="select-point"></div>
in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest( [ { nodeName: "nestedImg", expected: true } ] );
</script>
</body>
</html>

View file

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection is upward, begins and ends inside a region containing one other element -
div
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse,
including nested elements.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
<style>
#nestedDiv
{
display: inline-block;
}
</style>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region
<div id="end-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in
<div id="nestedDiv"> nested div nested div </div> region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in
region in region in region <div id="start-select" class="select-point"></div>in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest();
</script>
</body>
</html>

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection is upward, begins and ends inside a region containing one other element -
img
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse,
including nested elements.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before
region before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region
<div id="end-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in
<img id="nestedImg" src="support/img/cat.png"></img>
region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region
<div id="start-select" class="select-point"></div>
in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest( [ { nodeName: "nestedImg", expected: true } ] );
</script>
</body>
</html>

View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection is downward, begins and ends inside a region containing two other elements -
div + img
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse,
including nested elements.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region in
<div id="nestedDiv"> nested div
<img id="nestedImg" src="support/img/cat.png"></img> nested div
</div>
region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region
<div id="end-select" class="select-point"></div>in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest( [ { nodeName: "nestedImg", expected: true } ] );
</script>
</body>
</html>

View file

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions: Selection is upward, begins and ends inside a region containing two other elements -
div + img
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection within a region should contain all of the content dragged over by the mouse,
including nested elements.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before region
before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region
<div id="end-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region in
<div id="nestedDiv">
nested div <img id="nestedImg" src="support/img/cat.png"></img> nested div
</div>
region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region
<div id="start-select" class="select-point"></div>in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest( [ { nodeName: "nestedImg", expected: true } ] );
</script>
</body>
</html>

View file

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions Test: Selection is downward, begins inside a region and ends outside of it - both the region
and the content after it have child elements
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mouse, including nested elements.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region before region before region before region before region before region before region before
region before region before region before region before region before region before region before
region before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region
<div id="start-select" class="select-point"></div>
in region in region in region in region in region in region in region in region in region in region
in region in region in region in region in region in region in region in region in region in region in
<div id="nestedDiv">
nested div <img id="nestedImgInRegion" src="support/img/cat.png"></img> nested div
</div>
region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region <div id="nestedDiv"> nested div <img id="nestedImgAfterRegion" src="support/img/cat.png"></img>
nested div nested div nested div nested div</div> after region after region after region after region
<div id="end-select" class="select-point"></div>
</div>
<div id="log"></div>
<script>
runSelectionTest( [ { nodeName: "nestedImgInRegion", expected: true },
{ nodeName: "nestedImgAfterRegion", expected: true } ]);
</script>
</body>
</html>

View file

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<title>
CSS Regions: Selection is upward, begins inside and ends outside a region - both the region
and the before after it have child elements
</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection inside and outside of a named flow should contain all of the content dragged
over by the mousemovement, including nested elements.">
<meta name="flags" content="dom interact">
<link href="support/css/regions-selection.css" rel="stylesheet" type="text/css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<div id="beforeRegion">
before region
<div id="end-select" class="select-point"></div>
before region before region before region
<div id="nestedDiv">
nested div <img id="nestedImgBeforeRegion" src="support/img/cat.png"></img>
nested div nested div nested div nested div
</div>
before region before region before region before region before region before region before region
before region before region before region before region before region before region before region
</div>
<div id="region"></div>
<div id="source">
in region in region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region in region in
region in
<div id="nestedDiv">
nested div <img id="nestedImgInRegion" src="support/img/cat.png"></img> nested div
</div>
region in region in region in region in region in region in region in region in region in
region in region in region in region in region in region in region in region in region
<div id="start-select" class="select-point"></div> in region
</div>
<div id="afterRegion">
after region after region after region after region after region after region after region after region
after region after region after region after region after region after region after region after region
after region after region after region after region after region
</div>
<div id="log"></div>
<script>
runSelectionTest( [ { nodeName: "nestedImgInRegion", expected: true },
{ nodeName: "nestedImgBeforeRegion", expected: true } ]);
</script>
</body>
</html>

View file

@ -0,0 +1,93 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Regions Test: DOM order is different than the linear selection</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#the-flow-into-property">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#flow-from">
<link rel="help" href="http://www.w3.org/TR/css3-regions/#relation-to-document-events">
<meta name="assert" content="CSS regions module does not alter the normal processing of events in the document
tree. Therefore, mouse selection should capture content in DOM order as it would without a named flow.">
<meta name="flags" content="dom interact">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/js/selection-test-helper.js"></script>
<style>
#source
{
position: absolute;
flow-into: content;
}
.region
{
flow-from: content;
width: 150px;
height: 150px;
margin: 15px;
}
#region
{
position: absolute;
left: 0px;
color: red;
}
#region-2
{
position: absolute;
left: 330px;
}
#region-3
{
position: absolute;
left: 165px;
}
#start-select
{
background-color: orange;
}
#end-select
{
background-color: blue;
}
.select-point
{
width: 15px;
height: 15px;
display: inline-block;
}
#log {
position: relative;
top: 175px;
clear: both;
}
</style>
</head>
<body>
<p id="msg">
Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
</p>
<!-- This text will only appear if regions are not enabled -->
<div id="region" class="region">REGIONS ARE NOT ENABLED</div>
<div id="region-2" class="region"></div>
<div id="region-3" class="region"></div>
<div id="source">
<span id="two-regions">
<div id="start-select" class="select-point"></div>
between the squares between the squares between the squares between the squares between the squares
between the squares between the squares between the squares between the squares between the squares
between the squares between the squares between the squares
<div id="end-select" class="select-point"></div>
</span>
<span id="one-region">
after the squares after the squares after the squares after the squares after the squares
after the squares after the squares after the squares after the squares after the squares
after the squares after the squares
</span>
</div>
<div id="log"></div>
<script>
runSelectionTest( [ { string: "after the squares", expected: false }], true);
</script>
</body>
</html>

View file

@ -0,0 +1,22 @@
#source
{
flow-into: content;
}
#region
{
flow-from: content;
}
#start-select
{
background-color: orange;
}
#end-select
{
background-color: blue;
}
.select-point
{
width: 15px;
height: 15px;
display: inline-block;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,261 @@
var testTimeout = 10000;
setup({timeout: testTimeout});
// This block is excecuted if running in WebKit's harness
if (window.testRunner)
{
testRunner.dumpEditingCallbacks();
testRunner.dumpAsText(false);
}
var DEFAULT_MOUSE_VALUE = true;
/*
* Main test function that defines the testharness test() functions
*/
function runSelectionTest(inSelectionTests, useMouse)
{
var selectionTests = inSelectionTests || [];
var useMouse = (useMouse === undefined) ? DEFAULT_MOUSE_VALUE : useMouse;
if( isRegionsEnabled() )
{
var selectionTest = async_test("Text was selected", {timeout: testTimeout});
selectionTest.step( function()
{
var endSelect = document.getElementById("end-select");
endSelect.onmouseup = selectionTest.step_func( function(evt)
{
/* Verify something got selected */
var selectedText = getCurrentSelectedText();
assert_not_equals(selectedText, "");
/* Verify the selected text is everything between the start and end points */
test( function() { verifySelectedText() }, "Selected text is correct" );
/* Check for specific things in the selection */
for(var i=0; i < selectionTests.length; i++)
{
if( selectionTests[i].nodeName )
{
var nodeName = selectionTests[i].nodeName
var nodeExp = selectionTests[i].expected;
var msg = nodeName + " is " + (nodeExp == true ? "" : "not ") + "in selection";
test( function(){ assert_equals(isNodeInSelection(nodeName), nodeExp) }, msg);
}
else if( selectionTests[i].string )
{
var strToCheck = selectionTests[i].string;
var strExp = selectionTests[i].expected;
var msg = "'"+strToCheck+ "' is " + (strExp == true ? "" : "not ") + "in selection";
test( function(){ assert_equals(isStringInSelection(strToCheck), strExp) }, msg);
}
}
// Update the message stating the tests are complete
var msg = document.getElementById("msg");
var complete = document.createElement("p");
complete.innerHTML = "Tests are complete. All results in the Details section below should PASS.";
complete.style.color = "blue";
msg.appendChild(complete);
selectionTest.done();
});
setSelection("start-select", "end-select", useMouse);
});
}
else
{
test( function(){ assert_true(false) }, "Regions are not enabled");
}
}
/*
* Set the document selection in an automated way
* If running in Webkit's testRunner, uses internal WebKit APIs to simulate mouse movement.
* Has option to bypass the mouse movement and set the selection range object directly
* If not running in Webkit, the function exits, leaving the selection to be done manually.
*/
function setSelection(start, end, useMouse)
{
if(window.testRunner)
{
// This block is executed if running in the Webkit harness
var startNode = document.getElementById(start);
var endNode = document.getElementById(end);
var xStartPosition = startNode.getBoundingClientRect().left
var yStartPosition = startNode.getBoundingClientRect().top
var tmp = startNode.getBoundingClientRect();
var xEndPosition = endNode.getBoundingClientRect().left
var yEndPosition = endNode.getBoundingClientRect().top
if( isTopToBottom(startNode, endNode) )
{
xEndPosition += endNode.getBoundingClientRect().width
}
else
{
xStartPosition += startNode.getBoundingClientRect().width
}
if(useMouse)
{
console.log("Selection set with the mouse");
eventSender.mouseMoveTo(xStartPosition, yStartPosition);
eventSender.mouseDown();
eventSender.mouseMoveTo(xEndPosition, yEndPosition);
eventSender.mouseUp();
// Need to manually dispatch this event - it doesn't get
// sent otherwise when running in testRunner
var mouseUpEvt = document.createEvent('MouseEvents');
mouseUpEvt.initMouseEvent( 'mouseup',true,true,window,1,0,0,
xEndPosition,yEndPosition,
false,false,false,false,1,null);
endNode.dispatchEvent(mouseUpEvt);
}
else
{
console.log("Selection set without the mouse");
var range = document.createRange();
range.setStart(startNode, 0);
range.setEnd(endNode, 0);
var sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
}
}
}
function isRegionsEnabled()
{
var style = document.getElementById("region").style
if (typeof style["flow-from"] == 'string')
return true;
else
return false;
}
/*
* Determines whether range formed from the startPoint and endPoint
* are in top to bottom order in the DOM
*/
function isTopToBottom(startPoint, endPoint)
{
var start = document.createRange();
start.setStart(startPoint, 0);
start.setEnd(startPoint, 0);
var end = document.createRange();
end.setStart(endPoint, 0);
end.setEnd(endPoint, 0);
if( start.compareBoundaryPoints(Range.START_TO_END, end) < 0)
return true;
else
return false;
}
/*
* Returns just the text in the range specified by start and end, with newlines removed
*/
function getTextRange(start, end)
{
var startNode = document.getElementById(start);
var endNode = document.getElementById(end);
var range = document.createRange();
if(isTopToBottom(startNode, endNode))
{
range.setStart(startNode, 0);
range.setEnd(endNode, 0);
}
else
{
range.setStart(endNode, 0);
range.setEnd(startNode, 0);
}
return range.toString().replace(/\n/g,"");
}
/*
* Returns just the text that is currently selected in the document, with newlines removed
*/
function getCurrentSelectedText()
{
var currentSelection = "";
var sel = window.getSelection();
if (sel.rangeCount)
{
for (var i = 0, len = sel.rangeCount; i < len; ++i)
{
currRange = sel.getRangeAt(i);
currentSelection += sel.getRangeAt(i).toString();
}
}
return currentSelection.replace(/\n/g,"");
}
/*
* Verifies the current selection text matches the text between the start-select and end-select elements
*/
function verifySelectedText()
{
var expected = getTextRange("start-select", "end-select");
var actual = getCurrentSelectedText();
assert_equals(actual, expected);
}
/*
* Returns true of strToCheck is in the current document selection, false if not
*/
function isStringInSelection(strToCheck)
{
var sel = window.getSelection().getRangeAt(0);
// If not, check for a substring
if(sel.toString().indexOf(strToCheck) >= 0)
return true;
else
return false;
}
/*
* Returns true if the node toCheck is in the current document selection
*/
function isNodeInSelection(toCheck)
{
var sel = window.getSelection().getRangeAt(0);
// If it's a node in the document, check the start & end points
var nodeToCheck = document.getElementById(toCheck);
var range = document.createRange()
range.setStart(nodeToCheck, 0);
range.setEnd(nodeToCheck, nodeToCheck.childNodes.length);
var startToStart = sel.compareBoundaryPoints(Range.START_TO_START, range);
var startToEnd = sel.compareBoundaryPoints(Range.START_TO_END, range);
var endToEnd = sel.compareBoundaryPoints(Range.END_TO_END, range);
var endToStart = sel.compareBoundaryPoints(Range.END_TO_START, range);
if(startToStart == startToEnd == endToEnd == endToStart)
return false;
else
return true;
}