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

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

Issue 2133043002: Get rid of redundant console.assert() from Serializer in assert_selection() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-08T16:37:37 Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2ee74145ff63043a2113562c4e58759055572bf4..e96ea686eb6c29249bddc8ffe37c7232db87d332 100644
--- a/third_party/WebKit/LayoutTests/editing/assert_selection.js
+++ b/third_party/WebKit/LayoutTests/editing/assert_selection.js
@@ -370,6 +370,8 @@ class Serializer {
* @param {number} childIndex
*/
handleSelection(parentNode, childIndex) {
+ if (this.selection_.isNone)
+ return;
if (parentNode === this.selection_.focusNode &&
childIndex === this.selection_.focusOffset) {
this.emit('|');
@@ -388,6 +390,8 @@ class Serializer {
handleCharacterData(node) {
/** @type {string} */
const text = node.nodeValue;
+ if (this.selection_.isNone)
+ return this.emit(text);
/** @type {number} */
const anchorOffset = this.selection_.anchorOffset;
/** @type {number} */
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698