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

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

Issue 22917005: New parser mode for CSSOM @viewport descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More comments added. Created 7 years, 3 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/css3/device-adapt/viewport-cssom-01-expected.txt ('k') | Source/core/css/CSSParser-in.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSParser.h
diff --git a/Source/core/css/CSSParser.h b/Source/core/css/CSSParser.h
index 275e55d2f7d73dc75ce149e4021ef870797956cf..6d0e2702d4115c39bc8b0bae4823fcbca75e4288 100644
--- a/Source/core/css/CSSParser.h
+++ b/Source/core/css/CSSParser.h
@@ -34,6 +34,7 @@
#include "core/css/CSSPropertySourceData.h"
#include "core/css/CSSSelector.h"
#include "core/css/MediaQuery.h"
+#include "core/css/StylePropertySet.h"
#include "core/page/UseCounter.h"
#include "core/platform/graphics/Color.h"
#include "wtf/HashSet.h"
@@ -459,6 +460,30 @@ private:
WebCore::CSSParser* m_parser;
};
+ class StyleDeclarationScope {
+ WTF_MAKE_NONCOPYABLE(StyleDeclarationScope);
+ public:
+ StyleDeclarationScope(CSSParser* parser, const StylePropertySet* declaration)
+ : m_parser(parser)
+ , m_mode(declaration->cssParserMode())
+ {
+ if (m_mode == ViewportMode) {
+ ASSERT(!m_parser->inViewport());
+ m_parser->markViewportRuleBodyStart();
+ }
+ }
+
+ ~StyleDeclarationScope()
+ {
+ if (m_mode == ViewportMode)
+ m_parser->markViewportRuleBodyEnd();
+ }
+
+ private:
+ CSSParser* m_parser;
+ CSSParserMode m_mode;
+ };
+
bool is8BitSource() const { return m_is8BitSource; }
template <typename SourceCharacterType>
@@ -536,7 +561,7 @@ private:
void setStyleSheet(StyleSheetContents* styleSheet) { m_styleSheet = styleSheet; }
- inline bool inStrictMode() const { return m_context.mode == CSSStrictMode || m_context.mode == SVGAttributeMode; }
+ inline bool inStrictMode() const { return isStrictParserMode(m_context.mode); }
inline bool inQuirksMode() const { return m_context.mode == CSSQuirksMode; }
KURL completeURL(const String& url) const;
« no previous file with comments | « LayoutTests/css3/device-adapt/viewport-cssom-01-expected.txt ('k') | Source/core/css/CSSParser-in.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698