Title: [99458] trunk
Revision
99458
Author
[email protected]
Date
2011-11-07 12:35:16 -0800 (Mon, 07 Nov 2011)

Log Message

Web Inspector: Suggest box should consume enter key pressed event.
https://bugs.webkit.org/show_bug.cgi?id=71700

Reviewed by Pavel Feldman.

Source/WebCore:

* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView):
* inspector/front-end/TextPrompt.js:
(WebInspector.TextPrompt.prototype._attachInternal):
(WebInspector.TextPrompt.SuggestBox.prototype.enterKeyPressed):

LayoutTests:

* http/tests/inspector/inspector-test.js:
(initialize_InspectorTest.InspectorTest.evaluateInConsole):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (99457 => 99458)


--- trunk/LayoutTests/ChangeLog	2011-11-07 20:29:09 UTC (rev 99457)
+++ trunk/LayoutTests/ChangeLog	2011-11-07 20:35:16 UTC (rev 99458)
@@ -1,3 +1,13 @@
+2011-11-07  [email protected]  <[email protected]>
+
+        Web Inspector: Suggest box should consume enter key pressed event.
+        https://bugs.webkit.org/show_bug.cgi?id=71700
+
+        Reviewed by Pavel Feldman.
+
+        * http/tests/inspector/inspector-test.js:
+        (initialize_InspectorTest.InspectorTest.evaluateInConsole):
+
 2011-11-07  Robert Hogan  <[email protected]>
 
         [chromium] css2.1/20110323/block-non-replaced-width-008.htm fails on mac 10.5 CG

Modified: trunk/LayoutTests/http/tests/inspector/inspector-test.js (99457 => 99458)


--- trunk/LayoutTests/http/tests/inspector/inspector-test.js	2011-11-07 20:29:09 UTC (rev 99457)
+++ trunk/LayoutTests/http/tests/inspector/inspector-test.js	2011-11-07 20:35:16 UTC (rev 99458)
@@ -33,7 +33,7 @@
     WebInspector.consoleView.prompt.text = code;
     var event = document.createEvent("KeyboardEvent");
     event.initKeyboardEvent("keydown", true, true, null, "Enter", "");
-    WebInspector.consoleView.promptElement.dispatchEvent(event);
+    WebInspector.consoleView.prompt.proxyElement.dispatchEvent(event);
     InspectorTest.addConsoleSniffer(
         function(commandResult) {
             callback(commandResult.toMessageElement().textContent);

Modified: trunk/Source/WebCore/ChangeLog (99457 => 99458)


--- trunk/Source/WebCore/ChangeLog	2011-11-07 20:29:09 UTC (rev 99457)
+++ trunk/Source/WebCore/ChangeLog	2011-11-07 20:35:16 UTC (rev 99458)
@@ -1,3 +1,16 @@
+2011-11-07  [email protected]  <[email protected]>
+
+        Web Inspector: Suggest box should consume enter key pressed event.
+        https://bugs.webkit.org/show_bug.cgi?id=71700
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView):
+        * inspector/front-end/TextPrompt.js:
+        (WebInspector.TextPrompt.prototype._attachInternal):
+        (WebInspector.TextPrompt.SuggestBox.prototype.enterKeyPressed):
+
 2011-11-07  David Barr  <[email protected]>
 
         Optimize outline rendering to avoid transparency layers

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleView.js (99457 => 99458)


--- trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-11-07 20:29:09 UTC (rev 99457)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-11-07 20:35:16 UTC (rev 99458)
@@ -61,7 +61,6 @@
     this.promptElement.id = "console-prompt";
     this.promptElement.className = "source-code";
     this.promptElement.spellcheck = false;
-    this.promptElement.addEventListener("keydown", this._promptKeyDown.bind(this), true);
     this.messagesElement.appendChild(this.promptElement);
     this.messagesElement.appendChild(document.createElement("br"));
 
@@ -114,6 +113,7 @@
     this.prompt = new WebInspector.TextPromptWithHistory(this.completions.bind(this), ExpressionStopCharacters + ".");
     this.prompt.setSuggestBoxEnabled("generic-suggest");
     this.prompt.attach(this.promptElement);
+    this.prompt.proxyElement.addEventListener("keydown", this._promptKeyDown.bind(this), false);
     this.prompt.setHistoryData(WebInspector.settings.consoleHistory.get());
 }
 

Modified: trunk/Source/WebCore/inspector/front-end/TextPrompt.js (99457 => 99458)


--- trunk/Source/WebCore/inspector/front-end/TextPrompt.js	2011-11-07 20:29:09 UTC (rev 99457)
+++ trunk/Source/WebCore/inspector/front-end/TextPrompt.js	2011-11-07 20:35:16 UTC (rev 99458)
@@ -105,7 +105,7 @@
         element.parentElement.insertBefore(this.proxyElement, element);
         this.proxyElement.appendChild(element);
         this._element.addStyleClass("text-prompt");
-        this._element.addEventListener("keydown", this._boundOnKeyDown, true);
+        this._element.addEventListener("keydown", this._boundOnKeyDown, false);
         this._element.addEventListener("selectstart", this._selectStart.bind(this), false);
 
         if (typeof this._suggestBoxClassName === "string")
@@ -1077,7 +1077,8 @@
 
     enterKeyPressed: function(event)
     {
-        return this.acceptSuggestion();
+        this.acceptSuggestion();
+        return true;
     },
 
     tabKeyPressed: function(event)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to