W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2001

Re: Interface StyleSheet: title readonly but media can be changed?

From: Philippe Le Hegaret <plh@w3.org>
Date: Mon, 22 Jan 2001 16:16:54 -0500
Message-ID: <3A6CA346.D2F30148@w3.org>
To: Ian Hickson <ian@hixie.ch>
Cc: www-dom@w3.org
Ian Hickson wrote:
> 
> While writing some tests for the StyleSheet interface, I came across a
> seeming inconsistency:
> 
> Why are 'href', 'type', and 'title' readonly, while the media attribute
> can be changed through its MediaList interface?
> 
> If someone could shed some light on this I would be very thankful...

The obscur reason was that the user should not be able to modify the linking
element through the stylesheet itself. Even if this reason is obvious for
the href attribute, this is not especially the case for type and title. In
case, media should be harmonized with type and title. But, if the media list
is readonly, the MediaList interface becomes almost useless.

> If one changes the media list of a StyleSheet interface that is associated
> with a particular node in the DOM, e.g. a <link> element, should the
> changes be reflected back in this node?

I would say yes but we might need to reconsider the readonly issue before going
further.

> e.g. assuming the element has:
> 
>    <link rel="stylesheet" href="foo.css">
> 
> ...and I do:
> 
>    document.styleSheets.item(0).media.appendMedium('braille');
> 
> ...should the element then become:
> 
>    <link rel="stylesheet" href="foo.css" media="braille">
> 
> ...?
> 
> How about if the stylesheet was linked using an @import, or an HTTP 'Link'
> header? Should those be changed too?

I would say yes too. If you change the media attribute in the CSS import rule,
you'll expect the media list to be updated, won't you?

Philippe
Received on Monday, 22 January 2001 16:16:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT