Changeset 141424 in webkit


Ignore:
Timestamp:
Jan 31, 2013 8:33:06 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: overlay highlight in DTE gets messed up when zoom factor changes.
https://bugs.webkit.org/show_bug.cgi?id=108486

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-01-31
Reviewed by Pavel Feldman.

Repaint overlay highlight when zoom factor changes.

No new tests.

  • inspector/front-end/DefaultTextEditor.js:

(WebInspector.TextEditorMainPanel.prototype.highlightRegex):
(WebInspector.TextEditorMainPanel.prototype.removeHighlight):
(WebInspector.TextEditorMainPanel.prototype.highlightRange):
(WebInspector.TextEditorMainPanel.prototype._repaintLineRowsAffectedByHighlightDescriptors):
(WebInspector.TextEditorMainPanel.prototype.resize):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141420 r141424  
     12013-01-31  Andrey Lushnikov  <lushnikov@chromium.org>
     2
     3        Web Inspector: overlay highlight in DTE gets messed up when zoom factor changes.
     4        https://bugs.webkit.org/show_bug.cgi?id=108486
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Repaint overlay highlight when zoom factor changes.
     9
     10        No new tests.
     11
     12        * inspector/front-end/DefaultTextEditor.js:
     13        (WebInspector.TextEditorMainPanel.prototype.highlightRegex):
     14        (WebInspector.TextEditorMainPanel.prototype.removeHighlight):
     15        (WebInspector.TextEditorMainPanel.prototype.highlightRange):
     16        (WebInspector.TextEditorMainPanel.prototype._repaintLineRowsAffectedByHighlightDescriptors):
     17        (WebInspector.TextEditorMainPanel.prototype.resize):
     18
    1192013-01-31  Simon Hausmann  <simon.hausmann@digia.com>
    220
  • trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js

    r141414 r141424  
    13911391        var highlightDescriptor = new WebInspector.TextEditorMainPanel.RegexHighlightDescriptor(new RegExp(regex, "g"), cssClass);
    13921392        this._highlightDescriptors.push(highlightDescriptor);
    1393         this._repaintLineRowsAffectedByHighlightDescriptor(highlightDescriptor);
     1393        this._repaintLineRowsAffectedByHighlightDescriptors([highlightDescriptor]);
    13941394        return highlightDescriptor;
    13951395    },
     
    14011401    {
    14021402        this._highlightDescriptors.remove(highlightDescriptor);
    1403         this._repaintLineRowsAffectedByHighlightDescriptor(highlightDescriptor);
     1403        this._repaintLineRowsAffectedByHighlightDescriptors([highlightDescriptor]);
    14041404    },
    14051405
     
    14121412        var highlightDescriptor = new WebInspector.TextEditorMainPanel.RangeHighlightDescriptor(range, cssClass);
    14131413        this._highlightDescriptors.push(highlightDescriptor);
    1414         this._repaintLineRowsAffectedByHighlightDescriptor(highlightDescriptor);
     1414        this._repaintLineRowsAffectedByHighlightDescriptors([highlightDescriptor]);
    14151415        return highlightDescriptor;
    14161416    },
    14171417
    14181418    /**
    1419      * @param {WebInspector.TextEditorMainPanel.HighlightDescriptor} highlightDescriptor
    1420      */
    1421     _repaintLineRowsAffectedByHighlightDescriptor: function(highlightDescriptor)
     1419     * @param {Array.<WebInspector.TextEditorMainPanel.HighlightDescriptor>} highlightDescriptors
     1420     */
     1421    _repaintLineRowsAffectedByHighlightDescriptors: function(highlightDescriptors)
    14221422    {
    14231423        var visibleFrom = this.scrollTop();
     
    14341434                var lineRow = chunk.expandedLineRow(lineNumber);
    14351435                var line = this._textModel.line(lineNumber);
    1436                 if (highlightDescriptor.affectsLine(lineNumber, line))
    1437                     affectedLineRows.push(lineRow);
     1436                for(var j = 0; j < highlightDescriptors.length; ++j) {
     1437                    if (highlightDescriptors[j].affectsLine(lineNumber, line)) {
     1438                        affectedLineRows.push(lineRow);
     1439                        break;
     1440                    }
     1441                }
    14381442            }
    14391443        }
     
    14431447        this._paintLineRows(affectedLineRows);
    14441448        this._restoreSelection(selection);
     1449    },
     1450
     1451    resize: function()
     1452    {
     1453        WebInspector.TextEditorChunkedPanel.prototype.resize.call(this);
     1454        this._repaintLineRowsAffectedByHighlightDescriptors(this._highlightDescriptors);
    14451455    },
    14461456
Note: See TracChangeset for help on using the changeset viewer.