[Webkit-unassigned] [Bug 154525] Web Inspector: Autocomplete CSS system colors

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 21 22:53:08 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=154525

--- Comment #2 from Joseph Pecoraro <joepeck at webkit.org> ---
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(...)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160222/6ac345e0/attachment.html>


More information about the webkit-unassigned mailing list