Changeset 241981 in webkit


Ignore:
Timestamp:
Feb 22, 2019 8:10:00 PM (5 years ago)
Author:
Devin Rousso
Message:

REGRESSION(r?): Web Inspector: Popovers have inset shadows
https://bugs.webkit.org/show_bug.cgi?id=192963
<rdar://problem/46888679>

Reviewed by Brian Burg.

  • UserInterface/Views/Popover.js:

(WI.Popover.prototype._drawBackground):
(WI.Popover.prototype._drawBackground.isolate): Added.

  • UserInterface/Views/Popover.css:

(.popover):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r241980 r241981  
     12019-02-22  Devin Rousso  <drousso@apple.com>
     2
     3        REGRESSION(r?): Web Inspector: Popovers have inset shadows
     4        https://bugs.webkit.org/show_bug.cgi?id=192963
     5        <rdar://problem/46888679>
     6
     7        Reviewed by Brian Burg.
     8
     9        * UserInterface/Views/Popover.js:
     10        (WI.Popover.prototype._drawBackground):
     11        (WI.Popover.prototype._drawBackground.isolate): Added.
     12        * UserInterface/Views/Popover.css:
     13        (.popover):
     14
    1152019-02-22  Devin Rousso  <drousso@apple.com>
    216
  • trunk/Source/WebInspectorUI/UserInterface/Views/Popover.css

    r230618 r241981  
    3232    z-index: var(--z-index-popover);
    3333
    34     --popover-text-color: black;
    3534    --popover-background-color: var(--panel-background-color);
    3635    --popover-border-color: hsla(0, 0%, 0%, 0.25);
  • trunk/Source/WebInspectorUI/UserInterface/Views/Popover.js

    r240540 r241981  
    422422
    423423        let context = document.getCSSCanvasContext("2d", "popover", scaledWidth, scaledHeight);
    424         context.save();
    425424        context.clearRect(0, 0, scaledWidth, scaledHeight);
    426         context.shadowOffsetX = 1;
    427         context.shadowOffsetY = 1;
    428         context.shadowBlur = 5;
    429         context.shadowColor = computedStyle.getPropertyValue("--popover-shadow-color").trim();
    430         context.scale(scaleFactor, scaleFactor);
    431 
    432         // Clip the frame.
    433         context.fillStyle = computedStyle.getPropertyValue("--popover-text-color").trim();
    434         this._drawFrame(context, bounds, this._edge, this._anchorPoint);
    435         context.clip();
    436 
    437         // Panel background color fill.
    438         context.fillStyle = computedStyle.getPropertyValue("--popover-background-color").trim();
    439 
    440         context.fillRect(0, 0, width, height);
    441 
    442         // Stroke.
    443         context.strokeStyle = computedStyle.getPropertyValue("--popover-border-color").trim();
    444         context.lineWidth = 2;
    445         this._drawFrame(context, bounds, this._edge, this._anchorPoint);
    446         context.stroke();
    447         context.restore();
     425
     426        function isolate(callback) {
     427            context.save();
     428            callback();
     429            context.restore();
     430        }
     431
     432        isolate(() => {
     433            context.scale(scaleFactor, scaleFactor);
     434            this._drawFrame(context, bounds, this._edge, this._anchorPoint);
     435
     436            isolate(() => {
     437                context.shadowBlur = 4;
     438                context.shadowColor = computedStyle.getPropertyValue("--popover-shadow-color").trim();
     439
     440                context.strokeStyle = computedStyle.getPropertyValue("--popover-border-color").trim();
     441                context.lineWidth = 2;
     442                context.stroke();
     443            });
     444
     445            isolate(() => {
     446                context.fillStyle = computedStyle.getPropertyValue("--popover-background-color").trim();
     447                context.fill();
     448            });
     449        });
    448450    }
    449451
Note: See TracChangeset for help on using the changeset viewer.