I want to reproduce the outline effect for focused input boxes in webkit to non-webkit browsers. I found here the default CSS used in webkit. The lines of interest are:
:focus {
outline: auto 5px -webkit-focus-ring-color
}
I tried making a search in the whole code for the definition -webkit-focus-ring-color here but could not find it anywhere.
-webkit-focus-ring-coloris defined in the WebKit codebase asfocusRingColorin eachRenderThemeclass. That work was performed in June 2009 as part of this changeset by Jeremy Moskovich.For instance, the default Mac theme (used by Safari) defines the colour in
RenderThemeMac.mm(in a roundabout way) as:(Apple’s very light documentation of that property is available online).
There is an override value for the Mac (called
WebCore::oldAquaFocusRingColor) to be used for testing (near as I can tell it’s for the code to be able to perform comparison between the browser rendering and a reference graphic; it is toggled usingWebCore::usesTestModeFocusRingColor). It’s defined inColorMac.mmas the following (which apparently maps toColor(125, 173, 217)):Chromium/Chrome defines the colour in
RenderThemeChromiumSkia.cppas:The default colour (specified in
RenderTheme.h) is pure black: