The manakai project

Web::CSS::MediaQueries::Parser

Parsing Media Queries

SYNOPSIS

  use Web::CSS::MediaQueries::Parser;
  my $s = Web::CSS::MediaQueries::Parser->new;
  $parsed = $s->parse_char_string_as_mq_list ($string)

DESCRIPTION

The Web::CSS::MediaQueries::Parser object can be used to parse a list of media queries or a media query, used in CSS, HTML, and other languages.

METHODS

Following methods are available:

$parser = Web::CSS::MediaQueries::Parser->new

Return a new instance of the parser.

$code = $parser->onerror
$parser->onerror ($code)

Return or specify the code reference to which any errors and warnings during the parsing is reported.

XXX

$mr = $parser->media_resolver
$parser->media_resolver ($mr)

Return or specify the Web::CSS::MediaResolver object for parsing.

$parsed = $parser->parse_char_string_as_mq ($string)

Parse the specified character string as a media query. If the string represents a media query, the parsed representation of the query is returned. Otherwise, undef is returned.

In most cases, you don't want to call this method. Instead, use the parse_char_string_as_mq_list method.

$parsed = $parser->parse_char_string_as_mq_list ($string)

Parse the specified character string as a list of media queries. The parsed representation of the queries is returned. (Any strung can be interpreted as a list of media queries, whether valid or not.)

DATA STRUCTURES

XXX

SPECIFICATIONS

MQ

Media Queries <http://dev.w3.org/csswg/mediaqueries/>.

CSSOM

CSSOM <http://dev.w3.org/csswg/cssom/#media-queries>.

SEE ALSO

Web::CSS::MediaQueries::Serializer.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2008-2013 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.