[webkit-dev] webkit-resource: referring to resources in User Agent stylesheet

Dimitri Glazkov dglazkov at chromium.org
Tue Apr 26 13:45:20 PDT 2011


On Tue, Apr 26, 2011 at 1:27 PM, Jer Noble <jer.noble at apple.com> wrote:
>
> On Apr 26, 2011, at 1:18 PM, Dimitri Glazkov wrote:
>
> SOLUTION: Looking at the current media controls implementations, most
> of the -webkit-appearance states are kind of like background images,
> each reflecting appearance of an element at a particular state. Thus,
> it seems we should be able to solve this by just using CSS
> backgrounds:
>
> video:playing::-webkit-media-controls-play-button:hover {
>   background: url(/media-controls/play-button-hover.png);
> }
>
> That is how the authors would style the media controls. However, at
> the UA level, we shouldn't probably be loading resources from random
> sites. Instead, we need a way to bake these images into the WebKit
> runtime, and then a way to refer to them from the stylesheet.
>
> This is where a vendor-specific URL scheme comes in:
>
> video:playing::-webkit-media-controls-play-button:hover {
>   background: url(webkit-resource:/media-controls/play-button-hover.png);
> }
>
> A quick poll of smart people (abarth and smfr) seems to indicate it's
> not a completely horrid idea.
>
> WDYT? Thoughts? Comments?
>
> FWIW, WebKit/mac generates these images programmatically, so there's not
> really a URL for "play button hover state" which can be targeted.  That
> said, if the URL scheme could be overloaded to handle generated content, I
> guess this could still work.  WebKit/mac could either parse the URL path and
> special case "media-controls/play-button-hover.png", or define our own URL
> scheme, e.g. "background:
> url(webkit-generated:media-play-button-playing-hover);"  But then we're just
> back to something functionally identical to -webkit-appearance.
> I guess what I'm getting at is, if support for webkit-resource: is added,
> great.  However, at least one port will still need the old behavior.

Yes! The -webkit-appearance must stay. This is purely an additive thing.

> -Jer
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>


More information about the webkit-dev mailing list