Bug 154525
| Summary: | Web Inspector: Autocomplete CSS system colors | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Nikita Vasilyev <nvasilyev> |
| Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | inspector-bugzilla-changes, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | All | ||
| OS: | All | ||
Nikita Vasilyev
The following:
background-color: H|
should autocomplete with "Highlight".
All the system keywords: https://www.w3.org/TR/CSS2/ui.html#system-colors
Although this spec is deprecated, it is still supported by WebKit and all
major browsers.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/24763778>
Joseph Pecoraro
I notice you didn't assign this bug to you. Are you going to put up a patch for this?
What is interesting about this is that the actual color is only known by the backend, not the frontend. So to produce an accurate color swatch for "highlight" you have to check what "highlight" actually resolves to on the target. This is important remotely inspecting a target.
You could for instance evaluate some JavaScript and get the computed style of something with that color. Note the element has to be in the DOM, so appending to the <head> ensures the element won't cause any visible change to the page when doing the calculation:
var span = document.createElement("span");
span.style.backgroundColor = "highlight";
document.head.appendChild(span);
var rgbColor = getComputedStyle(span).backgroundColor;
span.remove();
rgbColor // rgb(...)
Nikita Vasilyev
(In reply to comment #2)
> I notice you didn't assign this bug to you. Are you going to put up a patch
> for this?
Nope.
I intentionally didn't assign it to myself and added "GoodFirstBug" keyword.
>
> What is interesting about this is that the actual color is only known by the
> backend, not the frontend. So to produce an accurate color swatch for
> "highlight" you have to check what "highlight" actually resolves to on the
> target. This is important remotely inspecting a target. [...]
Good catch! I didn't realise it would be that complicated.