Bug 222747 - Web Inspector: border color of "grid" badge should match color of corresponding outline
Summary: Web Inspector: border color of "grid" badge should match color of correspondi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-04 09:50 PST by Nikita Vasilyev
Modified: 2021-03-05 11:54 PST (History)
5 users (show)

See Also:


Attachments
Patch (4.42 KB, patch)
2021-03-04 12:54 PST, Nikita Vasilyev
bburg: review+
Details | Formatted Diff | Diff
[Video] With patch applied (25.93 MB, video/quicktime)
2021-03-04 12:57 PST, Nikita Vasilyev
no flags Details
Patch (4.42 KB, patch)
2021-03-05 10:58 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2021-03-04 09:50:09 PST
Say, if the particular grid outline is pink, its badge should have a pink border when activated.
This will allow to mentally grid elements in the DOM tree outline to their corresponding outlines (Maciej's feedback was that, currently, you have to interact with the Layout panel to understand the outline colors).
Comment 1 Radar WebKit Bug Importer 2021-03-04 09:51:15 PST
<rdar://problem/75042342>
Comment 2 Nikita Vasilyev 2021-03-04 12:54:56 PST
Created attachment 422275 [details]
Patch
Comment 3 Nikita Vasilyev 2021-03-04 12:57:22 PST
Created attachment 422276 [details]
[Video] With patch applied
Comment 4 BJ Burg 2021-03-05 10:31:55 PST
Comment on attachment 422275 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=422275&action=review

r=me with a question

> Source/WebInspectorUI/ChangeLog:18
> +        For text and background color, only use the hue of the selected color to keep "grid" text always readable.

Good idea.

> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.css:38
> +    box-shadow: 0 0 1px hsla(0, 0%, 0%, 0.5);

Is this even noticeable? I couldn't see it in the attached video.

> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:2063
> +        let color = WI.overlayManager.getGridColorForNode(this.representedObject);

Is this fallible if the DOMNode is not known by WI.overlayManager?
Comment 5 Devin Rousso 2021-03-05 10:41:47 PST
Comment on attachment 422275 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=422275&action=review

>> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:2063
>> +        let color = WI.overlayManager.getGridColorForNode(this.representedObject);
> 
> Is this fallible if the DOMNode is not known by WI.overlayManager?

Somewhat along those lines, does this badge also appear in the Console?  Do we want that?
Comment 6 Nikita Vasilyev 2021-03-05 10:52:46 PST
Comment on attachment 422275 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=422275&action=review

>> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.css:38
>> +    box-shadow: 0 0 1px hsla(0, 0%, 0%, 0.5);
> 
> Is this even noticeable? I couldn't see it in the attached video.

It's more noticeable when the color is very light. Extreme example — white.

>>> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:2063
>>> +        let color = WI.overlayManager.getGridColorForNode(this.representedObject);
>> 
>> Is this fallible if the DOMNode is not known by WI.overlayManager?
> 
> Somewhat along those lines, does this badge also appear in the Console?  Do we want that?

BJ: It wouldn't have `this._gridBadgeElement` and would return a few lines above (line 2057).
Looking at this code again, I think I should move this line inside of the `if (isGridVisible) {...}`.

Devin: yes, it does. I think we do want that.
Comment 7 Nikita Vasilyev 2021-03-05 10:58:31 PST
Created attachment 422385 [details]
Patch
Comment 8 EWS 2021-03-05 11:54:24 PST
Committed r273992: <https://commits.webkit.org/r273992>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 422385 [details].