Chromium Code Reviews| Index: Source/core/css/MediaList.h |
| diff --git a/Source/core/css/MediaList.h b/Source/core/css/MediaList.h |
| index cc6903552ba272db8496fd6e6f191a9b6e56f5c5..0ecc20c199a08aef7e7a53b0e91d5bd171f9c2b5 100644 |
| --- a/Source/core/css/MediaList.h |
| +++ b/Source/core/css/MediaList.h |
| @@ -36,6 +36,12 @@ class Document; |
| class MediaList; |
| class MediaQuery; |
| +enum MediaQueryParserMode { |
| + MediaQueryNormalMode, |
| + MediaQueryForwardCompatibleSyntaxMode, |
| + MediaQueryStrictMode, |
| +}; |
| + |
| class MediaQuerySet : public RefCounted<MediaQuerySet> { |
| public: |
| static PassRefPtr<MediaQuerySet> create() |
| @@ -44,15 +50,15 @@ public: |
| } |
| static PassRefPtr<MediaQuerySet> create(const String& mediaString) |
| { |
| - return adoptRef(new MediaQuerySet(mediaString, false)); |
| + return adoptRef(new MediaQuerySet(mediaString, MediaQueryNormalMode)); |
| } |
| static PassRefPtr<MediaQuerySet> createAllowingDescriptionSyntax(const String& mediaString) |
| { |
| - return adoptRef(new MediaQuerySet(mediaString, true)); |
| + return adoptRef(new MediaQuerySet(mediaString, MediaQueryForwardCompatibleSyntaxMode)); |
| } |
| ~MediaQuerySet(); |
| - bool parse(const String&); |
| + bool set(const String&); |
| bool add(const String&); |
| bool remove(const String&); |
| @@ -71,13 +77,14 @@ public: |
| private: |
| MediaQuerySet(); |
| - MediaQuerySet(const String& mediaQuery, bool fallbackToDescription); |
| + MediaQuerySet(const String& mediaQuery, MediaQueryParserMode); |
| MediaQuerySet(const MediaQuerySet&); |
| - PassOwnPtr<MediaQuery> parseMediaQuery(const String&); |
| + PassOwnPtr<MediaQuery> parseMediaQuery(const String&, MediaQueryParserMode); |
| + void parseMediaQueryList(const String&, MediaQueryParserMode, Vector<OwnPtr<MediaQuery> >& result); |
| - unsigned m_fallbackToDescriptor : 1; // true if failed media query parsing should fallback to media description parsing. |
| - signed m_lastLine : 31; |
| + MediaQueryParserMode m_parserMode; |
|
apavlov
2013/05/29 15:44:36
Should this occupy 2 bits, and m_lastLine (added b
kenneth.r.christiansen
2013/05/29 15:52:56
Sounds fine. Let me do that change
|
| + unsigned m_lastLine : 31; |
| Vector<OwnPtr<MediaQuery> > m_queries; |
| }; |
| @@ -100,7 +107,7 @@ public: |
| void appendMedium(const String& newMedium, ExceptionCode&); |
| String mediaText() const { return m_mediaQueries->mediaText(); } |
| - void setMediaText(const String&, ExceptionCode&); |
| + void setMediaText(const String&); |
| // Not part of CSSOM. |
| CSSRule* parentRule() const { return m_parentRule; } |