Index: LayoutTests/fast/regions/resources/helper.js |
diff --git a/LayoutTests/fast/regions/resources/helper.js b/LayoutTests/fast/regions/resources/helper.js |
index 6cf7d3f6af3ad0268f60138b0723e3deb42d8857..5233d70fd01a0a14d54c9b4ee568fc88422dac61 100644 |
--- a/LayoutTests/fast/regions/resources/helper.js |
+++ b/LayoutTests/fast/regions/resources/helper.js |
@@ -224,6 +224,16 @@ function selectContentByIds(fromId, toId) { |
selectContentByRange(fromRect.left, fromRectVerticalCenter, toRect.right, toRectVerticalCenter); |
} |
+function selectContentByIdsVertical(fromId, toId) { |
+ var fromRect = document.getElementById(fromId).getBoundingClientRect(); |
+ var toRect = document.getElementById(toId).getBoundingClientRect(); |
+ |
+ var fromRectHorizontalCenter = fromRect.left + fromRect.width / 2; |
+ var toRectHorizontalCenter = toRect.left + toRect.width / 2; |
+ |
+ selectContentByRange(fromRectHorizontalCenter, fromRect.top, toRectHorizontalCenter, toRect.bottom); |
+} |
+ |
function selectBaseAndExtent(fromId, fromOffset, toId, toOffset) { |
var from = document.getElementById(fromId); |
var to = document.getElementById(toId); |
@@ -240,3 +250,10 @@ function mouseClick(positionX, positionY) { |
eventSender.mouseDown(); |
eventSender.mouseUp(); |
} |
+ |
+function onMouseUpLogSelection(elementId) { |
+ document.onmouseup = function() { |
+ var selectedContent = document.getElementById(elementId); |
+ selectedContent.innerHTML = window.getSelection().getRangeAt(0); |
+ } |
+} |