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

Unified Diff: third_party/WebKit/LayoutTests/editing/assert_selection.js

Issue 2105663002: [Editing][Codehealth] Rewrite user-select-all-selection.html with assert_selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: third_party/WebKit/LayoutTests/editing/assert_selection.js
diff --git a/third_party/WebKit/LayoutTests/editing/assert_selection.js b/third_party/WebKit/LayoutTests/editing/assert_selection.js
index c615527057615aa8bb120fe1d2f4e71d7a901b91..836a8e5595e02e75f3a8305147171f746a44cd5c 100644
--- a/third_party/WebKit/LayoutTests/editing/assert_selection.js
+++ b/third_party/WebKit/LayoutTests/editing/assert_selection.js
@@ -517,6 +517,8 @@ class Sample {
/** @const @type {!Selection} */
this.selection_ = this.iframe_.contentWindow.getSelection();
this.selection_.document = this.document_;
+ this.selection_.document.offsetLeft = this.iframe_.offsetLeft;
yosin_UTC9 2016/06/30 03:47:37 Not sure about these changes. Document doesn't hav
yoichio 2016/07/04 06:28:17 That's because we need iframe offset to use eventS
+ this.selection_.document.offsetTop = this.iframe_.offsetTop;
this.load(sampleText);
}
@@ -534,7 +536,7 @@ class Sample {
load(sampleText) {
const anchorMarker = sampleText.indexOf('^');
const focusMarker = sampleText.indexOf('|');
- if (focusMarker < 0) {
+ if (focusMarker < 0 && anchorMarker >= 0) {
yosin_UTC9 2016/06/30 03:47:37 We should have another CL for this change to expli
throw new Error(`You should specify caret position in "${sampleText}".`);
}
if (focusMarker != sampleText.lastIndexOf('|')) {

Powered by Google App Engine
This is Rietveld 408576698