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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js

Issue 2393763002: [DevTools] Cleanup DOMExtension.js. (Closed)
Patch Set: review comments Created 4 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
Index: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
index 0532a9d755c0e16ddb3dbd5394821c13bbe770b6..7753aa4381df30a8c51d909b7026607eda802b70 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
@@ -687,7 +687,12 @@ WebInspector.TextPrompt.prototype = {
*/
isCaretInsidePrompt: function()
{
- return this._element.isInsertionCaretInside();
+ var selection = this._element.getComponentSelection();
+ // @see crbug.com/602541
+ var selectionRange = selection && selection.rangeCount ? selection.getRangeAt(0) : null;
+ if (!selectionRange || !selection.isCollapsed)
+ return false;
+ return selectionRange.startContainer.isSelfOrDescendant(this._element);
},
/**

Powered by Google App Engine
This is Rietveld 408576698