Commit 98e9a58a authored by rego@igalia.com's avatar rego@igalia.com

[CSS Regions] Fix Layout/RegionsSelection.html in Mac platform

https://bugs.webkit.org/show_bug.cgi?id=124963

Reviewed by Ryosuke Niwa.

Layout/RegionsSelection.html introduced in r159488 was not working in
Mac platform because of it was trying to use mouse events out of the
window dimensions. Use collapse() and extend() methods from Selection
object to solve the issue.

* Layout/resources/regions.js: Use collapse() and extend() instead of
mouse events.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6e5de6cc
2013-12-03 Manuel Rego Casasnovas <rego@igalia.com>
[CSS Regions] Fix Layout/RegionsSelection.html in Mac platform
https://bugs.webkit.org/show_bug.cgi?id=124963
Reviewed by Ryosuke Niwa.
Layout/RegionsSelection.html introduced in r159488 was not working in
Mac platform because of it was trying to use mouse events out of the
window dimensions. Use collapse() and extend() methods from Selection
object to solve the issue.
* Layout/resources/regions.js: Use collapse() and extend() instead of
mouse events.
2013-11-27 Ryosuke Niwa <rniwa@webkit.org>
Build fix after r159805.
......
......@@ -88,23 +88,14 @@
};
}
function mouseMoveToRegionCenter(region) {
var rect = region.getBoundingClientRect();
eventSender.mouseMoveTo(rect.left + (rect.width / 2), rect.top + (rect.height / 2));
}
function performSelection(regionCount) {
var regions = document.getElementsByClassName("region");
function performSelection(paragraphCount) {
var paragraphs = document.getElementsByClassName("contentParagraph");
var selection = getSelection();
if (window.eventSender) {
mouseMoveToRegionCenter(regions[0]);
eventSender.mouseDown();
selection.collapse(paragraphs[0], 0);
for (var i = 1; i < regionCount; i++)
mouseMoveToRegionCenter(regions[i]);
eventSender.mouseUp();
}
for (var i = 1; i < paragraphCount; i++)
selection.extend(paragraphs[i], 0);
}
function createRegionsSelectionTest(regionCount) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment