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

Side by Side Diff: Source/core/css/StyleRule.cpp

Issue 13646013: Enable support for CSS Conditional Rules (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/StyleRule.h ('k') | Source/core/css/StyleSheetContents.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 * (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, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 case Region: 78 case Region:
79 static_cast<const StyleRuleRegion*>(this)->reportDescendantMemoryUsage(m emoryObjectInfo); 79 static_cast<const StyleRuleRegion*>(this)->reportDescendantMemoryUsage(m emoryObjectInfo);
80 return; 80 return;
81 #endif 81 #endif
82 case Import: 82 case Import:
83 static_cast<const StyleRuleImport*>(this)->reportDescendantMemoryUsage(m emoryObjectInfo); 83 static_cast<const StyleRuleImport*>(this)->reportDescendantMemoryUsage(m emoryObjectInfo);
84 return; 84 return;
85 case Keyframes: 85 case Keyframes:
86 static_cast<const StyleRuleKeyframes*>(this)->reportDescendantMemoryUsag e(memoryObjectInfo); 86 static_cast<const StyleRuleKeyframes*>(this)->reportDescendantMemoryUsag e(memoryObjectInfo);
87 return; 87 return;
88 #if ENABLE(CSS3_CONDITIONAL_RULES)
89 case Supports: 88 case Supports:
90 #endif
91 case HostInternal: 89 case HostInternal:
92 static_cast<const StyleRuleHost*>(this)->reportDescendantMemoryUsage(mem oryObjectInfo); 90 static_cast<const StyleRuleHost*>(this)->reportDescendantMemoryUsage(mem oryObjectInfo);
93 return; 91 return;
94 #if ENABLE(CSS_DEVICE_ADAPTATION) 92 #if ENABLE(CSS_DEVICE_ADAPTATION)
95 case Viewport: 93 case Viewport:
96 static_cast<const StyleRuleViewport*>(this)->reportDescendantMemoryUsage (memoryObjectInfo); 94 static_cast<const StyleRuleViewport*>(this)->reportDescendantMemoryUsage (memoryObjectInfo);
97 return; 95 return;
98 #endif 96 #endif
99 case Filter: 97 case Filter:
100 static_cast<const StyleRuleFilter*>(this)->reportDescendantMemoryUsage(m emoryObjectInfo); 98 static_cast<const StyleRuleFilter*>(this)->reportDescendantMemoryUsage(m emoryObjectInfo);
(...skipping 18 matching lines...) Expand all
119 return; 117 return;
120 case Page: 118 case Page:
121 delete static_cast<StyleRulePage*>(this); 119 delete static_cast<StyleRulePage*>(this);
122 return; 120 return;
123 case FontFace: 121 case FontFace:
124 delete static_cast<StyleRuleFontFace*>(this); 122 delete static_cast<StyleRuleFontFace*>(this);
125 return; 123 return;
126 case Media: 124 case Media:
127 delete static_cast<StyleRuleMedia*>(this); 125 delete static_cast<StyleRuleMedia*>(this);
128 return; 126 return;
129 #if ENABLE(CSS3_CONDITIONAL_RULES)
130 case Supports: 127 case Supports:
131 delete static_cast<StyleRuleSupports*>(this); 128 delete static_cast<StyleRuleSupports*>(this);
132 return; 129 return;
133 #endif
134 #if ENABLE(CSS_REGIONS) 130 #if ENABLE(CSS_REGIONS)
135 case Region: 131 case Region:
136 delete static_cast<StyleRuleRegion*>(this); 132 delete static_cast<StyleRuleRegion*>(this);
137 return; 133 return;
138 #endif 134 #endif
139 case Import: 135 case Import:
140 delete static_cast<StyleRuleImport*>(this); 136 delete static_cast<StyleRuleImport*>(this);
141 return; 137 return;
142 case Keyframes: 138 case Keyframes:
143 delete static_cast<StyleRuleKeyframes*>(this); 139 delete static_cast<StyleRuleKeyframes*>(this);
(...skipping 25 matching lines...) Expand all
169 { 165 {
170 switch (type()) { 166 switch (type()) {
171 case Style: 167 case Style:
172 return static_cast<const StyleRule*>(this)->copy(); 168 return static_cast<const StyleRule*>(this)->copy();
173 case Page: 169 case Page:
174 return static_cast<const StyleRulePage*>(this)->copy(); 170 return static_cast<const StyleRulePage*>(this)->copy();
175 case FontFace: 171 case FontFace:
176 return static_cast<const StyleRuleFontFace*>(this)->copy(); 172 return static_cast<const StyleRuleFontFace*>(this)->copy();
177 case Media: 173 case Media:
178 return static_cast<const StyleRuleMedia*>(this)->copy(); 174 return static_cast<const StyleRuleMedia*>(this)->copy();
179 #if ENABLE(CSS3_CONDITIONAL_RULES)
180 case Supports: 175 case Supports:
181 return static_cast<const StyleRuleSupports*>(this)->copy(); 176 return static_cast<const StyleRuleSupports*>(this)->copy();
182 #endif
183 #if ENABLE(CSS_REGIONS) 177 #if ENABLE(CSS_REGIONS)
184 case Region: 178 case Region:
185 return static_cast<const StyleRuleRegion*>(this)->copy(); 179 return static_cast<const StyleRuleRegion*>(this)->copy();
186 #endif 180 #endif
187 case Import: 181 case Import:
188 // FIXME: Copy import rules. 182 // FIXME: Copy import rules.
189 ASSERT_NOT_REACHED(); 183 ASSERT_NOT_REACHED();
190 return 0; 184 return 0;
191 case Keyframes: 185 case Keyframes:
192 return static_cast<const StyleRuleKeyframes*>(this)->copy(); 186 return static_cast<const StyleRuleKeyframes*>(this)->copy();
(...skipping 28 matching lines...) Expand all
221 break; 215 break;
222 case Page: 216 case Page:
223 rule = CSSPageRule::create(static_cast<StyleRulePage*>(self), parentShee t); 217 rule = CSSPageRule::create(static_cast<StyleRulePage*>(self), parentShee t);
224 break; 218 break;
225 case FontFace: 219 case FontFace:
226 rule = CSSFontFaceRule::create(static_cast<StyleRuleFontFace*>(self), pa rentSheet); 220 rule = CSSFontFaceRule::create(static_cast<StyleRuleFontFace*>(self), pa rentSheet);
227 break; 221 break;
228 case Media: 222 case Media:
229 rule = CSSMediaRule::create(static_cast<StyleRuleMedia*>(self), parentSh eet); 223 rule = CSSMediaRule::create(static_cast<StyleRuleMedia*>(self), parentSh eet);
230 break; 224 break;
231 #if ENABLE(CSS3_CONDITIONAL_RULES)
232 case Supports: 225 case Supports:
233 rule = CSSSupportsRule::create(static_cast<StyleRuleSupports*>(self), pa rentSheet); 226 rule = CSSSupportsRule::create(static_cast<StyleRuleSupports*>(self), pa rentSheet);
234 break; 227 break;
235 #endif
236 #if ENABLE(CSS_REGIONS) 228 #if ENABLE(CSS_REGIONS)
237 case Region: 229 case Region:
238 rule = WebKitCSSRegionRule::create(static_cast<StyleRuleRegion*>(self), parentSheet); 230 rule = WebKitCSSRegionRule::create(static_cast<StyleRuleRegion*>(self), parentSheet);
239 break; 231 break;
240 #endif 232 #endif
241 case Import: 233 case Import:
242 rule = CSSImportRule::create(static_cast<StyleRuleImport*>(self), parent Sheet); 234 rule = CSSImportRule::create(static_cast<StyleRuleImport*>(self), parent Sheet);
243 break; 235 break;
244 case Keyframes: 236 case Keyframes:
245 rule = WebKitCSSKeyframesRule::create(static_cast<StyleRuleKeyframes*>(s elf), parentSheet); 237 rule = WebKitCSSKeyframesRule::create(static_cast<StyleRuleKeyframes*>(s elf), parentSheet);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 m_mediaQueries = o.m_mediaQueries->copy(); 413 m_mediaQueries = o.m_mediaQueries->copy();
422 } 414 }
423 415
424 void StyleRuleMedia::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectI nfo) const 416 void StyleRuleMedia::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectI nfo) const
425 { 417 {
426 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); 418 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
427 info.addMember(m_mediaQueries, "mediaQueries"); 419 info.addMember(m_mediaQueries, "mediaQueries");
428 } 420 }
429 421
430 422
431 #if ENABLE(CSS3_CONDITIONAL_RULES)
432 StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool condition IsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) 423 StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool condition IsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules)
433 : StyleRuleGroup(Supports, adoptRules) 424 : StyleRuleGroup(Supports, adoptRules)
434 , m_conditionText(conditionText) 425 , m_conditionText(conditionText)
435 , m_conditionIsSupported(conditionIsSupported) 426 , m_conditionIsSupported(conditionIsSupported)
436 { 427 {
437 } 428 }
438 429
439 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o) 430 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o)
440 : StyleRuleGroup(o) 431 : StyleRuleGroup(o)
441 , m_conditionText(o.m_conditionText) 432 , m_conditionText(o.m_conditionText)
442 , m_conditionIsSupported(o.m_conditionIsSupported) 433 , m_conditionIsSupported(o.m_conditionIsSupported)
443 { 434 {
444 } 435 }
445 #endif
446 436
447 StyleRuleRegion::StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules) 437 StyleRuleRegion::StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules)
448 : StyleRuleGroup(Region, adoptRules) 438 : StyleRuleGroup(Region, adoptRules)
449 { 439 {
450 m_selectorList.adoptSelectorVector(*selectors); 440 m_selectorList.adoptSelectorVector(*selectors);
451 } 441 }
452 442
453 StyleRuleRegion::StyleRuleRegion(const StyleRuleRegion& o) 443 StyleRuleRegion::StyleRuleRegion(const StyleRuleRegion& o)
454 : StyleRuleGroup(o) 444 : StyleRuleGroup(o)
455 , m_selectorList(o.m_selectorList) 445 , m_selectorList(o.m_selectorList)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 } 517 }
528 518
529 void StyleRuleFilter::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObject Info) const 519 void StyleRuleFilter::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObject Info) const
530 { 520 {
531 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); 521 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
532 info.addMember(m_filterName); 522 info.addMember(m_filterName);
533 info.addMember(m_properties); 523 info.addMember(m_properties);
534 } 524 }
535 525
536 } // namespace WebCore 526 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/StyleRule.h ('k') | Source/core/css/StyleSheetContents.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698