W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2012

[whatwg] Allowing custom attributes on <html> or <body> in documents for media resources

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 30 Jan 2012 22:10:28 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1201302207370.3868@ps20323.dreamhostps.com>
On Thu, 10 Nov 2011, Robert O'Callahan wrote:
>
> http://www.whatwg.org/specs/web-apps/current-work/#read-media
>
> Can we allow the UA to add custom vendor-prefixed attributes to the 
> <html> and/or <body> elements? Alternatively, a vendor-prefixed class? 
> We want to be able to use a style sheet with rules matching custom 
> attributes to indicate various situations (e.g., whether the document is 
> a toplevel browsing context) to set the viewport background.

On Tue, 15 Nov 2011, Tab Atkins Jr. wrote:
> 
> While I'd normally object that classes are purely an author extension 
> point and UAs should stay out, this is a UA-generated page in the first 
> place so it's not a big deal.
> 
> I might suggest using a pseudoclass instead, though, as that's the 
> normal UA extension point.  Is there any particular reason to prefer a 
> class over a pseudoclass?

On Wed, 16 Nov 2011, Robert O'Callahan wrote:
> 
> It's a little bit more code to implement a pseudoclass, at least in 
> Gecko. (It's literally one line to add a custom class or attribute; the 
> situation is probably similar in other engines.)
> 
> If a custom attribute seems better to you, that's just as easy as a 
> class.

On Tue, 15 Nov 2011, Tab Atkins Jr. wrote:
> 
> I'm slightly happier with a custom attribute, yeah, just from a purity 
> standpoint.  It's equivalent otherwise.

On Wed, 16 Nov 2011, Robert O'Callahan wrote:
>
> Very well then, I propose that a "toplevel" attribute be added to the 
> root element of media resource documents in toplevel browsing contexts 
> :-).

Is there any reason you can't just put whatever styles you want into a 
<style> element? It's not clear to me why you need to reference a global 
style sheet rather than referencing or generating a style sheet 
specifically for each case.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 30 January 2012 14:10:28 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:10 UTC