[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

eric at webkit.org eric at webkit.org
Fri Feb 26 22:22:07 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 45ea6db4fd25297149d1b5a702e735fbab071662
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 17 06:56:19 2010 +0000

    2010-02-16  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: prefer smooth scrolling to instant highlight.
    
            https://bugs.webkit.org/show_bug.cgi?id=34978
    
            * inspector/front-end/TextViewer.js:
            (WebInspector.TextViewer):
            (WebInspector.TextViewer.prototype._scroll):
            (WebInspector.TextChunk):
            (WebInspector.TextChunk.prototype._createRow):
            * inspector/front-end/textViewer.css:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54871 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 217f626..692bbaa 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-16  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: prefer smooth scrolling to instant highlight.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34978
+
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer):
+        (WebInspector.TextViewer.prototype._scroll):
+        (WebInspector.TextChunk):
+        (WebInspector.TextChunk.prototype._createRow):
+        * inspector/front-end/textViewer.css:
+
 2010-02-16  Yael Aharon  <yael.aharon at nokia.com>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/inspector/front-end/TextViewer.js b/WebCore/inspector/front-end/TextViewer.js
index 03c047b..81d0814 100644
--- a/WebCore/inspector/front-end/TextViewer.js
+++ b/WebCore/inspector/front-end/TextViewer.js
@@ -52,6 +52,7 @@ WebInspector.TextViewer = function(textModel, platform, url)
     this._paintCoalescingLevel = 0;
 
     this.freeCachedElements();
+    this._buildChunks();
 }
 
 WebInspector.TextViewer.prototype = {
@@ -195,7 +196,11 @@ WebInspector.TextViewer.prototype = {
 
     _scroll: function()
     {
-        this._repaintAll();
+        var scrollTop = this.element.scrollTop;
+        setTimeout(function() {
+            if (scrollTop === this.element.scrollTop)
+                this._repaintAll();
+        }.bind(this), 50);
     },
 
     beginUpdates: function(enabled)
@@ -557,7 +562,6 @@ WebInspector.TextChunk = function(textViewer, startLine, endLine)
 
     this._lineNumberElement = document.createElement("td");
     this._lineNumberElement.className = "webkit-line-number";
-    this._lineNumberElement.textContent = this._lineNumberText(this.startLine);
     this.element.appendChild(this._lineNumberElement);
 
     this._lineContentElement = document.createElement("td");
@@ -566,9 +570,13 @@ WebInspector.TextChunk = function(textViewer, startLine, endLine)
 
     this._expanded = false;
 
+    var lineNumbers = [];
     var lines = [];
-    for (var i = this.startLine; i < this.startLine + this.linesCount; ++i)
+    for (var i = startLine; i < endLine; ++i) {
+        lineNumbers.push(i + 1);
         lines.push(this._textModel.line(i));
+    }
+    this._lineNumberElement.textContent = lineNumbers.join("\n");
     this._lineContentElement.textContent = lines.join("\n");
 }
 
@@ -653,18 +661,6 @@ WebInspector.TextChunk.prototype = {
         return result;
     },
 
-    _lineNumberText: function(lineNumber)
-    {
-        var totalDigits = Math.ceil(Math.log(this._textModel.linesCount + 1) / Math.log(10));
-        var digits = Math.ceil(Math.log(lineNumber + 2) / Math.log(10));
-
-        var text = "";
-        for (var i = digits; i < totalDigits; ++i)
-            text += " ";
-        text += lineNumber + 1;
-        return text;
-    },
-
     _createRow: function(lineNumber)
     {
         var cachedRows = this._textViewer._cachedRows;
@@ -685,7 +681,7 @@ WebInspector.TextChunk.prototype = {
             lineRow.appendChild(lineContentElement);        
         }
         lineRow.lineNumber = lineNumber;
-        lineNumberElement.textContent = this._lineNumberText(lineNumber);
+        lineNumberElement.textContent = lineNumber + 1;
         lineContentElement.textContent = this._textModel.line(lineNumber);
         return lineRow;
     }
diff --git a/WebCore/inspector/front-end/textViewer.css b/WebCore/inspector/front-end/textViewer.css
index 258cb86..1447dfd 100644
--- a/WebCore/inspector/front-end/textViewer.css
+++ b/WebCore/inspector/front-end/textViewer.css
@@ -11,7 +11,6 @@
 .text-editor-lines {
     border: 0;
     width: 100%;
-    vertical-align: baseline;
     -webkit-border-horizontal-spacing: 0;
     -webkit-border-vertical-spacing: 0;
     -webkit-user-select: text;
@@ -69,13 +68,14 @@
     border-right: 1px solid rgb(187, 187, 187) !important;
     padding-left: 2px;
     padding-right: 2px;
-    vertical-align: top;
     background-repeat: no-repeat;
     background-position: right 1px;
+    vertical-align: top;
 }
 
 .webkit-line-content {
     padding-left: 2px;
+    vertical-align: top;
 }
 
 .webkit-execution-line .webkit-line-number {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list