Re: Setting mediaText in MediaList Interface

Blaine Brodie wrote:
> 
> Can you please tell me what is the expected behavior in the following case:
> 
> I have a MediaList named 'media'  and I say
>         media.setMediaText("print { h1 {color: blue} }" )
> will this generate a SYNTAX_ERR exception?
> 
> According to the CSS2 grammar this is legal syntax
>         [media: MEDIA_SYM S* medium [ ',' S* medium ]* '{' S* ruleset* '}' S*]
> so I wouldn't expect such an exception.

No, you're mixing media rules and lists of media descriptor. 

The MediaList interface represents the list of media descriptor and,
for CSS2, has the following syntax:
 S* medium [ ',' S* medium ]*

The proposal from Johnny Stenback seems reasonnable to me:

INVALID_CHARACTER_ERR
 If the medium contains characters that are invalid in medium names in the
 underlying style language.

In others words, for a MediaList object within a StyleSheet with type
'text/css', the syntax of the list of media descriptor must follow
the CSS syntax.

Philippe

Received on Saturday, 6 May 2000 14:37:34 UTC