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

Side by Side Diff: Source/core/css/CSSParserMode.h

Issue 126443005: Use TreeScope::completeURL and baseURL instead of the Document versions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased again, passes tests Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSCursorImageValue.cpp ('k') | Source/core/css/CSSParserMode.cpp » ('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 17 matching lines...) Expand all
28 * SUCH DAMAGE. 28 * SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef CSSParserMode_h 31 #ifndef CSSParserMode_h
32 #define CSSParserMode_h 32 #define CSSParserMode_h
33 33
34 #include "platform/weborigin/KURL.h" 34 #include "platform/weborigin/KURL.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 class Document; 38 class TreeScope;
39 39
40 // Must not grow beyond 3 bits, due to packing in StylePropertySet. 40 // Must not grow beyond 3 bits, due to packing in StylePropertySet.
41 enum CSSParserMode { 41 enum CSSParserMode {
42 HTMLStandardMode, 42 HTMLStandardMode,
43 HTMLQuirksMode, 43 HTMLQuirksMode,
44 // HTML attributes are parsed in quirks mode but also allows internal proper ties and values. 44 // HTML attributes are parsed in quirks mode but also allows internal proper ties and values.
45 HTMLAttributeMode, 45 HTMLAttributeMode,
46 // SVG attributes are parsed in quirks mode but rules differ slightly. 46 // SVG attributes are parsed in quirks mode but rules differ slightly.
47 SVGAttributeMode, 47 SVGAttributeMode,
48 // @viewport rules are parsed in standards mode but CSSOM modifications (via StylePropertySet) 48 // @viewport rules are parsed in standards mode but CSSOM modifications (via StylePropertySet)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 inline bool isUseCounterEnabledForMode(CSSParserMode mode) 85 inline bool isUseCounterEnabledForMode(CSSParserMode mode)
86 { 86 {
87 // We don't count the UA style sheet in our statistics. 87 // We don't count the UA style sheet in our statistics.
88 return mode != UASheetMode; 88 return mode != UASheetMode;
89 } 89 }
90 90
91 class CSSParserContext { 91 class CSSParserContext {
92 WTF_MAKE_FAST_ALLOCATED; 92 WTF_MAKE_FAST_ALLOCATED;
93 public: 93 public:
94 CSSParserContext(CSSParserMode); 94 CSSParserContext(CSSParserMode);
95 CSSParserContext(const Document&, const KURL& baseURL = KURL(), const String & charset = emptyString()); 95 CSSParserContext(const TreeScope&, const KURL& baseURL = KURL(), const Strin g& charset = emptyString());
96 96
97 bool operator==(const CSSParserContext&) const; 97 bool operator==(const CSSParserContext&) const;
98 bool operator!=(const CSSParserContext& other) const { return !(*this == oth er); } 98 bool operator!=(const CSSParserContext& other) const { return !(*this == oth er); }
99 99
100 CSSParserMode mode() const { return m_mode; } 100 CSSParserMode mode() const { return m_mode; }
101 const KURL& baseURL() const { return m_baseURL; } 101 const KURL& baseURL() const { return m_baseURL; }
102 const String& charset() const { return m_charset; } 102 const String& charset() const { return m_charset; }
103 bool isHTMLDocument() const { return m_isHTMLDocument; } 103 bool isHTMLDocument() const { return m_isHTMLDocument; }
104 104
105 // This quirk is to maintain compatibility with Android apps built on 105 // This quirk is to maintain compatibility with Android apps built on
(...skipping 15 matching lines...) Expand all
121 CSSParserMode m_mode; 121 CSSParserMode m_mode;
122 bool m_isHTMLDocument; 122 bool m_isHTMLDocument;
123 bool m_useLegacyBackgroundSizeShorthandBehavior; 123 bool m_useLegacyBackgroundSizeShorthandBehavior;
124 }; 124 };
125 125
126 const CSSParserContext& strictCSSParserContext(); 126 const CSSParserContext& strictCSSParserContext();
127 127
128 }; 128 };
129 129
130 #endif // CSSParserMode_h 130 #endif // CSSParserMode_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSCursorImageValue.cpp ('k') | Source/core/css/CSSParserMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698