| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #ifndef SKY_ENGINE_CORE_CSS_RULESET_H_ | 22 #ifndef SKY_ENGINE_CORE_CSS_RULESET_H_ |
| 23 #define SKY_ENGINE_CORE_CSS_RULESET_H_ | 23 #define SKY_ENGINE_CORE_CSS_RULESET_H_ |
| 24 | 24 |
| 25 #include "sky/engine/core/css/MediaQueryEvaluator.h" | |
| 26 #include "sky/engine/core/css/RuleFeature.h" | 25 #include "sky/engine/core/css/RuleFeature.h" |
| 27 #include "sky/engine/core/css/StyleRule.h" | 26 #include "sky/engine/core/css/StyleRule.h" |
| 28 #include "sky/engine/core/css/StyleRuleKeyframes.h" | 27 #include "sky/engine/core/css/StyleRuleKeyframes.h" |
| 29 #include "sky/engine/core/css/resolver/MediaQueryResult.h" | 28 #include "sky/engine/platform/heap/Handle.h" |
| 30 #include "sky/engine/wtf/Forward.h" | 29 #include "sky/engine/wtf/Forward.h" |
| 31 #include "sky/engine/wtf/HashMap.h" | 30 #include "sky/engine/wtf/HashMap.h" |
| 32 #include "sky/engine/wtf/LinkedStack.h" | 31 #include "sky/engine/wtf/LinkedStack.h" |
| 33 #include "sky/engine/wtf/TerminatedArray.h" | 32 #include "sky/engine/wtf/TerminatedArray.h" |
| 34 | 33 |
| 35 namespace blink { | 34 namespace blink { |
| 36 | 35 |
| 37 class CSSSelector; | 36 class CSSSelector; |
| 38 class StyleSheetContents; | 37 class StyleSheetContents; |
| 39 | 38 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 77 |
| 79 const RuleFeatureSet& features() const { return m_features; } | 78 const RuleFeatureSet& features() const { return m_features; } |
| 80 | 79 |
| 81 const TerminatedArray<RuleData>* idRules(const AtomicString& key) const { AS
SERT(!m_pendingRules); return m_idRules.get(key); } | 80 const TerminatedArray<RuleData>* idRules(const AtomicString& key) const { AS
SERT(!m_pendingRules); return m_idRules.get(key); } |
| 82 const TerminatedArray<RuleData>* classRules(const AtomicString& key) const {
ASSERT(!m_pendingRules); return m_classRules.get(key); } | 81 const TerminatedArray<RuleData>* classRules(const AtomicString& key) const {
ASSERT(!m_pendingRules); return m_classRules.get(key); } |
| 83 const TerminatedArray<RuleData>* tagRules(const AtomicString& key) const { A
SSERT(!m_pendingRules); return m_tagRules.get(key); } | 82 const TerminatedArray<RuleData>* tagRules(const AtomicString& key) const { A
SSERT(!m_pendingRules); return m_tagRules.get(key); } |
| 84 const Vector<RuleData>* universalRules() const { ASSERT(!m_pendingRules); re
turn &m_universalRules; } | 83 const Vector<RuleData>* universalRules() const { ASSERT(!m_pendingRules); re
turn &m_universalRules; } |
| 85 const Vector<RuleData>* hostRules() const { ASSERT(!m_pendingRules); return
&m_hostRules; } | 84 const Vector<RuleData>* hostRules() const { ASSERT(!m_pendingRules); return
&m_hostRules; } |
| 86 const Vector<RawPtr<StyleRuleFontFace> >& fontFaceRules() const { return m_f
ontFaceRules; } | 85 const Vector<RawPtr<StyleRuleFontFace> >& fontFaceRules() const { return m_f
ontFaceRules; } |
| 87 const Vector<RawPtr<StyleRuleKeyframes> >& keyframesRules() const { return m
_keyframesRules; } | 86 const Vector<RawPtr<StyleRuleKeyframes> >& keyframesRules() const { return m
_keyframesRules; } |
| 88 const MediaQueryResultList& viewportDependentMediaQueryResults() const { ret
urn m_viewportDependentMediaQueryResults; } | |
| 89 | 87 |
| 90 void compactRulesIfNeeded() | 88 void compactRulesIfNeeded() |
| 91 { | 89 { |
| 92 if (!m_pendingRules) | 90 if (!m_pendingRules) |
| 93 return; | 91 return; |
| 94 compactRules(); | 92 compactRules(); |
| 95 } | 93 } |
| 96 | 94 |
| 97 #ifndef NDEBUG | 95 #ifndef NDEBUG |
| 98 void show(); | 96 void show(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 CompactRuleMap m_idRules; | 137 CompactRuleMap m_idRules; |
| 140 CompactRuleMap m_classRules; | 138 CompactRuleMap m_classRules; |
| 141 CompactRuleMap m_tagRules; | 139 CompactRuleMap m_tagRules; |
| 142 Vector<RuleData> m_universalRules; | 140 Vector<RuleData> m_universalRules; |
| 143 Vector<RuleData> m_hostRules; | 141 Vector<RuleData> m_hostRules; |
| 144 Vector<RawPtr<StyleRuleFontFace> > m_fontFaceRules; | 142 Vector<RawPtr<StyleRuleFontFace> > m_fontFaceRules; |
| 145 Vector<RawPtr<StyleRuleKeyframes> > m_keyframesRules; | 143 Vector<RawPtr<StyleRuleKeyframes> > m_keyframesRules; |
| 146 | 144 |
| 147 RuleFeatureSet m_features; | 145 RuleFeatureSet m_features; |
| 148 | 146 |
| 149 MediaQueryResultList m_viewportDependentMediaQueryResults; | |
| 150 | |
| 151 unsigned m_ruleCount; | 147 unsigned m_ruleCount; |
| 152 OwnPtr<PendingRuleMaps> m_pendingRules; | 148 OwnPtr<PendingRuleMaps> m_pendingRules; |
| 153 | 149 |
| 154 #ifndef NDEBUG | 150 #ifndef NDEBUG |
| 155 Vector<RuleData> m_allRules; | 151 Vector<RuleData> m_allRules; |
| 156 #endif | 152 #endif |
| 157 }; | 153 }; |
| 158 | 154 |
| 159 } // namespace blink | 155 } // namespace blink |
| 160 | 156 |
| 161 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); | 157 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); |
| 162 | 158 |
| 163 #endif // SKY_ENGINE_CORE_CSS_RULESET_H_ | 159 #endif // SKY_ENGINE_CORE_CSS_RULESET_H_ |
| OLD | NEW |