Packagedom.style.stylesheets
Classpublic class MediaList
InheritanceMediaList Inheritance Object

Introduced in: DOM 2 Core 

The MediaList interface provides the abstraction of an ordered collection of media, without defining or constraining how this collection is implemented. An empty list is the same as a list that contains the medium "all". The items in the MediaList are accessible via an integral index, starting from 0.

See also

W3C - DOM Level 2 Style: MediaList


Public Properties
 PropertyDefined By
  DOM 2 Style length : Number
[read-only] The number of media in the list.
MediaList
  DOM 2 Style mediaText : DOMString
[read-only] The parsable textual representation of the media list.
MediaList
Public Methods
 MethodDefined By
  
DOM 2 Style appendMedium(newMedium:DOMString):void
Adds the medium newMedium to the end of the list.
MediaList
  
DOM 2 Style deleteMedium(oldMedium:DOMString):void
Deletes the medium indicated by oldMedium from the list.
MediaList
Property Detail
DOM 2 Style lengthproperty
length:Number  [read-only]

Introduced in: DOM 2 Core 

The number of media in the list. The range of valid media is 0 to length-1 inclusive.


Implementation
    public function get length():Number

See also

DOM 2 Style mediaTextproperty 
mediaText:DOMString  [read-only]

Introduced in: DOM 2 Core 

The parsable textual representation of the media list. This is a comma-separated list of media.


Implementation
    public function get mediaText():DOMString

Throws
DOMException — SYNTAX_ERR: Raised if the specified string value has a syntax error and is unparsable.
 
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.

See also

Method Detail
DOM 2 Style appendMedium()method
public function appendMedium(newMedium:DOMString):void

Introduced in: DOM 2 Core 

Adds the medium newMedium to the end of the list. If the newMedium is already used, it is first removed.

Parameters

newMedium:DOMString — The new medium to add.


Throws
DOMException — INVALID_CHARACTER_ERR: If the medium contains characters that are invalid in the underlying style language.
 
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.

See also

DOM 2 Style deleteMedium()method 
public function deleteMedium(oldMedium:DOMString):void

Introduced in: DOM 2 Core 

Deletes the medium indicated by oldMedium from the list.

Parameters

oldMedium:DOMString — The medium to delete in the media list.


Throws
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.
 
DOMException — NOT_FOUND_ERR: Raised if oldMedium is not in the list.

See also