Title: [112251] trunk/Source/WebCore
Revision
112251
Author
vse...@chromium.org
Date
2012-03-27 04:40:29 -0700 (Tue, 27 Mar 2012)

Log Message

Web Inspector: Editable TextViewer should show cursor when it is focused.
https://bugs.webkit.org/show_bug.cgi?id=82320

Reviewed by Pavel Feldman.

TextViewer now focuses editable inner container unless read-only flag is set.

* inspector/front-end/TextViewer.js:
(WebInspector.TextViewer.prototype.focus):
(WebInspector.TextEditorMainPanel):
(WebInspector.TextEditorMainPanel.prototype._handleElementFocus):
(WebInspector.TextEditorMainPanel.prototype.focus):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112250 => 112251)


--- trunk/Source/WebCore/ChangeLog	2012-03-27 11:08:49 UTC (rev 112250)
+++ trunk/Source/WebCore/ChangeLog	2012-03-27 11:40:29 UTC (rev 112251)
@@ -1,3 +1,18 @@
+2012-03-27  Vsevolod Vlasov  <vse...@chromium.org>
+
+        Web Inspector: Editable TextViewer should show cursor when it is focused.
+        https://bugs.webkit.org/show_bug.cgi?id=82320
+
+        Reviewed by Pavel Feldman.
+
+        TextViewer now focuses editable inner container unless read-only flag is set.
+
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer.prototype.focus):
+        (WebInspector.TextEditorMainPanel):
+        (WebInspector.TextEditorMainPanel.prototype._handleElementFocus):
+        (WebInspector.TextEditorMainPanel.prototype.focus):
+
 2012-03-26  Levi Weintraub  <le...@chromium.org>
 
         Unreviewed. Removing change markers from ChangeLog.

Modified: trunk/Source/WebCore/inspector/front-end/TextViewer.js (112250 => 112251)


--- trunk/Source/WebCore/inspector/front-end/TextViewer.js	2012-03-27 11:08:49 UTC (rev 112250)
+++ trunk/Source/WebCore/inspector/front-end/TextViewer.js	2012-03-27 11:40:29 UTC (rev 112251)
@@ -100,7 +100,7 @@
 
     focus: function()
     {
-        this._mainPanel.element.focus();
+        this._mainPanel.focus();
     },
 
     revealLine: function(lineNumber)
@@ -904,6 +904,7 @@
     this.element.appendChild(this._container);
 
     this.element.addEventListener("scroll", this._scroll.bind(this), false);
+    this.element.addEventListener("focus", this._handleElementFocus.bind(this), false);
 
     // In WebKit the DOMNodeRemoved event is fired AFTER the node is removed, thus it should be
     // attached to all DOM nodes that we want to track. Instead, we attach the DOMNodeRemoved
@@ -949,6 +950,20 @@
         return this._readOnly;
     },
 
+    _handleElementFocus: function()
+    {
+        if (!this._readOnly)
+            this._container.focus();
+    },
+
+    focus: function()
+    {
+        if (this._readOnly)
+            this.element.focus();
+        else
+            this._container.focus();
+    },
+
     _updateSelectionOnStartEditing: function()
     {
         // focus() needs to go first for the case when the last selection was inside the editor and
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to