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

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

Issue 143323014: *** DO NOT LAND *** Attempt to understand Regions complexity Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/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 11 matching lines...) Expand all
22 #include "config.h" 22 #include "config.h"
23 #include "core/css/StyleRule.h" 23 #include "core/css/StyleRule.h"
24 24
25 #include "RuntimeEnabledFeatures.h" 25 #include "RuntimeEnabledFeatures.h"
26 #include "core/css/CSSFilterRule.h" 26 #include "core/css/CSSFilterRule.h"
27 #include "core/css/CSSFontFaceRule.h" 27 #include "core/css/CSSFontFaceRule.h"
28 #include "core/css/CSSImportRule.h" 28 #include "core/css/CSSImportRule.h"
29 #include "core/css/CSSKeyframesRule.h" 29 #include "core/css/CSSKeyframesRule.h"
30 #include "core/css/CSSMediaRule.h" 30 #include "core/css/CSSMediaRule.h"
31 #include "core/css/CSSPageRule.h" 31 #include "core/css/CSSPageRule.h"
32 #include "core/css/CSSRegionRule.h"
33 #include "core/css/CSSStyleRule.h" 32 #include "core/css/CSSStyleRule.h"
34 #include "core/css/CSSSupportsRule.h" 33 #include "core/css/CSSSupportsRule.h"
35 #include "core/css/CSSViewportRule.h" 34 #include "core/css/CSSViewportRule.h"
36 #include "core/css/StylePropertySet.h" 35 #include "core/css/StylePropertySet.h"
37 #include "core/css/StyleRuleImport.h" 36 #include "core/css/StyleRuleImport.h"
38 37
39 namespace WebCore { 38 namespace WebCore {
40 39
41 struct SameSizeAsStyleRuleBase : public WTF::RefCountedBase { 40 struct SameSizeAsStyleRuleBase : public WTF::RefCountedBase {
42 unsigned bitfields; 41 unsigned bitfields;
(...skipping 22 matching lines...) Expand all
65 return; 64 return;
66 case FontFace: 65 case FontFace:
67 delete toStyleRuleFontFace(this); 66 delete toStyleRuleFontFace(this);
68 return; 67 return;
69 case Media: 68 case Media:
70 delete toStyleRuleMedia(this); 69 delete toStyleRuleMedia(this);
71 return; 70 return;
72 case Supports: 71 case Supports:
73 delete toStyleRuleSupports(this); 72 delete toStyleRuleSupports(this);
74 return; 73 return;
75 case Region:
76 delete toStyleRuleRegion(this);
77 return;
78 case Import: 74 case Import:
79 delete toStyleRuleImport(this); 75 delete toStyleRuleImport(this);
80 return; 76 return;
81 case Keyframes: 77 case Keyframes:
82 delete toStyleRuleKeyframes(this); 78 delete toStyleRuleKeyframes(this);
83 return; 79 return;
84 case Viewport: 80 case Viewport:
85 delete toStyleRuleViewport(this); 81 delete toStyleRuleViewport(this);
86 return; 82 return;
87 case Filter: 83 case Filter:
(...skipping 14 matching lines...) Expand all
102 case Style: 98 case Style:
103 return toStyleRule(this)->copy(); 99 return toStyleRule(this)->copy();
104 case Page: 100 case Page:
105 return toStyleRulePage(this)->copy(); 101 return toStyleRulePage(this)->copy();
106 case FontFace: 102 case FontFace:
107 return toStyleRuleFontFace(this)->copy(); 103 return toStyleRuleFontFace(this)->copy();
108 case Media: 104 case Media:
109 return toStyleRuleMedia(this)->copy(); 105 return toStyleRuleMedia(this)->copy();
110 case Supports: 106 case Supports:
111 return toStyleRuleSupports(this)->copy(); 107 return toStyleRuleSupports(this)->copy();
112 case Region:
113 return toStyleRuleRegion(this)->copy();
114 case Import: 108 case Import:
115 // FIXME: Copy import rules. 109 // FIXME: Copy import rules.
116 ASSERT_NOT_REACHED(); 110 ASSERT_NOT_REACHED();
117 return 0; 111 return 0;
118 case Keyframes: 112 case Keyframes:
119 return toStyleRuleKeyframes(this)->copy(); 113 return toStyleRuleKeyframes(this)->copy();
120 case Viewport: 114 case Viewport:
121 return toStyleRuleViewport(this)->copy(); 115 return toStyleRuleViewport(this)->copy();
122 case Filter: 116 case Filter:
123 return toStyleRuleFilter(this)->copy(); 117 return toStyleRuleFilter(this)->copy();
(...skipping 20 matching lines...) Expand all
144 break; 138 break;
145 case FontFace: 139 case FontFace:
146 rule = CSSFontFaceRule::create(toStyleRuleFontFace(self), parentSheet); 140 rule = CSSFontFaceRule::create(toStyleRuleFontFace(self), parentSheet);
147 break; 141 break;
148 case Media: 142 case Media:
149 rule = CSSMediaRule::create(toStyleRuleMedia(self), parentSheet); 143 rule = CSSMediaRule::create(toStyleRuleMedia(self), parentSheet);
150 break; 144 break;
151 case Supports: 145 case Supports:
152 rule = CSSSupportsRule::create(toStyleRuleSupports(self), parentSheet); 146 rule = CSSSupportsRule::create(toStyleRuleSupports(self), parentSheet);
153 break; 147 break;
154 case Region:
155 rule = CSSRegionRule::create(toStyleRuleRegion(self), parentSheet);
156 break;
157 case Import: 148 case Import:
158 rule = CSSImportRule::create(toStyleRuleImport(self), parentSheet); 149 rule = CSSImportRule::create(toStyleRuleImport(self), parentSheet);
159 break; 150 break;
160 case Keyframes: 151 case Keyframes:
161 rule = CSSKeyframesRule::create(toStyleRuleKeyframes(self), parentSheet) ; 152 rule = CSSKeyframesRule::create(toStyleRuleKeyframes(self), parentSheet) ;
162 break; 153 break;
163 case Viewport: 154 case Viewport:
164 rule = CSSViewportRule::create(toStyleRuleViewport(self), parentSheet); 155 rule = CSSViewportRule::create(toStyleRuleViewport(self), parentSheet);
165 break; 156 break;
166 case Filter: 157 case Filter:
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 { 300 {
310 } 301 }
311 302
312 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o) 303 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o)
313 : StyleRuleGroup(o) 304 : StyleRuleGroup(o)
314 , m_conditionText(o.m_conditionText) 305 , m_conditionText(o.m_conditionText)
315 , m_conditionIsSupported(o.m_conditionIsSupported) 306 , m_conditionIsSupported(o.m_conditionIsSupported)
316 { 307 {
317 } 308 }
318 309
319 StyleRuleRegion::StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules)
320 : StyleRuleGroup(Region, adoptRules)
321 {
322 ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled());
323 m_selectorList.adoptSelectorVector(*selectors);
324 }
325
326 StyleRuleRegion::StyleRuleRegion(const StyleRuleRegion& o)
327 : StyleRuleGroup(o)
328 , m_selectorList(o.m_selectorList)
329 {
330 ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled());
331 }
332
333 StyleRuleViewport::StyleRuleViewport() 310 StyleRuleViewport::StyleRuleViewport()
334 : StyleRuleBase(Viewport) 311 : StyleRuleBase(Viewport)
335 { 312 {
336 } 313 }
337 314
338 StyleRuleViewport::StyleRuleViewport(const StyleRuleViewport& o) 315 StyleRuleViewport::StyleRuleViewport(const StyleRuleViewport& o)
339 : StyleRuleBase(o) 316 : StyleRuleBase(o)
340 , m_properties(o.m_properties->mutableCopy()) 317 , m_properties(o.m_properties->mutableCopy())
341 { 318 {
342 } 319 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 m_properties = m_properties->mutableCopy(); 357 m_properties = m_properties->mutableCopy();
381 return toMutableStylePropertySet(m_properties); 358 return toMutableStylePropertySet(m_properties);
382 } 359 }
383 360
384 void StyleRuleFilter::setProperties(PassRefPtr<StylePropertySet> properties) 361 void StyleRuleFilter::setProperties(PassRefPtr<StylePropertySet> properties)
385 { 362 {
386 m_properties = properties; 363 m_properties = properties;
387 } 364 }
388 365
389 } // namespace WebCore 366 } // 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