Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: LayoutTests/fast/regions/resources/helper.js

Issue 25890007: [CSS Regions] Layout Test for selecting text in 2 regions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using Vertical instead of Vert for both JavaScript method and CSS classes. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/regions/resources/region-style.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
+}
« no previous file with comments | « no previous file | LayoutTests/fast/regions/resources/region-style.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698