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

pfeldman at chromium.org pfeldman at chromium.org
Fri Feb 26 22:20:57 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit a0547350eff033ab8a6abe1b4176399840991b78
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 16 10:25:29 2010 +0000

    2010-02-16  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: turn off line wrapping in source view.
    
            https://bugs.webkit.org/show_bug.cgi?id=34935
    
            * inspector/front-end/TextViewer.js:
            (WebInspector.TextViewer.prototype.markAndRevealRange):
            (WebInspector.TextViewer.prototype._paintLine):
            * inspector/front-end/textViewer.css:
            * inspector/front-end/utilities.js:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54813 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d8bda9c..147ca76 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,20 @@
 
         Reviewed by Timothy Hatcher.
 
+        Web Inspector: turn off line wrapping in source view.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34935
+
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer.prototype.markAndRevealRange):
+        (WebInspector.TextViewer.prototype._paintLine):
+        * inspector/front-end/textViewer.css:
+        * inspector/front-end/utilities.js:
+
+2010-02-16  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
         Web Inspector: let search iterate over views in Resources
         and keep the view in Scripts.
 
diff --git a/WebCore/inspector/front-end/TextViewer.js b/WebCore/inspector/front-end/TextViewer.js
index 01d8d45..03c047b 100644
--- a/WebCore/inspector/front-end/TextViewer.js
+++ b/WebCore/inspector/front-end/TextViewer.js
@@ -98,7 +98,10 @@ WebInspector.TextViewer.prototype = {
             this._rangeToMark = range;
             this.revealLine(range.startLine);
             this._paintLines(range.startLine, range.startLine + 1);
+            if (this._markedRangeElement)
+                this._markedRangeElement.scrollIntoViewIfNeeded();
         }
+        delete this._markedRangeElement;
     },
 
     highlightLine: function(lineNumber)
@@ -327,7 +330,7 @@ WebInspector.TextViewer.prototype = {
 
         if (!highlighterState) {
             if (this._rangeToMark && this._rangeToMark.startLine === lineNumber)
-                highlightSearchResult(element, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);
+                this._markedRangeElement = highlightSearchResult(element, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);
             return;
         }
 
@@ -337,6 +340,7 @@ WebInspector.TextViewer.prototype = {
         for (var j = 0; j < line.length;) {
             if (j > 1000) {
                 // This line is too long - do not waste cycles on minified js highlighting.
+                plainTextStart = j;
                 break;
             }
             var attribute = highlighterState && highlighterState.attributes[j];
@@ -356,7 +360,7 @@ WebInspector.TextViewer.prototype = {
         if (plainTextStart !== -1)
             this._appendTextNode(element, line.substring(plainTextStart, line.length));
         if (this._rangeToMark && this._rangeToMark.startLine === lineNumber)
-            highlightSearchResult(element, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);
+            this._markedRangeElement = highlightSearchResult(element, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);
         if (lineRow.decorationsElement)
             element.appendChild(lineRow.decorationsElement);
     },
diff --git a/WebCore/inspector/front-end/textViewer.css b/WebCore/inspector/front-end/textViewer.css
index 386a9d7..258cb86 100644
--- a/WebCore/inspector/front-end/textViewer.css
+++ b/WebCore/inspector/front-end/textViewer.css
@@ -4,7 +4,7 @@
     left:0;
     right:0;
     bottom:0;
-    white-space: pre-wrap;
+    white-space: pre;
     overflow: auto;
 }
 
@@ -63,7 +63,6 @@
 .webkit-line-number {
     color: rgb(128, 128, 128);
     text-align: right;
-    white-space: pre;
     word-break: normal;
     -webkit-user-select: none;
     background-color: rgb(240, 240, 240);
@@ -76,7 +75,6 @@
 }
 
 .webkit-line-content {
-    white-space: pre-wrap;
     padding-left: 2px;
 }
 
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index 0877a2c..80bb73b 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -870,7 +870,7 @@ function highlightSearchResult(element, offset, length)
         textNode.parentElement.insertBefore(highlightNode, textNode);
         var prefixNode = document.createTextNode(text.substring(0, boundary.offset));
         textNode.parentElement.insertBefore(prefixNode, highlightNode);
-        return;
+        return highlightNode;
     }
 
     var parentElement = textNode.parentElement;
@@ -893,6 +893,7 @@ function highlightSearchResult(element, offset, length)
     }
 
     parentElement.insertBefore(highlightNode, anchorElement);
+    return highlightNode;
 }
 
 function createSearchRegex(query)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list