REGRESSION: Web Inspector: Popovers drawing incorrectly in Network Tab (clicking...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2018 21:34:27 +0000 (21:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2018 21:34:27 +0000 (21:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191323

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-11-06
Reviewed by Devin Rousso.

* UserInterface/Views/Popover.js:
(WI.Popover.prototype._drawBackground):
Save and restore the context state between updates. Something
was affecting the clearRect, making it so that it didn't actually
clear the entire rect each time.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237883 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/Popover.js

index 61daa50..7e616a4 100644 (file)
@@ -1,3 +1,16 @@
+2018-11-06  Joseph Pecoraro  <pecoraro@apple.com>
+
+        REGRESSION: Web Inspector: Popovers drawing incorrectly in Network Tab (clicking between a few items)
+        https://bugs.webkit.org/show_bug.cgi?id=191323
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/Popover.js:
+        (WI.Popover.prototype._drawBackground):
+        Save and restore the context state between updates. Something
+        was affecting the clearRect, making it so that it didn't actually
+        clear the entire rect each time.
+
 2018-11-05  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Audit: turn off Start button when all tests are removed
index 0aa033f..7fe1d01 100644 (file)
@@ -420,12 +420,12 @@ WI.Popover = class Popover extends WI.Object
         let computedStyle = window.getComputedStyle(this._element, null);
 
         let context = document.getCSSCanvasContext("2d", "popover", scaledWidth, scaledHeight);
+        context.save();
         context.clearRect(0, 0, scaledWidth, scaledHeight);
         context.shadowOffsetX = 1;
         context.shadowOffsetY = 1;
         context.shadowBlur = 5;
         context.shadowColor = computedStyle.getPropertyValue("--popover-shadow-color").trim();
-        context.resetTransform();
         context.scale(scaleFactor, scaleFactor);
 
         // Clip the frame.
@@ -443,6 +443,7 @@ WI.Popover = class Popover extends WI.Object
         context.lineWidth = 2;
         this._drawFrame(context, bounds, this._edge, this._anchorPoint);
         context.stroke();
+        context.restore();
     }
 
     _bestMetricsForEdge(preferredSize, targetFrame, containerFrame, edge)