| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CascadedValues_h | 5 #ifndef CascadedValues_h |
| 6 #define CascadedValues_h | 6 #define CascadedValues_h |
| 7 | 7 |
| 8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
| 9 #include "core/css/RuleSet.h" | 9 #include "core/css/RuleSet.h" |
| 10 #include "core/css/SelectorChecker.h" | 10 #include "core/css/SelectorChecker.h" |
| 11 #include "core/rendering/style/RenderStyleConstants.h" | 11 #include "core/rendering/style/RenderStyleConstants.h" |
| 12 #include "platform/text/TextDirection.h" | 12 #include "platform/text/TextDirection.h" |
| 13 #include "platform/text/WritingMode.h" | 13 #include "platform/text/WritingMode.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class CSSValue; | 17 class CSSValue; |
| 18 class MatchResult; | 18 class MatchResult; |
| 19 class StyleResolverState; | 19 class StyleResolverState; |
| 20 class StyleRule; | 20 class StyleRule; |
| 21 | 21 |
| 22 class CascadedValues { | 22 class CascadedValues { |
| 23 STACK_ALLOCATED(); | 23 STACK_ALLOCATED(); |
| 24 public: | 24 public: |
| 25 CascadedValues(StyleResolverState&, const MatchResult&, bool onlyAddUARules
= false); | 25 CascadedValues(StyleResolverState&, const MatchResult&); |
| 26 void applyValues(CSSPropertyID first, CSSPropertyID last, bool inheritedOnly
= false); | 26 void applyValues(CSSPropertyID first, CSSPropertyID last, bool inheritedOnly
= false); |
| 27 | 27 |
| 28 bool valuesUnchangedForWebkitAppearance(const MatchResult&); |
| 29 |
| 28 private: | 30 private: |
| 31 enum WebkitAppearanceConstructorType { WebkitAppearanceConstructor }; |
| 32 CascadedValues(StyleResolverState&, const MatchResult&, WebkitAppearanceCons
tructorType); |
| 29 void addMatchResult(const MatchResult&, CSSPropertyID firstId, CSSPropertyID
lastId); | 33 void addMatchResult(const MatchResult&, CSSPropertyID firstId, CSSPropertyID
lastId); |
| 30 void addMatchResultRange(const MatchResult&, bool isImportant, int firstInde
x, int lastIndex, CSSPropertyID firstId, CSSPropertyID lastId); | 34 void addMatchResultRange(const MatchResult&, bool isImportant, int firstInde
x, int lastIndex, CSSPropertyID firstId, CSSPropertyID lastId); |
| 31 void addStylePropertySet(const StylePropertySet*, const StyleRule*, bool isI
mportant, CSSPropertyID first, CSSPropertyID last, PropertyWhitelistType, Select
orChecker::LinkMatchMask); | 35 void addStylePropertySet(const StylePropertySet*, const StyleRule*, bool isI
mportant, CSSPropertyID first, CSSPropertyID last, PropertyWhitelistType, Select
orChecker::LinkMatchMask); |
| 32 void addValue(CSSPropertyID, CSSValue*, const StyleRule*, SelectorChecker::L
inkMatchMask); | 36 void addValue(CSSPropertyID, CSSValue*, const StyleRule*, SelectorChecker::L
inkMatchMask); |
| 33 void addAllProperty(CSSValue*, SelectorChecker::LinkMatchMask); | 37 void addAllProperty(CSSValue*, SelectorChecker::LinkMatchMask); |
| 34 | 38 |
| 35 CSSValue*& cascadedValue(CSSPropertyID id) | 39 CSSValue*& cascadedValue(CSSPropertyID id) |
| 36 { | 40 { |
| 37 return m_values[id - firstCSSProperty]; | 41 return m_values[id - firstCSSProperty]; |
| 38 } | 42 } |
| 39 CSSValue*& cascadedVisitedLinkValue(CSSPropertyID id) | 43 CSSValue*& cascadedVisitedLinkValue(CSSPropertyID id) |
| 40 { | 44 { |
| 41 return m_visitedLinkValues[id - firstCSSProperty]; | 45 return m_visitedLinkValues[id - firstCSSProperty]; |
| 42 } | 46 } |
| 43 | 47 |
| 44 CSSValue* m_values[numCSSProperties]; | 48 CSSValue* m_values[numCSSProperties]; |
| 45 CSSValue* m_visitedLinkValues[numCSSProperties]; | 49 CSSValue* m_visitedLinkValues[numCSSProperties]; |
| 46 | 50 |
| 47 StyleResolverState& m_state; | 51 StyleResolverState& m_state; |
| 48 TextDirection m_direction; | 52 TextDirection m_direction; |
| 49 WritingMode m_writingMode; | 53 WritingMode m_writingMode; |
| 50 }; | 54 }; |
| 51 | 55 |
| 52 } // namespace blink | 56 } // namespace blink |
| 53 | 57 |
| 54 #endif // CascadedValues_h | 58 #endif // CascadedValues_h |
| OLD | NEW |