Skip to content
Browse files
Web Inspector: Styles: CSS documentation popover is needlessly persis…
…tent with broken background

Reviewed by Devin Rousso.

Prevent the CSS documentation popover from staying visible when clicking on the CSS value field.
Avoids having multiple popovers shown at the same time as a result of clicking on inline swatches.

The original intent to keep the the documentation popover visible while editing a CSS value was
that a user could reference the syntax section. But the syntax section is not shown  because
most entries are written with specialized identifiers to aid spec implementers, not users.
We don't yet have a solution to make it user-legible so the syntax section remains hidden.

Given this constraint, it doesn't make sense to keep the CSS documentation open while clicking
or typing in the CSS value field.

An implementation side-effect makes the lingering popover background look broken.
Its background is drawn as a CSS image, `background: -webkit-canvas(popover)`, sourced from a shared canvas context:
`document.getCSSCanvasContext("2d", "popover", scaledWidth, scaledHeight)`.

When another popover is shown, it redraws the image on the canvas which is then reflected on all visible popovers.

* Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:

Canonical link:
  • Loading branch information
rcaliman-apple committed Jul 6, 2022
1 parent 04bc9e6 commit a56e4283f9a69844b05317ec64c7f78b4dcf4918
Showing 1 changed file with 0 additions and 3 deletions.
@@ -469,7 +469,6 @@ WI.SpreadsheetStyleProperty = class SpreadsheetStyleProperty extends WI.Object

this._cssDocumentationPopover = null;

@@ -581,8 +580,6 @@ WI.SpreadsheetStyleProperty = class SpreadsheetStyleProperty extends WI.Object
this._cssDocumentationPopover ??= new WI.CSSDocumentationPopover(this._property, this);;
if (this._isEditable())

_createInlineSwatch(type, contents, valueObject)

0 comments on commit a56e428

Please sign in to comment.