Title: [101129] trunk/Source/WebCore
- Revision
- 101129
- Author
- [email protected]
- Date
- 2011-11-24 01:37:27 -0800 (Thu, 24 Nov 2011)
Log Message
Web Inspector: shift focus to the source view when a resource is selected in the Scripts panel
https://bugs.webkit.org/show_bug.cgi?id=69738
Reviewed by Timothy Hatcher.
The source viewer is focused whenever a file name option is clicked, and is NOT focused when the script list
is traversed with the Up/Down keys.
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._filesSelectChanged):
* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame.prototype.focus):
* inspector/front-end/TextViewer.js:
(WebInspector.TextViewer.prototype.focus):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (101128 => 101129)
--- trunk/Source/WebCore/ChangeLog 2011-11-24 09:10:20 UTC (rev 101128)
+++ trunk/Source/WebCore/ChangeLog 2011-11-24 09:37:27 UTC (rev 101129)
@@ -1,3 +1,20 @@
+2011-11-23 Alexander Pavlov <[email protected]>
+
+ Web Inspector: shift focus to the source view when a resource is selected in the Scripts panel
+ https://bugs.webkit.org/show_bug.cgi?id=69738
+
+ Reviewed by Timothy Hatcher.
+
+ The source viewer is focused whenever a file name option is clicked, and is NOT focused when the script list
+ is traversed with the Up/Down keys.
+
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._filesSelectChanged):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame.prototype.focus):
+ * inspector/front-end/TextViewer.js:
+ (WebInspector.TextViewer.prototype.focus):
+
2011-11-23 Pavel Podivilov <[email protected]>
Web Inspector: add integration test for compiler source maps.
Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (101128 => 101129)
--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js 2011-11-24 09:10:20 UTC (rev 101128)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js 2011-11-24 09:37:27 UTC (rev 101129)
@@ -69,8 +69,8 @@
this._filesSelectElement = document.createElement("select");
this._filesSelectElement.className = "status-bar-item";
this._filesSelectElement.id = "scripts-files";
- this._filesSelectElement.addEventListener("change", this._filesSelectChanged.bind(this), false);
- this._filesSelectElement.addEventListener("keyup", this._filesSelectChanged.bind(this), false);
+ this._filesSelectElement.addEventListener("change", this._filesSelectChanged.bind(this, true), false);
+ this._filesSelectElement.addEventListener("keyup", this._filesSelectChanged.bind(this, false), false);
this.topStatusBar.appendChild(this._filesSelectElement);
this.functionsSelectElement = document.createElement("select");
@@ -762,13 +762,15 @@
this._updateExecutionLine(this._presentationModel.executionLineLocation);
},
- _filesSelectChanged: function()
+ _filesSelectChanged: function(focusSource)
{
if (this._filesSelectElement.selectedIndex === -1)
return;
var uiSourceCode = this._filesSelectElement[this._filesSelectElement.selectedIndex]._uiSourceCode;
- this._showSourceFrameAndAddToHistory(uiSourceCode);
+ var sourceFrame = this._showSourceFrameAndAddToHistory(uiSourceCode);
+ if (sourceFrame && focusSource)
+ sourceFrame.focus();
},
sidebarResized: function(event)
Modified: trunk/Source/WebCore/inspector/front-end/SourceFrame.js (101128 => 101129)
--- trunk/Source/WebCore/inspector/front-end/SourceFrame.js 2011-11-24 09:10:20 UTC (rev 101128)
+++ trunk/Source/WebCore/inspector/front-end/SourceFrame.js 2011-11-24 09:37:27 UTC (rev 101129)
@@ -99,6 +99,11 @@
this.setReadOnly(true);
},
+ focus: function()
+ {
+ this._textViewer.focus();
+ },
+
get statusBarItems()
{
return [this._editButton.element];
Modified: trunk/Source/WebCore/inspector/front-end/TextViewer.js (101128 => 101129)
--- trunk/Source/WebCore/inspector/front-end/TextViewer.js 2011-11-24 09:10:20 UTC (rev 101128)
+++ trunk/Source/WebCore/inspector/front-end/TextViewer.js 2011-11-24 09:37:27 UTC (rev 101129)
@@ -98,6 +98,11 @@
return this._textModel;
},
+ focus: function()
+ {
+ this._mainPanel.element.focus();
+ },
+
revealLine: function(lineNumber)
{
this._mainPanel.revealLine(lineNumber);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes