Commit 1ad8a3d4 authored by pfeldman@chromium.org's avatar pfeldman@chromium.org
Browse files

2010-02-16 Pavel Feldman <pfeldman@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
parent 4d47b7d5
2010-02-16 Pavel Feldman <pfeldman@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:
2010-02-16 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Timothy Hatcher.
......
......@@ -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);
},
......
......@@ -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;
}
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment