Bug 216795

Summary: System color 'canvas' cannot be set or read
Product: WebKit Reporter: Дилян Палаузов <dpa-webkit>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: emilio, koivisto, megan_gardner, simon.fraser, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Дилян Палаузов
Reported 2020-09-21 12:10:17 PDT
The way to obtain the default background color set by the user, is to call function getDefaultBackgroundColor() { let div = document.createElement("div"); div.style.backgroundColor = "canvas"; document.documentElement.appendChild(div); let color = getComputedStyle(div).backgroundColor; div.remove(); return color; } This does not work with WebKitGTK 2.28.1/Epiphany 3.36.4. In particular it allows setting custom CSS, and body.background-color in it, but it is unclear how to use the Canvas keyword as calor there. • How to configure WebKit to change the default canvas system colour, in terms of https://www.w3.org/TR/css-color-4/#css-system-colors • Please make the snippet above work. See also https://bugzilla.mozilla.org/show_bug.cgi?id=1666127 and https://gitlab.gnome.org/GNOME/epiphany/-/issues/1344
Attachments
Emilio Cobos Álvarez (:emilio)
Comment 1 2020-09-21 12:17:01 PDT
Ideally WebKit would support color: canvas and would allow users to change it, otherwise you need to use user stylesheets which don't reliably work.
Radar WebKit Bug Importer
Comment 2 2020-09-22 15:56:27 PDT
Note You need to log in before you can comment on or make changes to this bug.