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

Side by Side Diff: Source/core/css/CSSParserMode.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 unified diff | Download patch
« no previous file with comments | « Source/core/css/CSSParser-in.cpp ('k') | Source/core/css/StylePropertySet.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * Copyright (C) 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above 9 * 1. Redistributions of source code must retain the above
10 * copyright notice, this list of conditions and the following 10 * copyright notice, this list of conditions and the following
(...skipping 26 matching lines...) Expand all
37 37
38 class Document; 38 class Document;
39 39
40 enum CSSParserMode { 40 enum CSSParserMode {
41 CSSQuirksMode, 41 CSSQuirksMode,
42 CSSStrictMode, 42 CSSStrictMode,
43 // SVG should always be in strict mode. For SVG attributes, the rules differ to strict sometimes. 43 // SVG should always be in strict mode. For SVG attributes, the rules differ to strict sometimes.
44 SVGAttributeMode, 44 SVGAttributeMode,
45 // User agent style sheet should always be in strict mode. Enables internal 45 // User agent style sheet should always be in strict mode. Enables internal
46 // only properties and values. 46 // only properties and values.
47 UASheetMode 47 UASheetMode,
48 // Parsing @viewport descriptors. Always strict. Set as mode on StylePropert ySet
49 // to make sure CSSOM modifications use CSSParser::parseViewportProperty.
50 ViewportMode
48 }; 51 };
49 52
50 inline CSSParserMode strictToCSSParserMode(bool inStrictMode) 53 inline CSSParserMode strictToCSSParserMode(bool inStrictMode)
51 { 54 {
52 return inStrictMode ? CSSStrictMode : CSSQuirksMode; 55 return inStrictMode ? CSSStrictMode : CSSQuirksMode;
53 } 56 }
54 57
55 inline bool isStrictParserMode(CSSParserMode cssParserMode) 58 inline bool isStrictParserMode(CSSParserMode cssParserMode)
56 { 59 {
57 return cssParserMode == CSSStrictMode || cssParserMode == SVGAttributeMode | | cssParserMode == UASheetMode; 60 return cssParserMode != CSSQuirksMode;
58 } 61 }
59 62
60 struct CSSParserContext { 63 struct CSSParserContext {
61 WTF_MAKE_FAST_ALLOCATED; 64 WTF_MAKE_FAST_ALLOCATED;
62 public: 65 public:
63 CSSParserContext(CSSParserMode, const KURL& baseURL = KURL()); 66 CSSParserContext(CSSParserMode, const KURL& baseURL = KURL());
64 CSSParserContext(const Document&, const KURL& baseURL = KURL(), const String & charset = emptyString()); 67 CSSParserContext(const Document&, const KURL& baseURL = KURL(), const String & charset = emptyString());
65 68
66 KURL baseURL; 69 KURL baseURL;
67 String charset; 70 String charset;
(...skipping 11 matching lines...) Expand all
79 }; 82 };
80 83
81 bool operator==(const CSSParserContext&, const CSSParserContext&); 84 bool operator==(const CSSParserContext&, const CSSParserContext&);
82 inline bool operator!=(const CSSParserContext& a, const CSSParserContext& b) { r eturn !(a == b); } 85 inline bool operator!=(const CSSParserContext& a, const CSSParserContext& b) { r eturn !(a == b); }
83 86
84 const CSSParserContext& strictCSSParserContext(); 87 const CSSParserContext& strictCSSParserContext();
85 88
86 }; 89 };
87 90
88 #endif // CSSParserMode_h 91 #endif // CSSParserMode_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSParser-in.cpp ('k') | Source/core/css/StylePropertySet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698