Title: [141424] trunk/Source/WebCore
Revision
141424
Author
[email protected]
Date
2013-01-31 08:33:06 -0800 (Thu, 31 Jan 2013)

Log 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 <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141423 => 141424)


--- trunk/Source/WebCore/ChangeLog	2013-01-31 16:13:35 UTC (rev 141423)
+++ trunk/Source/WebCore/ChangeLog	2013-01-31 16:33:06 UTC (rev 141424)
@@ -1,3 +1,21 @@
+2013-01-31  Andrey Lushnikov  <[email protected]>
+
+        Web Inspector: overlay highlight in DTE gets messed up when zoom factor changes.
+        https://bugs.webkit.org/show_bug.cgi?id=108486
+
+        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):
+
 2013-01-31  Simon Hausmann  <[email protected]>
 
         [Qt] Fix minor memory leak in slot execution

Modified: trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js (141423 => 141424)


--- trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js	2013-01-31 16:13:35 UTC (rev 141423)
+++ trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js	2013-01-31 16:33:06 UTC (rev 141424)
@@ -1390,7 +1390,7 @@
     {
         var highlightDescriptor = new WebInspector.TextEditorMainPanel.RegexHighlightDescriptor(new RegExp(regex, "g"), cssClass);
         this._highlightDescriptors.push(highlightDescriptor);
-        this._repaintLineRowsAffectedByHighlightDescriptor(highlightDescriptor);
+        this._repaintLineRowsAffectedByHighlightDescriptors([highlightDescriptor]);
         return highlightDescriptor;
     },
 
@@ -1400,7 +1400,7 @@
     removeHighlight: function(highlightDescriptor)
     {
         this._highlightDescriptors.remove(highlightDescriptor);
-        this._repaintLineRowsAffectedByHighlightDescriptor(highlightDescriptor);
+        this._repaintLineRowsAffectedByHighlightDescriptors([highlightDescriptor]);
     },
 
     /**
@@ -1411,14 +1411,14 @@
     {
         var highlightDescriptor = new WebInspector.TextEditorMainPanel.RangeHighlightDescriptor(range, cssClass);
         this._highlightDescriptors.push(highlightDescriptor);
-        this._repaintLineRowsAffectedByHighlightDescriptor(highlightDescriptor);
+        this._repaintLineRowsAffectedByHighlightDescriptors([highlightDescriptor]);
         return highlightDescriptor;
     },
 
     /**
-     * @param {WebInspector.TextEditorMainPanel.HighlightDescriptor} highlightDescriptor
+     * @param {Array.<WebInspector.TextEditorMainPanel.HighlightDescriptor>} highlightDescriptors
      */
-    _repaintLineRowsAffectedByHighlightDescriptor: function(highlightDescriptor)
+    _repaintLineRowsAffectedByHighlightDescriptors: function(highlightDescriptors)
     {
         var visibleFrom = this.scrollTop();
         var visibleTo = visibleFrom + this.clientHeight();
@@ -1433,8 +1433,12 @@
             for (var lineNumber = chunk.startLine; lineNumber < chunk.startLine + chunk.linesCount; ++lineNumber) {
                 var lineRow = chunk.expandedLineRow(lineNumber);
                 var line = this._textModel.line(lineNumber);
-                if (highlightDescriptor.affectsLine(lineNumber, line))
-                    affectedLineRows.push(lineRow);
+                for(var j = 0; j < highlightDescriptors.length; ++j) {
+                    if (highlightDescriptors[j].affectsLine(lineNumber, line)) {
+                        affectedLineRows.push(lineRow);
+                        break;
+                    }
+                }
             }
         }
         if (affectedLineRows.length === 0)
@@ -1444,6 +1448,12 @@
         this._restoreSelection(selection);
     },
 
+    resize: function()
+    {
+        WebInspector.TextEditorChunkedPanel.prototype.resize.call(this);
+        this._repaintLineRowsAffectedByHighlightDescriptors(this._highlightDescriptors);
+    },
+
     wasShown: function()
     {
         this._boundSelectionChangeListener = this._handleSelectionChange.bind(this);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to