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

Unified Diff: Source/core/css/CSSParser.cpp

Issue 15679021: Parse media attributes and CSSOM media text as media_query_list. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review issues. Created 7 years, 6 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 | « Source/core/css/CSSParser.h ('k') | Source/core/css/MediaList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSParser.cpp
diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
index d5db0eaed4ee12cda89a83751e1f5a1ef1c546cf..d012e306b7cf44536653bddcc82dd75f1f8c27d1 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -1349,19 +1349,17 @@ bool CSSParser::parseDeclaration(MutableStylePropertySet* declaration, const Str
return ok;
}
-PassOwnPtr<MediaQuery> CSSParser::parseMediaQuery(const String& string)
+PassRefPtr<MediaQuerySet> CSSParser::parseMediaQueryList(const String& string)
{
- if (string.isEmpty())
- return nullptr;
-
- ASSERT(!m_mediaQuery);
+ ASSERT(!m_mediaList);
// can't use { because tokenizer state switches from mediaquery to initial state when it sees { token.
// instead insert one " " (which is caught by maybe_space in CSSGrammar.y)
- setupParser("@-webkit-mediaquery ", string, "} ");
+ setupParser("@-internal-medialist ", string, "");
cssyyparse(this);
- return m_mediaQuery.release();
+ ASSERT(m_mediaList.get());
+ return m_mediaList.release();
}
static inline void filterProperties(bool important, const CSSParser::ParsedPropertyVector& input, Vector<CSSProperty, 256>& output, size_t& unusedEntries, BitArray<numCSSProperties>& seenProperties, HashSet<AtomicString>& seenVariables)
@@ -10269,14 +10267,14 @@ inline void CSSParser::detectAtToken(int length, bool hasEscape)
return;
case 19:
- if (!hasEscape && isASCIIAlphaCaselessEqual(name[18], 'r') && isEqualToCSSIdentifier(name + 2, "internal-selecto")) {
+ if (!hasEscape && isASCIIAlphaCaselessEqual(name[18], 'r') && isEqualToCSSIdentifier(name + 2, "internal-selecto"))
m_token = INTERNAL_SELECTOR_SYM;
- return;
- }
+ return;
- if (isEqualToCSSIdentifier(name + 2, "webkit-mediaquery")) {
+ case 20:
+ if (isEqualToCSSIdentifier(name + 2, "internal-medialist")) {
m_parsingMode = MediaQueryMode;
- m_token = WEBKIT_MEDIAQUERY_SYM;
+ m_token = INTERNAL_MEDIALIST_SYM;
}
return;
« no previous file with comments | « Source/core/css/CSSParser.h ('k') | Source/core/css/MediaList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698