[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

yurys at chromium.org yurys at chromium.org
Wed Dec 22 13:47:59 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 4d12a9f0dd87dd0b42d57227ec09b802c40beb8f
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 27 16:55:07 2010 +0000

    2010-09-17  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: implement go-to-line feature
            https://bugs.webkit.org/show_bug.cgi?id=45166
    
            * English.lproj/localizedStrings.js:
            * inspector/front-end/GoToLineDialog.js: Added.
            (WebInspector.GoToLineDialog):
            (WebInspector.GoToLineDialog.show):
            (WebInspector.GoToLineDialog.prototype._hide):
            (WebInspector.GoToLineDialog.prototype._onKeyDown):
            (WebInspector.GoToLineDialog.prototype._onBlur):
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel.prototype._registerShortcuts):
            (WebInspector.ScriptsPanel.prototype.jumpToPreviousSearchResult):
            (WebInspector.ScriptsPanel.prototype.showGoToLineDialog):
            * inspector/front-end/goToLineDialog.css: Added.
            (.go-to-line-dialog):
            * inspector/front-end/inspector.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68398 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0d4f49c..049136e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-09-17  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: implement go-to-line feature
+        https://bugs.webkit.org/show_bug.cgi?id=45166
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/GoToLineDialog.js: Added.
+        (WebInspector.GoToLineDialog):
+        (WebInspector.GoToLineDialog.show):
+        (WebInspector.GoToLineDialog.prototype._hide):
+        (WebInspector.GoToLineDialog.prototype._onKeyDown):
+        (WebInspector.GoToLineDialog.prototype._onBlur):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._registerShortcuts):
+        (WebInspector.ScriptsPanel.prototype.jumpToPreviousSearchResult):
+        (WebInspector.ScriptsPanel.prototype.showGoToLineDialog):
+        * inspector/front-end/goToLineDialog.css: Added.
+        (.go-to-line-dialog):
+        * inspector/front-end/inspector.html:
+
 2010-09-24  Pavel Podivilov  <podivilov at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 98512b9..5489879 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 1134f1c..ca655d5 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -4264,6 +4264,7 @@
             'inspector/front-end/ExtensionRegistryStub.js',
             'inspector/front-end/ExtensionServer.js',
             'inspector/front-end/FontView.js',
+            'inspector/front-end/GoToLineDialog.js',
             'inspector/front-end/HAREntry.js',
             'inspector/front-end/HeapSnapshotView.js',
             'inspector/front-end/HelpScreen.js',
@@ -4328,6 +4329,7 @@
             'inspector/front-end/WelcomeView.js',
             'inspector/front-end/WorkersSidebarPane.js',
             'inspector/front-end/audits.css',
+            'inspector/front-end/goToLineDialog.css',
             'inspector/front-end/heapProfiler.css',
             'inspector/front-end/helpScreen.css',
             'inspector/front-end/inspector.css',
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 7c65c12..6e84f7c 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -52696,6 +52696,14 @@
 					>
 				</File>
 				<File
+					RelativePath="..\inspector\front-end\GoToLineDialog.js"
+					>
+				</File>
+				<File
+					RelativePath="..\inspector\front-end\goToLineDialog.css"
+					>
+				</File>
+				<File
 					RelativePath="..\inspector\front-end\HAREntry.js"
 					>
 				</File>
diff --git a/WebCore/inspector/front-end/GoToLineDialog.js b/WebCore/inspector/front-end/GoToLineDialog.js
new file mode 100644
index 0000000..c96344c
--- /dev/null
+++ b/WebCore/inspector/front-end/GoToLineDialog.js
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.GoToLineDialog = function(view)
+{
+    this._element = document.createElement("div");
+    this._element.className = "go-to-line-dialog";
+    this._element.addEventListener("keydown", this._onKeyDown.bind(this), false);
+    this._closeKeys = [
+        WebInspector.KeyboardShortcut.Keys.Enter.code,
+        WebInspector.KeyboardShortcut.Keys.Esc.code,
+    ];
+
+    var dialogWindow = this._element;
+
+    dialogWindow.createChild("label").innerText = WebInspector.UIString("Go to line: ");
+
+    this._input = dialogWindow.createChild("input");
+    this._input.setAttribute("type", "text");
+    this._input.setAttribute("size", 6);
+    var linesCount = view.sourceFrame.textModel.linesCount;
+    if (linesCount)
+        this._input.setAttribute("title", WebInspector.UIString("1 - %d", linesCount));
+    var blurHandler = this._onBlur.bind(this);
+    this._input.addEventListener("blur", blurHandler, false);
+    
+
+    var go = dialogWindow.createChild("button");
+    go.innerText = WebInspector.UIString("Go");
+    go.addEventListener("click", this._onClick.bind(this), false);
+    go.addEventListener("mousedown", function(e) {
+        // Ok button click will close the dialog, removing onBlur listener
+        // to let click event be handled.
+        this._input.removeEventListener("blur", blurHandler, false);
+    }.bind(this), false);
+
+    this._view = view;
+    view.element.appendChild(this._element);
+
+    this._previousFocusElement = WebInspector.currentFocusElement;
+    WebInspector.currentFocusElement = this._input;
+    this._input.select();
+}
+
+WebInspector.GoToLineDialog.show = function(sourceView)
+{
+    if (this._instance)
+        return;
+    this._instance = new WebInspector.GoToLineDialog(sourceView);
+}
+
+WebInspector.GoToLineDialog.prototype = {
+    _hide: function()
+    {
+        if (this._isHiding)
+            return;
+        this._isHiding = true;
+
+        WebInspector.currentFocusElement = this._previousFocusElement;
+        WebInspector.GoToLineDialog._instance = null;
+        this._element.parentElement.removeChild(this._element);
+    },
+
+    _onBlur: function(event)
+    {
+        this._hide();
+    },
+
+    _onKeyDown: function(event)
+    {
+        if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Tab.code) {
+            event.preventDefault();
+            return;
+        }
+
+        if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code)
+            this._highlightSelectedLine();
+
+        if (this._closeKeys.indexOf(event.keyCode) >= 0) {
+            this._hide();
+            event.stopPropagation();
+        }
+    },
+
+    _onClick: function(event)
+    {
+        this._highlightSelectedLine();
+        this._hide();
+    },
+
+    _highlightSelectedLine: function()
+    {
+        var value = this._input.value;
+        var lineNumber = parseInt(value, 10);
+        if (!isNaN(lineNumber) && lineNumber > 0) {
+            lineNumber = Math.min(lineNumber, this._view.sourceFrame.textModel.linesCount);
+            this._view.highlightLine(lineNumber);
+        }
+    }
+};
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 6642db8..b82b996 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -1002,6 +1002,9 @@ WebInspector.ScriptsPanel.prototype = {
         this._shortcuts[shortcut2.key] = handler;
         section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString("Step out"));
 
