Title: [112267] trunk/Source/WebCore
Revision
112267
Author
[email protected]
Date
2012-03-27 07:51:03 -0700 (Tue, 27 Mar 2012)

Log Message

Web Inspector: Tabbed pane should set focus on its contents on tab click.
https://bugs.webkit.org/show_bug.cgi?id=82323

Reviewed by Pavel Feldman.

Otherwise selected tab does not have focus.
Also added tabIndex on tabElements to prevent pasting on closing middle click.

* inspector/front-end/TabbedPane.js:
(WebInspector.TabbedPane):
(WebInspector.TabbedPane.prototype.focus):
(WebInspector.TabbedPane.prototype.selectTab):
(WebInspector.TabbedPaneTab.prototype._createTabElement):
(WebInspector.TabbedPaneTab.prototype._tabClicked):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112266 => 112267)


--- trunk/Source/WebCore/ChangeLog	2012-03-27 14:43:46 UTC (rev 112266)
+++ trunk/Source/WebCore/ChangeLog	2012-03-27 14:51:03 UTC (rev 112267)
@@ -1,3 +1,20 @@
+2012-03-27  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Tabbed pane should set focus on its contents on tab click.
+        https://bugs.webkit.org/show_bug.cgi?id=82323
+
+        Reviewed by Pavel Feldman.
+
+        Otherwise selected tab does not have focus.
+        Also added tabIndex on tabElements to prevent pasting on closing middle click.
+
+        * inspector/front-end/TabbedPane.js:
+        (WebInspector.TabbedPane):
+        (WebInspector.TabbedPane.prototype.focus):
+        (WebInspector.TabbedPane.prototype.selectTab):
+        (WebInspector.TabbedPaneTab.prototype._createTabElement):
+        (WebInspector.TabbedPaneTab.prototype._tabClicked):
+
 2012-03-27  Pavel Podivilov  <[email protected]>
 
         Web Inspector: dispatch breakpoint-added and breakpoint-removed events on UISourceCode.

Modified: trunk/Source/WebCore/inspector/front-end/TabbedPane.js (112266 => 112267)


--- trunk/Source/WebCore/inspector/front-end/TabbedPane.js	2012-03-27 14:43:46 UTC (rev 112266)
+++ trunk/Source/WebCore/inspector/front-end/TabbedPane.js	2012-03-27 14:51:03 UTC (rev 112267)
@@ -86,6 +86,16 @@
         this._closeableTabs = closeableTabs;
     },
 
+    focus: function()
+    {
+        if (!this.visibleView)
+            return;
+        if (typeof(this.visibleView.focus) === "function")
+            this.visibleView.focus();
+        else
+            this.visibleView.element.focus();
+    },
+
     /**
      * @param {string} id
      * @param {string} tabTitle
@@ -172,7 +182,7 @@
         this._tabsHistory.splice(0, 0, tab);
         
         this._updateTabElements();
-        
+
         var eventData = { tabId: id, view: tab.view, isUserGesture: userGesture };
         this.dispatchEventToListeners(WebInspector.TabbedPane.EventTypes.TabSelected, eventData);
         return true;
@@ -588,6 +598,7 @@
     {
         var tabElement = document.createElement("div");
         tabElement.addStyleClass("tabbed-pane-header-tab");
+        tabElement.tabIndex = -1;
         
         var titleElement = tabElement.createChild("span", "tabbed-pane-header-tab-title");
         titleElement.textContent = this.title;
@@ -627,5 +638,6 @@
             this._tabbedPane.closeTab(this.id, true);
         else
             this._tabbedPane.selectTab(this.id, true);
+        this._tabbedPane.focus();
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to