Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Unified Diff: Source/core/css/MediaList.h

Issue 15094019: Fixing inconsistency with Media Query append/deleteMedium. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: For landing Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/media/mq-js-stylesheet-media-03-expected.html ('k') | Source/core/css/MediaList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaList.h
diff --git a/Source/core/css/MediaList.h b/Source/core/css/MediaList.h
index cc6903552ba272db8496fd6e6f191a9b6e56f5c5..0b201ef7181dd6800d504676fdd0f1ed531449e6 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,16 @@ 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);
+
+ MediaQueryParserMode parserMode() const { return static_cast<MediaQueryParserMode>(m_parserMode); }
- unsigned m_fallbackToDescriptor : 1; // true if failed media query parsing should fallback to media description parsing.
- signed m_lastLine : 31;
+ unsigned m_parserMode : 2;
+ unsigned m_lastLine : 30;
Vector<OwnPtr<MediaQuery> > m_queries;
};
@@ -100,7 +109,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; }
« no previous file with comments | « LayoutTests/fast/media/mq-js-stylesheet-media-03-expected.html ('k') | Source/core/css/MediaList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698