W3C home > Mailing lists > Public > www-style@w3.org > July 2014

Re: [css-device-adapt] Target node for application of the style properties

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 23 Jul 2014 11:04:03 -0700
Message-ID: <CAAWBYDCp2OSAASg-eHk=bCty1Chj8XkV0O6M5f5Th2PRpcTBkA@mail.gmail.com>
To: Dylan Barrell <dylan.barrell@deque.com>
Cc: www-style list <www-style@w3.org>
[sorry for the delay; our moderation queue was just cleared]

On Wed, Jun 4, 2014 at 6:02 AM, Dylan Barrell <dylan.barrell@deque.com> wrote:
> I have read through the draft at http://dev.w3.org/csswg/css-device-adapt/
> and I cannot find any specification of which HTML node the style properties
> will be applied against or how they can be read and set from JavaScript.
>
> Is this content still pending?

The properties in a @viewport rule don't apply to any element, they
apply to the viewport itself.

They can be read from JS using the normal CSSOM methods - get the
stylesheet object, iterate the rules until you find the @viewport one,
then get its .style property.  This isn't particularly convenient (the
CSSOM isn't very well-designed), but it'll do.

~TJ
Received on Wednesday, 23 July 2014 18:04:50 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:23 UTC