WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-84352-20120419213414.patch (text/plain), 24.59 KB, created by
Pavel Feldman
on 2012-04-19 10:34:16 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Pavel Feldman
Created:
2012-04-19 10:34:16 PDT
Size:
24.59 KB
patch
obsolete
>Subversion Revision: 114641 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c867e19181fb023f99e9708f79c60c239089414b..9f33d99f6520114f32a9773e6b681b12776f6543 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,54 @@ >+2012-04-19 Pavel Feldman <pfeldman@chromium.org> >+ >+ Web Inspector: make ScriptNavigatorController use views only, rename to NavigatorOverlayController. >+ https://bugs.webkit.org/show_bug.cgi?id=84352 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This change makes navigator controller use view interfaces only. Focus machinery has been refactored in order >+ to make it possible: now all view ancestors can either override "focus" or "defaultFocusedElement" method >+ with latter method being preferred. >+ >+ * inspector/front-end/ElementsPanel.js: >+ (WebInspector.ElementsPanel.prototype.defaultFocusedElement): >+ * inspector/front-end/ExtensionPanel.js: >+ (WebInspector.ExtensionPanel.prototype.defaultFocusedElement): >+ * inspector/front-end/Panel.js: >+ (WebInspector.Panel.prototype.wasShown): >+ (WebInspector.Panel.prototype.defaultFocusedElement): >+ * inspector/front-end/ScriptsNavigator.js: >+ (WebInspector.ScriptsNavigator): >+ (WebInspector.NavigatorOverlayController.prototype._hidePinnedNavigator): >+ (WebInspector.NavigatorOverlayController.prototype.set _pinNavigator): >+ (WebInspector.NavigatorOverlayController.prototype.set showNavigatorOverlay): >+ (WebInspector.NavigatorOverlayController.prototype.hideNavigatorOverlay): >+ (WebInspector.NavigatorOverlayController.prototype._navigatorOverlayWasShown): >+ * inspector/front-end/ScriptsPanel.js: >+ (WebInspector.ScriptsPanel.prototype.defaultFocusedElement): >+ * inspector/front-end/SidebarOverlay.js: >+ (WebInspector.SidebarOverlay.prototype.show): >+ (WebInspector.SidebarOverlay.prototype.hide): >+ * inspector/front-end/SourceFrame.js: >+ (WebInspector.SourceFrame.prototype.defaultFocusedElement): >+ * inspector/front-end/StylesPanel.js: >+ (WebInspector.StylesPanel): >+ * inspector/front-end/TabbedEditorContainer.js: >+ (WebInspector.TabbedEditorContainer.prototype.get view): >+ (WebInspector.TabbedEditorContainer.prototype.get visibleView): >+ * inspector/front-end/TabbedPane.js: >+ (WebInspector.TabbedPane): >+ (WebInspector.TabbedPane.prototype.defaultFocusedElement): >+ * inspector/front-end/TextViewer.js: >+ (WebInspector.TextViewer.prototype.defaultFocusedElement): >+ (WebInspector.TextEditorMainPanel.prototype.defaultFocusedElement): >+ * inspector/front-end/TimelinePanel.js: >+ (WebInspector.TimelinePanel.prototype.defaultFocusedElement): >+ * inspector/front-end/View.js: >+ (WebInspector.View.prototype._collectViewHierarchy): >+ (WebInspector.View.prototype.defaultFocusedElement): >+ (WebInspector.View.prototype.setDefaultFocusedElement): >+ (WebInspector.View.prototype.focus): >+ > 2012-04-19 Mark Pilgrim <pilgrim@chromium.org> > > [Chromium] Call mimeRegistry directly >diff --git a/Source/WebCore/inspector/front-end/ElementsPanel.js b/Source/WebCore/inspector/front-end/ElementsPanel.js >index 58a15a7e3d095f5be2dcee6abee036cc6bb8d86e..1a366974b26f1166baab229b0419856153211d4a 100644 >--- a/Source/WebCore/inspector/front-end/ElementsPanel.js >+++ b/Source/WebCore/inspector/front-end/ElementsPanel.js >@@ -115,7 +115,7 @@ WebInspector.ElementsPanel.prototype = { > return [this.crumbsElement]; > }, > >- get defaultFocusedElement() >+ defaultFocusedElement: function() > { > return this.treeOutline.element; > }, >diff --git a/Source/WebCore/inspector/front-end/ExtensionPanel.js b/Source/WebCore/inspector/front-end/ExtensionPanel.js >index 0dfd93fb8dff6e64a7cfddef4468e3c5b39e5a90..945c86526cc49274f5688324c38edc5f245dafd0 100644 >--- a/Source/WebCore/inspector/front-end/ExtensionPanel.js >+++ b/Source/WebCore/inspector/front-end/ExtensionPanel.js >@@ -126,7 +126,7 @@ WebInspector.ExtensionPanel.prototype = { > return this._toolbarItemLabel; > }, > >- get defaultFocusedElement() >+ defaultFocusedElement: function() > { > return this.sidebarTreeElement || this.element; > }, >diff --git a/Source/WebCore/inspector/front-end/Panel.js b/Source/WebCore/inspector/front-end/Panel.js >index a9fdf0a4dcd60fc0e099eb75e53e71626ae6876e..566f105f55c4287b56747a4785018771b52d577b 100644 >--- a/Source/WebCore/inspector/front-end/Panel.js >+++ b/Source/WebCore/inspector/front-end/Panel.js >@@ -79,7 +79,7 @@ WebInspector.Panel.prototype = { > if ("_toolbarItem" in this) > this._toolbarItem.addStyleClass("toggled-on"); > >- WebInspector.setCurrentFocusElement(this.defaultFocusedElement); >+ this.focus(); > }, > > willHide: function() >@@ -96,7 +96,7 @@ WebInspector.Panel.prototype = { > this.searchCanceled(); > }, > >- get defaultFocusedElement() >+ defaultFocusedElement: function() > { > return this.sidebarTreeElement || this.element; > }, >diff --git a/Source/WebCore/inspector/front-end/ScriptsNavigator.js b/Source/WebCore/inspector/front-end/ScriptsNavigator.js >index 349b641c3e56ef15be8d56e4c4583d80a0c2c854..6e8a481cc6d170a88cb9c07224e85881a5679497 100644 >--- a/Source/WebCore/inspector/front-end/ScriptsNavigator.js >+++ b/Source/WebCore/inspector/front-end/ScriptsNavigator.js >@@ -39,9 +39,6 @@ WebInspector.ScriptsNavigator = function() > > this._tabbedPane.element.id = "scripts-navigator-tabbed-pane"; > >- this._tabbedPane.element.tabIndex = 0; >- this._tabbedPane.element.addEventListener("focus", this.focus.bind(this), false); >- > this._treeSearchBox = document.createElement("div"); > this._treeSearchBox.id = "scripts-navigator-tree-search-box"; > this._tabbedPane.element.appendChild(this._treeSearchBox); >@@ -58,6 +55,7 @@ WebInspector.ScriptsNavigator = function() > scriptsView.element.addStyleClass("fill"); > scriptsView.element.addStyleClass("navigator-container"); > scriptsView.element.appendChild(scriptsOutlineElement); >+ scriptsView.setDefaultFocusedElement(this._scriptsTree.element); > > this._tabbedPane.appendTab(WebInspector.ScriptsNavigator.ScriptsTab, WebInspector.UIString("Scripts"), scriptsView); > this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.ScriptsTab); >@@ -74,6 +72,7 @@ WebInspector.ScriptsNavigator = function() > contentScriptsView.element.addStyleClass("fill"); > contentScriptsView.element.addStyleClass("navigator-container"); > contentScriptsView.element.appendChild(contentScriptsOutlineElement); >+ contentScriptsView.setDefaultFocusedElement(this._contentScriptsTree.element); > > this._tabbedPane.appendTab(WebInspector.ScriptsNavigator.ContentScriptsTab, WebInspector.UIString("Content scripts"), contentScriptsView); > >@@ -97,14 +96,6 @@ WebInspector.ScriptsNavigator.SnippetsTab = "snippets"; > > WebInspector.ScriptsNavigator.prototype = { > /** >- * @type {Element} >- */ >- get defaultFocusedElement() >- { >- return this._scriptsTree.element; >- }, >- >- /** > * @type {WebInspector.View} > */ > get view() >@@ -113,32 +104,6 @@ WebInspector.ScriptsNavigator.prototype = { > }, > > /** >- * @type {Element} >- */ >- get element() >- { >- return this._tabbedPane.element; >- }, >- >- /** >- * @param {Element} element >- */ >- show: function(element) >- { >- this._tabbedPane.show(element); >- }, >- >- focus: function() >- { >- if (this._tabbedPane.selectedTabId === WebInspector.ScriptsNavigator.ScriptsTab) >- WebInspector.setCurrentFocusElement(this._scriptsTree.element); >- else if (this._tabbedPane.selectedTabId === WebInspector.ScriptsNavigator.ContentScriptsTab) >- WebInspector.setCurrentFocusElement(this._contentScriptsTree.element); >- else >- WebInspector.setCurrentFocusElement(this._snippetsTree.element); >- }, >- >- /** > * @param {WebInspector.UISourceCode} uiSourceCode > */ > addUISourceCode: function(uiSourceCode) >@@ -778,37 +743,37 @@ WebInspector.NavigatorScriptTreeElement.prototype.__proto__ = WebInspector.BaseN > /** > * @constructor > * @param {WebInspector.Panel} panel >- * @param {WebInspector.SplitView} editorView >- * @param {WebInspector.ScriptsNavigator} navigator >- * @param {WebInspector.TabbedEditorContainer} editorContainer >+ * @param {WebInspector.SplitView} parentSplitView >+ * @param {WebInspector.View} navigatorView >+ * @param {WebInspector.View} editorView > */ >-WebInspector.ScriptsNavigatorController = function(panel, editorView, navigator, editorContainer) >+WebInspector.NavigatorOverlayController = function(panel, parentSplitView, navigatorView, editorView) > { > this._panel = panel; >+ this._parentSplitView = parentSplitView; >+ this._navigatorView = navigatorView; > this._editorView = editorView; >- this._navigator = navigator; >- this._editorContainer = editorContainer; > > this._navigatorSidebarResizeWidgetElement = document.createElement("div"); > this._navigatorSidebarResizeWidgetElement.addStyleClass("scripts-navigator-resizer-widget"); >- this._editorView.installResizer(this._navigatorSidebarResizeWidgetElement); >- this._navigator.view.element.appendChild(this._navigatorSidebarResizeWidgetElement); >+ this._parentSplitView.installResizer(this._navigatorSidebarResizeWidgetElement); >+ this._navigatorView.element.appendChild(this._navigatorSidebarResizeWidgetElement); > > this._navigatorShowHideButton = this._createNavigatorControlButton(WebInspector.UIString("Show navigator"), "scripts-navigator-show-hide-button", this._toggleNavigator.bind(this)); > this._navigatorShowHideButton.addStyleClass("toggled-on"); > this._navigatorShowHideButton.title = WebInspector.UIString("Hide scripts navigator"); >- this._editorView.element.appendChild(this._navigatorShowHideButton); >+ this._parentSplitView.element.appendChild(this._navigatorShowHideButton); > > this._navigatorPinButton = this._createNavigatorControlButton(WebInspector.UIString("Pin navigator"), "scripts-navigator-pin-button", this._pinNavigator.bind(this)); > this._navigatorPinButton.addStyleClass("hidden"); >- this._navigator.view.element.appendChild(this._navigatorPinButton); >+ this._navigatorView.element.appendChild(this._navigatorPinButton); > > WebInspector.settings.navigatorHidden = WebInspector.settings.createSetting("navigatorHidden", true); > if (WebInspector.settings.navigatorHidden.get()) > this._toggleNavigator(); > } > >-WebInspector.ScriptsNavigatorController.prototype = { >+WebInspector.NavigatorOverlayController.prototype = { > wasShown: function() > { > window.setTimeout(this._maybeShowNavigatorOverlay.bind(this), 0); >@@ -851,13 +816,14 @@ WebInspector.ScriptsNavigatorController.prototype = { > this._navigatorHidden = true; > this._navigatorShowHideButton.removeStyleClass("toggled-on"); > this._navigatorShowHideButton.title = WebInspector.UIString("Show scripts navigator"); >- this._editorContainer.element.addStyleClass("navigator-hidden"); >+ this._editorView.element.addStyleClass("navigator-hidden"); > this._navigatorSidebarResizeWidgetElement.addStyleClass("hidden"); > > this._navigatorPinButton.removeStyleClass("hidden"); > >- this._editorView.hideSidebarElement(); >- this._navigator.view.detach(); >+ this._parentSplitView.hideSidebarElement(); >+ this._navigatorView.detach(); >+ this._editorView.focus(); > WebInspector.settings.navigatorHidden.set(true); > }, > >@@ -870,12 +836,12 @@ WebInspector.ScriptsNavigatorController.prototype = { > this._navigatorShowHideButton.addStyleClass("toggled-on"); > this._navigatorShowHideButton.title = WebInspector.UIString("Hide scripts navigator"); > >- this._editorContainer.element.removeStyleClass("navigator-hidden"); >+ this._editorView.element.removeStyleClass("navigator-hidden"); > this._navigatorSidebarResizeWidgetElement.removeStyleClass("hidden"); > >- this._editorView.showSidebarElement(); >- this._navigator.show(this._editorView.sidebarElement); >- this._navigator.focus(); >+ this._parentSplitView.showSidebarElement(); >+ this._navigatorView.show(this._parentSplitView.sidebarElement); >+ this._navigatorView.focus(); > WebInspector.settings.navigatorHidden.set(false); > }, > >@@ -885,7 +851,7 @@ WebInspector.ScriptsNavigatorController.prototype = { > return; > > this._navigatorOverlayShown = true; >- this._sidebarOverlay = new WebInspector.SidebarOverlay(this._navigator.view, "scriptsPanelNavigatorOverlayWidth", Preferences.minScriptsSidebarWidth); >+ this._sidebarOverlay = new WebInspector.SidebarOverlay(this._navigatorView, "scriptsPanelNavigatorOverlayWidth", Preferences.minScriptsSidebarWidth); > this._sidebarOverlay.addEventListener(WebInspector.SidebarOverlay.EventTypes.WasShown, this._navigatorOverlayWasShown, this); > this._sidebarOverlay.addEventListener(WebInspector.SidebarOverlay.EventTypes.WillHide, this._navigatorOverlayWillHide, this); > >@@ -893,7 +859,7 @@ WebInspector.ScriptsNavigatorController.prototype = { > navigatorOverlayResizeWidgetElement.addStyleClass("scripts-navigator-resizer-widget"); > this._sidebarOverlay.resizerWidgetElement = navigatorOverlayResizeWidgetElement; > >- this._sidebarOverlay.show(this._editorView.element); >+ this._sidebarOverlay.show(this._parentSplitView.element); > }, > > hideNavigatorOverlay: function() >@@ -902,16 +868,15 @@ WebInspector.ScriptsNavigatorController.prototype = { > return; > > this._sidebarOverlay.hide(); >- if (this._editorContainer.visibleView) >- this._editorContainer.visibleView.focus(); >+ this._editorView.focus(); > }, > > _navigatorOverlayWasShown: function(event) > { >- this._navigator.view.element.appendChild(this._navigatorShowHideButton); >+ this._navigatorView.element.appendChild(this._navigatorShowHideButton); > this._navigatorShowHideButton.addStyleClass("toggled-on"); > this._navigatorShowHideButton.title = WebInspector.UIString("Hide navigator"); >- this._navigator.focus(); >+ this._navigatorView.focus(); > this._panel.registerShortcut(WebInspector.KeyboardShortcut.Keys.Esc.code, this._escDownWhileNavigatorOverlayOpen.bind(this)); > }, > >@@ -919,7 +884,7 @@ WebInspector.ScriptsNavigatorController.prototype = { > { > delete this._navigatorOverlayShown; > WebInspector.settings.navigatorWasOnceHidden.set(true); >- this._editorView.element.appendChild(this._navigatorShowHideButton); >+ this._parentSplitView.element.appendChild(this._navigatorShowHideButton); > this._navigatorShowHideButton.removeStyleClass("toggled-on"); > this._navigatorShowHideButton.title = WebInspector.UIString("Show navigator"); > this._panel.unregisterShortcut(WebInspector.KeyboardShortcut.Keys.Esc.code); >diff --git a/Source/WebCore/inspector/front-end/ScriptsPanel.js b/Source/WebCore/inspector/front-end/ScriptsPanel.js >index 4775febf8ab82e989765feea5fcbddf96080f4cb..cda21df2c6613a7f852dbd02c65fbd9606dbcd5b 100644 >--- a/Source/WebCore/inspector/front-end/ScriptsPanel.js >+++ b/Source/WebCore/inspector/front-end/ScriptsPanel.js >@@ -72,13 +72,13 @@ WebInspector.ScriptsPanel = function(presentationModel) > this.editorView.show(this.splitView.mainElement); > > this._navigator = new WebInspector.ScriptsNavigator(); >- this._navigator.show(this.editorView.sidebarElement); >+ this._navigator.view.show(this.editorView.sidebarElement); > > this._editorContainer = new WebInspector.TabbedEditorContainer(this, "previouslyViewedFiles"); > this._editorContainer.show(this.editorView.mainElement); > WebInspector.OpenResourceDialog.install(this, this._presentationModel, this.editorView.mainElement); > >- this._navigatorController = new WebInspector.ScriptsNavigatorController(this, this.editorView, this._navigator, this._editorContainer); >+ this._navigatorController = new WebInspector.NavigatorOverlayController(this, this.editorView, this._navigator.view, this._editorContainer.view); > > this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ScriptSelected, this._scriptSelected, this); > this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorSelected, this._editorSelected, this); >@@ -193,9 +193,9 @@ WebInspector.ScriptsPanel.prototype = { > return [this.enableToggleButton.element, this._pauseOnExceptionButton.element, this._toggleFormatSourceButton.element, this._scriptViewStatusBarItemsContainer]; > }, > >- get defaultFocusedElement() >+ defaultFocusedElement: function() > { >- return this._navigator.defaultFocusedElement; >+ return this._navigator.view.defaultFocusedElement(); > }, > > get paused() >diff --git a/Source/WebCore/inspector/front-end/SidebarOverlay.js b/Source/WebCore/inspector/front-end/SidebarOverlay.js >index 246788ed29b4076ceee9dc43831deb068ce0285c..3cd58a3ac177d97e6679800fd801469cde3c5ef7 100644 >--- a/Source/WebCore/inspector/front-end/SidebarOverlay.js >+++ b/Source/WebCore/inspector/front-end/SidebarOverlay.js >@@ -74,8 +74,8 @@ WebInspector.SidebarOverlay.prototype = { > this.element.appendChild(this._resizerWidgetElement); > this.position(relativeToElement); > this._boundContainingElementFocused = this._containingElementFocused.bind(this); >- relativeToElement.addEventListener("DOMFocusIn", this._boundContainingElementFocused, false); >- >+ relativeToElement.addEventListener("mousedown", this._boundContainingElementFocused, false); >+ > this.dispatchEventToListeners(WebInspector.SidebarOverlay.EventTypes.WasShown, null); > }, > >@@ -113,7 +113,7 @@ WebInspector.SidebarOverlay.prototype = { > this.element.removeChild(this._resizerElement); > if (this._resizerWidgetElement) > this.element.removeChild(this._resizerWidgetElement); >- element.removeEventListener("DOMFocusIn", this._boundContainingElementFocused, false); >+ element.removeEventListener("mousedown", this._boundContainingElementFocused, false); > }, > > /** >diff --git a/Source/WebCore/inspector/front-end/SourceFrame.js b/Source/WebCore/inspector/front-end/SourceFrame.js >index 18f770753b5336128ea8bdca1cae41ff722709e8..67e35e7bcc8592117d1d116189fc138eea61e98e 100644 >--- a/Source/WebCore/inspector/front-end/SourceFrame.js >+++ b/Source/WebCore/inspector/front-end/SourceFrame.js >@@ -90,9 +90,9 @@ WebInspector.SourceFrame.prototype = { > this._clearLineToReveal(); > }, > >- focus: function() >+ defaultFocusedElement: function() > { >- this._textViewer.focus(); >+ return this._textViewer.defaultFocusedElement(); > }, > > get loaded() >diff --git a/Source/WebCore/inspector/front-end/StylesPanel.js b/Source/WebCore/inspector/front-end/StylesPanel.js >index 475bf69697f743b56e46f1e7c3b93b26e29e777b..a887cefed3053ace1ec72789428dc1fb9d232717 100644 >--- a/Source/WebCore/inspector/front-end/StylesPanel.js >+++ b/Source/WebCore/inspector/front-end/StylesPanel.js >@@ -49,13 +49,13 @@ WebInspector.StylesPanel = function() > > this._navigator = new WebInspector.ScriptsNavigator(); > this._navigatorView = this._navigator.view; >- this._navigator.show(this._mainView.sidebarElement); >+ this._navigator.view.show(this._mainView.sidebarElement); > this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ScriptSelected, this._scriptSelected, this); > > this._editorContainer = new WebInspector.TabbedEditorContainer(this, "previouslyViewedCSSFiles"); > this._editorContainer.show(this._mainView.mainElement); > >- this._navigatorController = new WebInspector.ScriptsNavigatorController(this, this._mainView, this._navigator, this._editorContainer); >+ this._navigatorController = new WebInspector.NavigatorOverlayController(this, this._mainView, this._navigator.view, this._editorContainer.view); > > this._sourceFramesForResource = new Map(); > this._urlToResource = {}; >diff --git a/Source/WebCore/inspector/front-end/TabbedEditorContainer.js b/Source/WebCore/inspector/front-end/TabbedEditorContainer.js >index 369657aa34ee69df5934df6b5f9ff68d5884713d..cb93576d74369825709dce806d6b1160ab062c73 100644 >--- a/Source/WebCore/inspector/front-end/TabbedEditorContainer.js >+++ b/Source/WebCore/inspector/front-end/TabbedEditorContainer.js >@@ -76,19 +76,19 @@ WebInspector.TabbedEditorContainer.maximalPreviouslyViewedFilesCount = 30; > > WebInspector.TabbedEditorContainer.prototype = { > /** >- * @type {WebInspector.SourceFrame} >+ * @type {WebInspector.View} > */ >- get visibleView() >+ get view() > { >- return this._tabbedPane.visibleView; >+ return this._tabbedPane; > }, > > /** >- * @type {Element} >+ * @type {WebInspector.SourceFrame} > */ >- get element() >+ get visibleView() > { >- return this._tabbedPane.element; >+ return this._tabbedPane.visibleView; > }, > > /** >diff --git a/Source/WebCore/inspector/front-end/TabbedPane.js b/Source/WebCore/inspector/front-end/TabbedPane.js >index 095ca47c452fcdbc80858b0384c02241c4cded24..4952296421ad1a81ef616acf0b298e0c4709c3b4 100644 >--- a/Source/WebCore/inspector/front-end/TabbedPane.js >+++ b/Source/WebCore/inspector/front-end/TabbedPane.js >@@ -44,6 +44,7 @@ WebInspector.TabbedPane = function() > this._tabs = []; > this._tabsHistory = []; > this._tabsById = {}; >+ this.element.addEventListener("click", this.focus.bind(this), false); > > this._dropDownButton = this._createDropDownButton(); > } >@@ -86,14 +87,9 @@ WebInspector.TabbedPane.prototype = { > this._closeableTabs = closeableTabs; > }, > >- focus: function() >+ defaultFocusedElement: function() > { >- if (!this.visibleView) >- return; >- if (typeof(this.visibleView.focus) === "function") >- this.visibleView.focus(); >- else >- this.visibleView.element.focus(); >+ return this.visibleView ? this.visibleView.defaultFocusedElement() : null; > }, > > /** >diff --git a/Source/WebCore/inspector/front-end/TextViewer.js b/Source/WebCore/inspector/front-end/TextViewer.js >index 0e6c50425a273a69f5db4a669b886044f0130323..e4b12562eabeeabfe44a562491e0fd6f36a6956a 100644 >--- a/Source/WebCore/inspector/front-end/TextViewer.js >+++ b/Source/WebCore/inspector/front-end/TextViewer.js >@@ -98,9 +98,9 @@ WebInspector.TextViewer.prototype = { > return this._textModel; > }, > >- focus: function() >+ defaultFocusedElement: function() > { >- this._mainPanel.focus(); >+ return this._mainPanel.defaultFocusedElement(); > }, > > revealLine: function(lineNumber) >@@ -959,12 +959,11 @@ WebInspector.TextEditorMainPanel.prototype = { > this._container.focus(); > }, > >- focus: function() >+ defaultFocusedElement: function() > { > if (this._readOnly) >- this.element.focus(); >- else >- this._container.focus(); >+ return this.element; >+ return this._container; > }, > > _updateSelectionOnStartEditing: function() >diff --git a/Source/WebCore/inspector/front-end/TimelinePanel.js b/Source/WebCore/inspector/front-end/TimelinePanel.js >index fb707f6982be08c2e4e8c8500a01dbbbfbbe46b4..298f5fa2cca63032308268f4b645fa849a8c0ed0 100644 >--- a/Source/WebCore/inspector/front-end/TimelinePanel.js >+++ b/Source/WebCore/inspector/front-end/TimelinePanel.js >@@ -193,7 +193,7 @@ WebInspector.TimelinePanel.prototype = { > return statusBarItems; > }, > >- get defaultFocusedElement() >+ defaultFocusedElement: function() > { > return this.element; > }, >diff --git a/Source/WebCore/inspector/front-end/View.js b/Source/WebCore/inspector/front-end/View.js >index 468ee3e3f178528cbee057747de8c040cea7709e..91cb287c0d5722560237bc2a9ae01c1ae3ca9fe1 100644 >--- a/Source/WebCore/inspector/front-end/View.js >+++ b/Source/WebCore/inspector/front-end/View.js >@@ -333,6 +333,31 @@ WebInspector.View.prototype = { > > if (this._children.length) > lines.push(prefix + "}"); >+ }, >+ >+ /** >+ * @return {Element} >+ */ >+ defaultFocusedElement: function() >+ { >+ return this._defaultFocusedElement || this.element; >+ }, >+ >+ /** >+ * @param {Element} element >+ */ >+ setDefaultFocusedElement: function(element) >+ { >+ this._defaultFocusedElement = element; >+ }, >+ >+ focus: function() >+ { >+ var element = this.defaultFocusedElement(); >+ if (!element || element.isAncestor(document.activeElement)) >+ return; >+ >+ WebInspector.setCurrentFocusElement(element); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
vsevik
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 84352
: 137920