Changeset 82824 in webkit


Ignore:
Timestamp:
Apr 4, 2011 5:40:12 AM (13 years ago)
Author:
podivilov@chromium.org
Message:

2011-04-04 Andrey Adaikin <aandrey@google.com>

Reviewed by Yury Semikhatsky.

Web Inspector: Highlighted search tokens would not be shown on long lines in the text viewer
https://bugs.webkit.org/show_bug.cgi?id=57749

  • inspector/front-end/TextViewer.js: (WebInspector.TextEditorMainPanel.prototype.markAndRevealRange): (WebInspector.TextEditorMainPanel.prototype._paintLine):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r82822 r82824  
     12011-04-04  Andrey Adaikin  <aandrey@google.com>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: Highlighted search tokens would not be shown on long lines in the text viewer
     6        https://bugs.webkit.org/show_bug.cgi?id=57749
     7
     8        * inspector/front-end/TextViewer.js:
     9        (WebInspector.TextEditorMainPanel.prototype.markAndRevealRange):
     10        (WebInspector.TextEditorMainPanel.prototype._paintLine):
     11
    1122011-04-04  Alexander Pavlov  <apavlov@chromium.org>
    213
  • trunk/Source/WebCore/inspector/front-end/TextViewer.js

    r82808 r82824  
    775775        if (this._rangeToMark) {
    776776            var markedLine = this._rangeToMark.startLine;
    777             this._rangeToMark = null;
    778             this._paintLines(markedLine, markedLine + 1);
     777            delete this._rangeToMark;
     778            // Remove the marked region immediately.
     779            if (!this._dirtyLines) {
     780                this.beginDomUpdates();
     781                var chunk = this.chunkForLine(markedLine);
     782                var wasExpanded = chunk.expanded;
     783                chunk.expanded = false;
     784                chunk.updateCollapsedLineRow();
     785                chunk.expanded = wasExpanded;
     786                this.endDomUpdates();
     787            } else
     788                this._paintLines(markedLine, markedLine + 1);
    779789        }
    780790
     
    782792            this._rangeToMark = range;
    783793            this.revealLine(range.startLine);
    784             this._paintLines(range.startLine, range.startLine + 1);
     794            var chunk = this.makeLineAChunk(range.startLine);
     795            this._paintLine(chunk.element);
    785796            if (this._markedRangeElement)
    786797                this._markedRangeElement.scrollIntoViewIfNeeded();
     
    964975    {
    965976        var lineNumber = lineRow.lineNumber;
    966         if (this._dirtyLines || this._scheduledPaintLines || this._paintLinesOperationsCredit < 0) {
     977        if (this._dirtyLines) {
    967978            this._schedulePaintLines(lineNumber, lineNumber + 1);
    968979            return;
     
    971982        this.beginDomUpdates();
    972983        try {
     984            if (this._scheduledPaintLines || this._paintLinesOperationsCredit < 0) {
     985                this._schedulePaintLines(lineNumber, lineNumber + 1);
     986                return;
     987            }
     988
    973989            var highlight = this._textModel.getAttribute(lineNumber, "highlight");
    974             if (!highlight) {
    975                 if (this._rangeToMark && this._rangeToMark.startLine === lineNumber)
    976                     this._markedRangeElement = highlightSearchResult(lineRow, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);
     990            if (!highlight)
    977991                return;
    978             }
    979992
    980993            lineRow.removeChildren();
     
    10111024                --this._paintLinesOperationsCredit;
    10121025            }
    1013             if (this._rangeToMark && this._rangeToMark.startLine === lineNumber)
    1014                 this._markedRangeElement = highlightSearchResult(lineRow, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);
    10151026            if (lineRow.decorationsElement)
    10161027                lineRow.appendChild(lineRow.decorationsElement);
    10171028        } finally {
     1029            if (this._rangeToMark && this._rangeToMark.startLine === lineNumber)
     1030                this._markedRangeElement = highlightSearchResult(lineRow, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);
    10181031            this.endDomUpdates();
    10191032        }
Note: See TracChangeset for help on using the changeset viewer.