[CSS Regions] Helper functions for selection layout tests
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Oct 2013 23:29:12 +0000 (23:29 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Oct 2013 23:29:12 +0000 (23:29 +0000)
commitf77a71c44eea0be6b6b0d94d453f9bdd97fe99ab
treefd8e13ea08d9a2b528153a3aacf9304017a1579f
parented3bedf33d469eca413c9252f3e814d5a4288503
[CSS Regions] Helper functions for selection layout tests
https://bugs.webkit.org/show_bug.cgi?id=122128

Reviewed by Alexandru Chiculita.

Create new common JavaScript methods for CSS Regions layout tests
related to selection. Refactored tests in order to use them.

* fast/regions/resources/helper.js: Added new functions.
(selectContentByRange): Select from start to end position.
(selectContentByIds): Select from the beginning of the first element to the end
of the second one.
(selectBaseAndExtent): Select from start to end with given offsets using
Selection.setBaseAndExtent() method.
(mouseClick): Clicks in a given position.
* fast/regions/selection/selecting-text-in-empty-region.html: Refactored
test in order to use the new functions.
* fast/regions/selection/selecting-text-through-different-region-flows-2-expected.html:
Ditto.
* fast/regions/selection/selecting-text-through-different-region-flows-2.html:
Ditto.
* fast/regions/selection/selecting-text-through-different-region-flows.html:
Ditto.
* fast/regions/selection/selection-direction-expected.html: Ditto.
* fast/regions/selection/selection-direction.html: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/regions/resources/helper.js
LayoutTests/fast/regions/selection/selecting-text-in-empty-region.html
LayoutTests/fast/regions/selection/selecting-text-through-different-region-flows-2-expected.html
LayoutTests/fast/regions/selection/selecting-text-through-different-region-flows-2.html
LayoutTests/fast/regions/selection/selecting-text-through-different-region-flows.html
LayoutTests/fast/regions/selection/selection-direction-expected.html
LayoutTests/fast/regions/selection/selection-direction.html