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

Unified Diff: Source/core/css/parser/MediaQueryBlockWatcher.cpp

Issue 225293006: Moved MQ parsing block tracking to tokenizer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed unused member var Created 6 years, 8 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/parser/MediaQueryBlockWatcher.h ('k') | Source/core/css/parser/MediaQueryParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/MediaQueryBlockWatcher.cpp
diff --git a/Source/core/css/parser/MediaQueryBlockWatcher.cpp b/Source/core/css/parser/MediaQueryBlockWatcher.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..fdceea230d04eaa4a2f2a139aef017cf699d0810
--- /dev/null
+++ b/Source/core/css/parser/MediaQueryBlockWatcher.cpp
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/css/parser/MediaQueryBlockWatcher.h"
+
+#include "core/css/parser/MediaQueryToken.h"
+
+namespace WebCore {
+
+MediaQueryBlockWatcher::MediaQueryBlockWatcher()
+ : m_blockLevel(0)
+{
+}
+
+void MediaQueryBlockWatcher::handleToken(const MediaQueryToken& token)
+{
+ if (token.blockType() == MediaQueryToken::BlockStart) {
+ ++m_blockLevel;
+ } else if (token.blockType() == MediaQueryToken::BlockEnd) {
+ ASSERT(m_blockLevel);
+ --m_blockLevel;
+ }
+}
+
+} // namespace
+
« no previous file with comments | « Source/core/css/parser/MediaQueryBlockWatcher.h ('k') | Source/core/css/parser/MediaQueryParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698