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. -Jer