| 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. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All rights reserved. | 4 * 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 * |
| 11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
| 17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
| 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
| 20 * | 20 * |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #ifndef StyleResolver_h | 23 #ifndef StyleResolver_h |
| 24 #define StyleResolver_h | 24 #define StyleResolver_h |
| 25 | 25 |
| 26 #include "core/CoreExport.h" | 26 #include "core/CoreExport.h" |
| 27 #include "core/animation/PropertyHandle.h" | 27 #include "core/animation/PropertyHandle.h" |
| 28 #include "core/css/ElementRuleCollector.h" | 28 #include "core/css/ElementRuleCollector.h" |
| 29 #include "core/css/PseudoStyleRequest.h" | 29 #include "core/css/PseudoStyleRequest.h" |
| 30 #include "core/css/RuleFeature.h" | |
| 31 #include "core/css/RuleSet.h" | |
| 32 #include "core/css/SelectorChecker.h" | 30 #include "core/css/SelectorChecker.h" |
| 33 #include "core/css/SelectorFilter.h" | 31 #include "core/css/SelectorFilter.h" |
| 34 #include "core/css/resolver/CSSPropertyPriority.h" | 32 #include "core/css/resolver/CSSPropertyPriority.h" |
| 35 #include "core/css/resolver/MatchedPropertiesCache.h" | 33 #include "core/css/resolver/MatchedPropertiesCache.h" |
| 36 #include "core/css/resolver/StyleBuilder.h" | 34 #include "core/css/resolver/StyleBuilder.h" |
| 37 #include "core/style/CachedUAStyle.h" | 35 #include "core/style/CachedUAStyle.h" |
| 38 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
| 39 #include "wtf/Deque.h" | 37 #include "wtf/Deque.h" |
| 40 #include "wtf/HashMap.h" | 38 #include "wtf/HashMap.h" |
| 41 #include "wtf/HashSet.h" | 39 #include "wtf/HashSet.h" |
| 42 #include "wtf/ListHashSet.h" | 40 #include "wtf/ListHashSet.h" |
| 43 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
| 44 #include "wtf/Vector.h" | 42 #include "wtf/Vector.h" |
| 45 | 43 |
| 46 namespace blink { | 44 namespace blink { |
| 47 | 45 |
| 48 class AnimatableValue; | 46 class AnimatableValue; |
| 49 class CSSRuleList; | 47 class CSSRuleList; |
| 50 class CSSStyleSheet; | 48 class CSSStyleSheet; |
| 51 class CSSValue; | 49 class CSSValue; |
| 52 class Document; | 50 class Document; |
| 53 class Element; | 51 class Element; |
| 54 class Interpolation; | 52 class Interpolation; |
| 55 class MatchResult; | 53 class MatchResult; |
| 56 class MediaQueryEvaluator; | 54 class MediaQueryEvaluator; |
| 55 class RuleSet; |
| 57 class StylePropertySet; | 56 class StylePropertySet; |
| 58 class StyleRule; | 57 class StyleRule; |
| 59 class StyleRuleUsageTracker; | 58 class StyleRuleUsageTracker; |
| 60 | 59 |
| 61 enum StyleSharingBehavior { | 60 enum StyleSharingBehavior { |
| 62 AllowStyleSharing, | 61 AllowStyleSharing, |
| 63 DisallowStyleSharing, | 62 DisallowStyleSharing, |
| 64 }; | 63 }; |
| 65 | 64 |
| 66 enum RuleMatchingBehavior { MatchAllRules, MatchAllRulesExcludingSMIL }; | 65 enum RuleMatchingBehavior { MatchAllRules, MatchAllRulesExcludingSMIL }; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 Element*, | 140 Element*, |
| 142 unsigned rulesToInclude = AllButEmptyCSSRules); | 141 unsigned rulesToInclude = AllButEmptyCSSRules); |
| 143 CSSRuleList* pseudoCSSRulesForElement( | 142 CSSRuleList* pseudoCSSRulesForElement( |
| 144 Element*, | 143 Element*, |
| 145 PseudoId, | 144 PseudoId, |
| 146 unsigned rulesToInclude = AllButEmptyCSSRules); | 145 unsigned rulesToInclude = AllButEmptyCSSRules); |
| 147 StyleRuleList* styleRulesForElement(Element*, unsigned rulesToInclude); | 146 StyleRuleList* styleRulesForElement(Element*, unsigned rulesToInclude); |
| 148 | 147 |
| 149 void computeFont(ComputedStyle*, const StylePropertySet&); | 148 void computeFont(ComputedStyle*, const StylePropertySet&); |
| 150 | 149 |
| 151 void addViewportDependentMediaQueries(const MediaQueryResultList&); | |
| 152 bool hasViewportDependentMediaQueries() const { | |
| 153 return !m_viewportDependentMediaQueryResults.isEmpty(); | |
| 154 } | |
| 155 bool mediaQueryAffectedByViewportChange() const; | |
| 156 void addDeviceDependentMediaQueries(const MediaQueryResultList&); | |
| 157 bool mediaQueryAffectedByDeviceChange() const; | |
| 158 | |
| 159 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something. | 150 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something. |
| 160 void invalidateMatchedPropertiesCache(); | 151 void invalidateMatchedPropertiesCache(); |
| 161 | 152 |
| 162 void notifyResizeForViewportUnits(); | 153 void notifyResizeForViewportUnits(); |
| 163 | 154 |
| 164 // Exposed for ComputedStyle::isStyleAvilable(). | 155 // Exposed for ComputedStyle::isStyleAvilable(). |
| 165 static ComputedStyle* styleNotYetAvailable() { | 156 static ComputedStyle* styleNotYetAvailable() { |
| 166 return s_styleNotYetAvailable; | 157 return s_styleNotYetAvailable; |
| 167 } | 158 } |
| 168 | 159 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 bool hasAuthorBackground(const StyleResolverState&); | 266 bool hasAuthorBackground(const StyleResolverState&); |
| 276 bool hasAuthorBorder(const StyleResolverState&); | 267 bool hasAuthorBorder(const StyleResolverState&); |
| 277 | 268 |
| 278 PseudoElement* createPseudoElement(Element* parent, PseudoId); | 269 PseudoElement* createPseudoElement(Element* parent, PseudoId); |
| 279 | 270 |
| 280 Document& document() const { return *m_document; } | 271 Document& document() const { return *m_document; } |
| 281 | 272 |
| 282 static ComputedStyle* s_styleNotYetAvailable; | 273 static ComputedStyle* s_styleNotYetAvailable; |
| 283 | 274 |
| 284 MatchedPropertiesCache m_matchedPropertiesCache; | 275 MatchedPropertiesCache m_matchedPropertiesCache; |
| 285 | |
| 286 MediaQueryResultList m_viewportDependentMediaQueryResults; | |
| 287 MediaQueryResultList m_deviceDependentMediaQueryResults; | |
| 288 | |
| 289 Member<Document> m_document; | 276 Member<Document> m_document; |
| 290 SelectorFilter m_selectorFilter; | 277 SelectorFilter m_selectorFilter; |
| 291 | 278 |
| 292 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; | 279 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; |
| 293 | 280 |
| 294 Member<StyleRuleUsageTracker> m_tracker; | 281 Member<StyleRuleUsageTracker> m_tracker; |
| 295 | 282 |
| 296 bool m_printMediaType = false; | 283 bool m_printMediaType = false; |
| 297 | 284 |
| 298 unsigned m_styleSharingDepth = 0; | 285 unsigned m_styleSharingDepth = 0; |
| 299 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> | 286 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> |
| 300 m_styleSharingLists; | 287 m_styleSharingLists; |
| 301 }; | 288 }; |
| 302 | 289 |
| 303 } // namespace blink | 290 } // namespace blink |
| 304 | 291 |
| 305 #endif // StyleResolver_h | 292 #endif // StyleResolver_h |
| OLD | NEW |