diff options
Diffstat (limited to 'Source/WebCore/inspector/front-end/TextPrompt.js')
-rw-r--r-- | Source/WebCore/inspector/front-end/TextPrompt.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/WebCore/inspector/front-end/TextPrompt.js b/Source/WebCore/inspector/front-end/TextPrompt.js index ac54d8c..36a38cc 100644 --- a/Source/WebCore/inspector/front-end/TextPrompt.js +++ b/Source/WebCore/inspector/front-end/TextPrompt.js @@ -196,7 +196,12 @@ WebInspector.TextPrompt.prototype = { return; var selectionRange = selection.getRangeAt(0); - if (!selectionRange.commonAncestorContainer.isDescendant(this.element)) + var isEmptyInput = selectionRange.commonAncestorContainer === this.element; // this.element has no child Text nodes. + + // Do not attempt to auto-complete an empty input in the auto mode (only on demand). + if (auto && isEmptyInput) + return; + if (!auto && !isEmptyInput && !selectionRange.commonAncestorContainer.isDescendant(this.element)) return; if (auto && !this.isCaretAtEndOfPrompt()) return; |