Title: [128910] trunk
Revision
128910
Author
[email protected]
Date
2012-09-18 11:02:36 -0700 (Tue, 18 Sep 2012)

Log Message

Web Inspector: Set focus on the ExtensionPanel's iframe when it is selected
https://bugs.webkit.org/show_bug.cgi?id=96148

Patch by John J. Barton <[email protected]> on 2012-09-18
Reviewed by Vsevolod Vlasov.

Source/WebCore:

ExtensionView ctor calls setDefaultFocusedElement with its iframe,
ExtensionPanel ctor calls setDefaultFocusedElement with the extensionView
and ExtensionPanel's setDefaultFocusedElement calls its grandparent impl

Tests: Added hasFocus test to extensions/extension-panel.html

* inspector/front-end/ExtensionPanel.js:
(WebInspector.ExtensionPanel):
(WebInspector.ExtensionPanel.prototype.defaultFocusedElement):
* inspector/front-end/ExtensionView.js:
(WebInspector.ExtensionView):

LayoutTests:

Add one line to verify that the panel's document has focus after show

* inspector/extensions/extensions-panel-expected.txt:
* inspector/extensions/extensions-panel.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (128909 => 128910)


--- trunk/LayoutTests/ChangeLog	2012-09-18 18:00:04 UTC (rev 128909)
+++ trunk/LayoutTests/ChangeLog	2012-09-18 18:02:36 UTC (rev 128910)
@@ -1,3 +1,15 @@
+2012-09-18  John J. Barton  <[email protected]>
+
+        Web Inspector: Set focus on the ExtensionPanel's iframe when it is selected
+        https://bugs.webkit.org/show_bug.cgi?id=96148
+
+        Reviewed by Vsevolod Vlasov.
+
+        Add one line to verify that the panel's document has focus after show
+
+        * inspector/extensions/extensions-panel-expected.txt:
+        * inspector/extensions/extensions-panel.html:
+
 2012-09-18  Ojan Vafai  <[email protected]>
 
         Rebaseline tests failing due to expected slight pixel differences.

Modified: trunk/LayoutTests/inspector/extensions/extensions-panel-expected.txt (128909 => 128910)


--- trunk/LayoutTests/inspector/extensions/extensions-panel-expected.txt	2012-09-18 18:00:04 UTC (rev 128909)
+++ trunk/LayoutTests/inspector/extensions/extensions-panel-expected.txt	2012-09-18 18:02:36 UTC (rev 128910)
@@ -22,6 +22,7 @@
     show : <function>
 }
 Panel shown
+focused: true
 Extension panel size correct
 RUNNING TEST: extension_testSearch
 Panel hidden

Modified: trunk/LayoutTests/inspector/extensions/extensions-panel.html (128909 => 128910)


--- trunk/LayoutTests/inspector/extensions/extensions-panel.html	2012-09-18 18:00:04 UTC (rev 128909)
+++ trunk/LayoutTests/inspector/extensions/extensions-panel.html	2012-09-18 18:02:36 UTC (rev 128910)
@@ -65,6 +65,7 @@
             return;
         }
         output("Panel shown");
+        output("focused: " + window.document.hasFocus());
         panel.onShown.removeListener(onPanelShown);
         evaluateOnFrontend("reply(InspectorTest.getPanelSize())", function(result) {
             if (result.width !== window.innerWidth)

Modified: trunk/Source/WebCore/ChangeLog (128909 => 128910)


--- trunk/Source/WebCore/ChangeLog	2012-09-18 18:00:04 UTC (rev 128909)
+++ trunk/Source/WebCore/ChangeLog	2012-09-18 18:02:36 UTC (rev 128910)
@@ -1,3 +1,22 @@
+2012-09-18  John J. Barton  <[email protected]>
+
+        Web Inspector: Set focus on the ExtensionPanel's iframe when it is selected
+        https://bugs.webkit.org/show_bug.cgi?id=96148
+
+        Reviewed by Vsevolod Vlasov.
+
+        ExtensionView ctor calls setDefaultFocusedElement with its iframe,
+        ExtensionPanel ctor calls setDefaultFocusedElement with the extensionView
+        and ExtensionPanel's setDefaultFocusedElement calls its grandparent impl
+
+        Tests: Added hasFocus test to extensions/extension-panel.html
+
+        * inspector/front-end/ExtensionPanel.js:
+        (WebInspector.ExtensionPanel):
+        (WebInspector.ExtensionPanel.prototype.defaultFocusedElement):
+        * inspector/front-end/ExtensionView.js:
+        (WebInspector.ExtensionView):
+
 2012-09-18  Martin Robinson  <[email protected]>
 
         [GTK] [WebKit2] Use XComposite window for accelerated compositing

Modified: trunk/Source/WebCore/inspector/front-end/ExtensionPanel.js (128909 => 128910)


--- trunk/Source/WebCore/inspector/front-end/ExtensionPanel.js	2012-09-18 18:00:04 UTC (rev 128909)
+++ trunk/Source/WebCore/inspector/front-end/ExtensionPanel.js	2012-09-18 18:02:36 UTC (rev 128910)
@@ -41,12 +41,13 @@
     this._statusBarItems = [];
     var extensionView = new WebInspector.ExtensionView(id, pageURL, "extension panel");
     extensionView.show(this.element);
+    this.setDefaultFocusedElement(extensionView.defaultFocusedElement());
 }
 
 WebInspector.ExtensionPanel.prototype = {
     defaultFocusedElement: function()
     {
-        return this.sidebarTreeElement || this.element;
+        return WebInspector.View.prototype.defaultFocusedElement.call(this);
     },
 
     get statusBarItems()

Modified: trunk/Source/WebCore/inspector/front-end/ExtensionView.js (128909 => 128910)


--- trunk/Source/WebCore/inspector/front-end/ExtensionView.js	2012-09-18 18:00:04 UTC (rev 128909)
+++ trunk/Source/WebCore/inspector/front-end/ExtensionView.js	2012-09-18 18:02:36 UTC (rev 128910)
@@ -45,6 +45,7 @@
     this._iframe.addEventListener("load", this._onLoad.bind(this), false);
     this._iframe.src = ""
     this._iframe.className = className;
+    this.setDefaultFocusedElement(this._iframe);
 
     this.element.appendChild(this._iframe);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to