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

Side by Side Diff: sky/engine/core/css/StyleRule.h

Issue 654693004: Remove meta viewport and @viewport CSS rules. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2006, 2008, 2012, 2013 Apple Inc. All rights reserved. 4 * Copyright (C) 2002, 2006, 2008, 2012, 2013 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 28 matching lines...) Expand all
39 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; 39 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
40 public: 40 public:
41 enum Type { 41 enum Type {
42 Unknown, // Not used. 42 Unknown, // Not used.
43 Style, 43 Style,
44 Media, 44 Media,
45 FontFace = 4, 45 FontFace = 4,
46 Keyframes = 5, 46 Keyframes = 5,
47 Keyframe, // Not used. These are internally non-rule StyleKeyframe objec ts. 47 Keyframe, // Not used. These are internally non-rule StyleKeyframe objec ts.
48 Supports = 12, 48 Supports = 12,
49 Viewport = 15,
50 Filter = 17 49 Filter = 17
51 }; 50 };
52 51
53 Type type() const { return static_cast<Type>(m_type); } 52 Type type() const { return static_cast<Type>(m_type); }
54 53
55 bool isFontFaceRule() const { return type() == FontFace; } 54 bool isFontFaceRule() const { return type() == FontFace; }
56 bool isKeyframesRule() const { return type() == Keyframes; } 55 bool isKeyframesRule() const { return type() == Keyframes; }
57 bool isMediaRule() const { return type() == Media; } 56 bool isMediaRule() const { return type() == Media; }
58 bool isStyleRule() const { return type() == Style; } 57 bool isStyleRule() const { return type() == Style; }
59 bool isSupportsRule() const { return type() == Supports; } 58 bool isSupportsRule() const { return type() == Supports; }
60 bool isViewportRule() const { return type() == Viewport; }
61 bool isFilterRule() const { return type() == Filter; } 59 bool isFilterRule() const { return type() == Filter; }
62 60
63 PassRefPtrWillBeRawPtr<StyleRuleBase> copy() const; 61 PassRefPtrWillBeRawPtr<StyleRuleBase> copy() const;
64 62
65 #if !ENABLE(OILPAN) 63 #if !ENABLE(OILPAN)
66 void deref() 64 void deref()
67 { 65 {
68 if (derefBase()) 66 if (derefBase())
69 destroy(); 67 destroy();
70 } 68 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 void traceAfterDispatch(Visitor* visitor) { StyleRuleGroup::traceAfterDispat ch(visitor); } 192 void traceAfterDispatch(Visitor* visitor) { StyleRuleGroup::traceAfterDispat ch(visitor); }
195 193
196 private: 194 private:
197 StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Wi llBeHeapVector<RefPtrWillBeMember<StyleRuleBase> >& adoptRules); 195 StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Wi llBeHeapVector<RefPtrWillBeMember<StyleRuleBase> >& adoptRules);
198 StyleRuleSupports(const StyleRuleSupports&); 196 StyleRuleSupports(const StyleRuleSupports&);
199 197
200 String m_conditionText; 198 String m_conditionText;
201 bool m_conditionIsSupported; 199 bool m_conditionIsSupported;
202 }; 200 };
203 201
204 class StyleRuleViewport : public StyleRuleBase {
205 public:
206 static PassRefPtrWillBeRawPtr<StyleRuleViewport> create() { return adoptRefW illBeNoop(new StyleRuleViewport); }
207
208 ~StyleRuleViewport();
209
210 const StylePropertySet& properties() const { return *m_properties; }
211 MutableStylePropertySet& mutableProperties();
212
213 void setProperties(PassRefPtrWillBeRawPtr<StylePropertySet>);
214
215 PassRefPtrWillBeRawPtr<StyleRuleViewport> copy() const { return adoptRefWill BeNoop(new StyleRuleViewport(*this)); }
216
217 void traceAfterDispatch(Visitor*);
218
219 private:
220 StyleRuleViewport();
221 StyleRuleViewport(const StyleRuleViewport&);
222
223 RefPtrWillBeMember<StylePropertySet> m_properties; // Cannot be null
224 };
225
226 class StyleRuleFilter : public StyleRuleBase { 202 class StyleRuleFilter : public StyleRuleBase {
227 public: 203 public:
228 static PassRefPtrWillBeRawPtr<StyleRuleFilter> create(const String& filterNa me) { return adoptRefWillBeNoop(new StyleRuleFilter(filterName)); } 204 static PassRefPtrWillBeRawPtr<StyleRuleFilter> create(const String& filterNa me) { return adoptRefWillBeNoop(new StyleRuleFilter(filterName)); }
229 205
230 ~StyleRuleFilter(); 206 ~StyleRuleFilter();
231 207
232 const String& filterName() const { return m_filterName; } 208 const String& filterName() const { return m_filterName; }
233 209
234 const StylePropertySet& properties() const { return *m_properties; } 210 const StylePropertySet& properties() const { return *m_properties; }
235 MutableStylePropertySet& mutableProperties(); 211 MutableStylePropertySet& mutableProperties();
(...skipping 12 matching lines...) Expand all
248 RefPtrWillBeMember<StylePropertySet> m_properties; 224 RefPtrWillBeMember<StylePropertySet> m_properties;
249 }; 225 };
250 226
251 #define DEFINE_STYLE_RULE_TYPE_CASTS(Type) \ 227 #define DEFINE_STYLE_RULE_TYPE_CASTS(Type) \
252 DEFINE_TYPE_CASTS(StyleRule##Type, StyleRuleBase, rule, rule->is##Type##Rule (), rule.is##Type##Rule()) 228 DEFINE_TYPE_CASTS(StyleRule##Type, StyleRuleBase, rule, rule->is##Type##Rule (), rule.is##Type##Rule())
253 229
254 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt yleRule()); 230 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt yleRule());
255 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); 231 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace);
256 DEFINE_STYLE_RULE_TYPE_CASTS(Media); 232 DEFINE_STYLE_RULE_TYPE_CASTS(Media);
257 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); 233 DEFINE_STYLE_RULE_TYPE_CASTS(Supports);
258 DEFINE_STYLE_RULE_TYPE_CASTS(Viewport);
259 DEFINE_STYLE_RULE_TYPE_CASTS(Filter); 234 DEFINE_STYLE_RULE_TYPE_CASTS(Filter);
260 235
261 } // namespace blink 236 } // namespace blink
262 237
263 #endif // StyleRule_h 238 #endif // StyleRule_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698