+        shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor("g", platformSpecificModifier);
+        this._shortcuts[shortcut1.key] = this.showGoToLineDialog.bind(this);
+        section.addAlternateKeys([ shortcut1.name ], WebInspector.UIString("Go to Line"));
         this.sidebarPanes.callstack.registerShortcuts(section);
     },
 
@@ -1071,6 +1074,13 @@ WebInspector.ScriptsPanel.prototype = {
             this._searchView.jumpToLastSearchResult();
         else
             this._searchView.jumpToPreviousSearchResult();
+    },
+
+    showGoToLineDialog: function(e)
+    {
+         var view = this.visibleView;
+         if (view)
+             WebInspector.GoToLineDialog.show(view);
     }
 }
 
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index 4c66a47..e40bb91 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -41,6 +41,7 @@
     <file>ExtensionRegistryStub.js</file>
     <file>ExtensionServer.js</file>
     <file>FontView.js</file>
+    <file>GoToLineDialog.js</file>
     <file>HAREntry.js</file>
     <file>HeapSnapshotView.js</file>
     <file>HelpScreen.js</file>
@@ -105,6 +106,7 @@
     <file>WelcomeView.js</file>
     <file>WorkersSidebarPane.js</file>
     <file>audits.css</file>
+    <file>goToLineDialog.css</file>
     <file>heapProfiler.css</file>
     <file>helpScreen.css</file>
     <file>inspector.css</file>
diff --git a/WebCore/inspector/front-end/goToLineDialog.css b/WebCore/inspector/front-end/goToLineDialog.css
new file mode 100644
index 0000000..725e4c8
--- /dev/null
+++ b/WebCore/inspector/front-end/goToLineDialog.css
@@ -0,0 +1,39 @@
+.go-to-line-dialog {
+    position: absolute;
+    top: 40%;
+    left: 40%;
+    z-index: 1900;
+
+    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#E9E9E9), to(#CFCFCF));
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    padding: 10px;
+    border-radius: 10px;
+    border: 1px solid gray;
+    -webkit-box-shadow: rgb(40,40,40) 0px 0px 50px;
+
+    font-size: 11px;
+    font-family: 'Lucida Grande', sans-serif;
+}
+
+.go-to-line-dialog input {
+    font-size: 11px;
+}
+
+.go-to-line-dialog button {
+    font-size: 11px;
+    color: rgb(6, 6, 6);
+    border: 1px solid rgb(165, 165, 165);
+    background-color: rgb(237, 237, 237);
+    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
+    -webkit-border-radius: 12px;
+    -webkit-appearance: none;
+
+    padding: 3px 20px;
+    margin: 0 0 0 10px;
+}
+
+.go-to-line-dialog button:active {
+    background-color: rgb(215, 215, 215);
+    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));
+}
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 3baf502..d792eb1 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -30,6 +30,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <link rel="stylesheet" type="text/css" href="audits.css">
+    <link rel="stylesheet" type="text/css" href="goToLineDialog.css">
     <link rel="stylesheet" type="text/css" href="heapProfiler.css">
     <link rel="stylesheet" type="text/css" href="inspector.css">
     <link rel="stylesheet" type="text/css" href="inspectorSyntaxHighlight.css">
@@ -137,6 +138,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="TimelineOverviewPane.js"></script>
     <script type="text/javascript" src="TestController.js"></script>
     <script type="text/javascript" src="HelpScreen.js"></script>
+    <script type="text/javascript" src="GoToLineDialog.js"></script>
     <script type="text/javascript" src="ShortcutsHelp.js"></script>
     <script type="text/javascript" src="HAREntry.js"></script>
 </head>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list