| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 | 127 |
| 128 WillBeHeapVector<RefPtrWillBeMember<CSSMediaQuerySourceData>> queryData; | 128 WillBeHeapVector<RefPtrWillBeMember<CSSMediaQuerySourceData>> queryData; |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 struct CSSRuleSourceData; | 131 struct CSSRuleSourceData; |
| 132 using RuleSourceDataList = WillBeHeapVector<RefPtrWillBeMember<CSSRuleSourceData
>>; | 132 using RuleSourceDataList = WillBeHeapVector<RefPtrWillBeMember<CSSRuleSourceData
>>; |
| 133 using SelectorRangeList = WillBeHeapVector<SourceRange>; | 133 using SelectorRangeList = WillBeHeapVector<SourceRange>; |
| 134 | 134 |
| 135 struct CSSRuleSourceData : public RefCountedWillBeGarbageCollected<CSSRuleSource
Data> { | 135 struct CSSRuleSourceData : public RefCountedWillBeGarbageCollected<CSSRuleSource
Data> { |
| 136 static PassRefPtrWillBeRawPtr<CSSRuleSourceData> create(StyleRule::Type type
) | 136 static PassRefPtrWillBeRawPtr<CSSRuleSourceData> create(StyleRule::RuleType
type) |
| 137 { | 137 { |
| 138 return adoptRefWillBeNoop(new CSSRuleSourceData(type)); | 138 return adoptRefWillBeNoop(new CSSRuleSourceData(type)); |
| 139 } | 139 } |
| 140 | 140 |
| 141 CSSRuleSourceData(StyleRule::Type type) | 141 CSSRuleSourceData(StyleRule::RuleType type) |
| 142 : type(type) | 142 : type(type) |
| 143 { | 143 { |
| 144 if (type == StyleRule::Style || type == StyleRule::FontFace || type == S
tyleRule::Page || type == StyleRule::Keyframe) | 144 if (type == StyleRule::Style || type == StyleRule::FontFace || type == S
tyleRule::Page || type == StyleRule::Keyframe) |
| 145 styleSourceData = CSSStyleSourceData::create(); | 145 styleSourceData = CSSStyleSourceData::create(); |
| 146 if (type == StyleRule::Media || type == StyleRule::Import) | 146 if (type == StyleRule::Media || type == StyleRule::Import) |
| 147 mediaSourceData = CSSMediaSourceData::create(); | 147 mediaSourceData = CSSMediaSourceData::create(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 DECLARE_TRACE(); | 150 DECLARE_TRACE(); |
| 151 | 151 |
| 152 StyleRule::Type type; | 152 StyleRule::RuleType type; |
| 153 | 153 |
| 154 // Range of the selector list in the enclosing source. | 154 // Range of the selector list in the enclosing source. |
| 155 SourceRange ruleHeaderRange; | 155 SourceRange ruleHeaderRange; |
| 156 | 156 |
| 157 // Range of the rule body (e.g. style text for style rules) in the enclosing
source. | 157 // Range of the rule body (e.g. style text for style rules) in the enclosing
source. |
| 158 SourceRange ruleBodyRange; | 158 SourceRange ruleBodyRange; |
| 159 | 159 |
| 160 // Only for CSSStyleRules. | 160 // Only for CSSStyleRules. |
| 161 SelectorRangeList selectorRanges; | 161 SelectorRangeList selectorRanges; |
| 162 | 162 |
| 163 // Only for CSSStyleRules, CSSFontFaceRules, and CSSPageRules. | 163 // Only for CSSStyleRules, CSSFontFaceRules, and CSSPageRules. |
| 164 RefPtrWillBeMember<CSSStyleSourceData> styleSourceData; | 164 RefPtrWillBeMember<CSSStyleSourceData> styleSourceData; |
| 165 | 165 |
| 166 // Only for CSSMediaRules. | 166 // Only for CSSMediaRules. |
| 167 RuleSourceDataList childRules; | 167 RuleSourceDataList childRules; |
| 168 | 168 |
| 169 // Only for CSSMediaRules and CSSImportRules. | 169 // Only for CSSMediaRules and CSSImportRules. |
| 170 RefPtrWillBeMember<CSSMediaSourceData> mediaSourceData; | 170 RefPtrWillBeMember<CSSMediaSourceData> mediaSourceData; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 } // namespace blink | 173 } // namespace blink |
| 174 | 174 |
| 175 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SourceRange); | 175 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SourceRange); |
| 176 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSPropertySourceData); | 176 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSPropertySourceData); |
| 177 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSMediaQueryExpSourceData); | 177 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSMediaQueryExpSourceData); |
| 178 | 178 |
| 179 #endif // CSSPropertySourceData_h | 179 #endif // CSSPropertySourceData_h |
| OLD | NEW |