OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 Google Inc. All rights reserved. | 2 * Copyright (c) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 public: | 139 public: |
140 static PassRefPtr<CSSRuleSourceData> create(StyleRule::RuleType type) { | 140 static PassRefPtr<CSSRuleSourceData> create(StyleRule::RuleType type) { |
141 return adoptRef(new CSSRuleSourceData(type)); | 141 return adoptRef(new CSSRuleSourceData(type)); |
142 } | 142 } |
143 | 143 |
144 StyleRule::RuleType type; | 144 StyleRule::RuleType type; |
145 | 145 |
146 // Range of the selector list in the enclosing source. | 146 // Range of the selector list in the enclosing source. |
147 SourceRange ruleHeaderRange; | 147 SourceRange ruleHeaderRange; |
148 | 148 |
149 // Range of the rule body (e.g. style text for style rules) in the enclosing s
ource. | 149 // Range of the rule body (e.g. style text for style rules) in the enclosing |
| 150 // source. |
150 SourceRange ruleBodyRange; | 151 SourceRange ruleBodyRange; |
151 | 152 |
152 // Only for CSSStyleRules. | 153 // Only for CSSStyleRules. |
153 SelectorRangeList selectorRanges; | 154 SelectorRangeList selectorRanges; |
154 | 155 |
155 // Only for CSSStyleRules, CSSFontFaceRules, and CSSPageRules. | 156 // Only for CSSStyleRules, CSSFontFaceRules, and CSSPageRules. |
156 std::unique_ptr<CSSStyleSourceData> styleSourceData; | 157 std::unique_ptr<CSSStyleSourceData> styleSourceData; |
157 | 158 |
158 // Only for CSSMediaRules. | 159 // Only for CSSMediaRules. |
159 RuleSourceDataList childRules; | 160 RuleSourceDataList childRules; |
160 | 161 |
161 // Only for CSSMediaRules and CSSImportRules. | 162 // Only for CSSMediaRules and CSSImportRules. |
162 std::unique_ptr<CSSMediaSourceData> mediaSourceData; | 163 std::unique_ptr<CSSMediaSourceData> mediaSourceData; |
163 | 164 |
164 private: | 165 private: |
165 CSSRuleSourceData(StyleRule::RuleType type) : type(type) { | 166 CSSRuleSourceData(StyleRule::RuleType type) : type(type) { |
166 if (type == StyleRule::Style || type == StyleRule::FontFace || | 167 if (type == StyleRule::Style || type == StyleRule::FontFace || |
167 type == StyleRule::Page || type == StyleRule::Keyframe) | 168 type == StyleRule::Page || type == StyleRule::Keyframe) |
168 styleSourceData = CSSStyleSourceData::create(); | 169 styleSourceData = CSSStyleSourceData::create(); |
169 if (type == StyleRule::Media || type == StyleRule::Import) | 170 if (type == StyleRule::Media || type == StyleRule::Import) |
170 mediaSourceData = CSSMediaSourceData::create(); | 171 mediaSourceData = CSSMediaSourceData::create(); |
171 } | 172 } |
172 }; | 173 }; |
173 | 174 |
174 } // namespace blink | 175 } // namespace blink |
175 | 176 |
176 #endif // CSSPropertySourceData_h | 177 #endif // CSSPropertySourceData_h |
OLD | NEW |