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

Unified Diff: LayoutTests/paint/selection/resources/selection.js

Issue 1350973003: Invalidate line break selection rects when selected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't need redundant early-out for selection rect. Created 5 years, 3 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
Index: LayoutTests/paint/selection/resources/selection.js
diff --git a/LayoutTests/paint/selection/resources/selection.js b/LayoutTests/paint/selection/resources/selection.js
index 534ac8e8a5aaa554c5148bd373a819f0d962f76d..b26f72a21b68402a5afd880620fbfa91a0d893d8 100644
--- a/LayoutTests/paint/selection/resources/selection.js
+++ b/LayoutTests/paint/selection/resources/selection.js
@@ -1,10 +1,14 @@
-function selectRange(startElement, startIndex, endElement, endIndex) {
+function selectRangeAfterLayoutAndPaint(startElement, startIndex, endElement, endIndex) {
runAfterLayoutAndPaint(function() {
- if (window.internals)
- window.internals.setSelectionPaintingWithoutSelectionGapsEnabled(true);
- var range = document.createRange();
- range.setStart(startElement, startIndex);
- range.setEnd(endElement, endIndex);
- window.getSelection().addRange(range);
+ selectRange(startElement, startIndex, endElement, endIndex);
}, true);
}
+
+function selectRange(startElement, startIndex, endElement, endIndex) {
+ if (window.internals)
+ window.internals.setSelectionPaintingWithoutSelectionGapsEnabled(true);
+ var range = document.createRange();
+ range.setStart(startElement, startIndex);
+ range.setEnd(endElement, endIndex);
+ window.getSelection().addRange(range);
+}

Powered by Google App Engine
This is Rietveld 408576698