Chromium Code Reviews| Index: Source/core/css/resolver/CascadedValues.h |
| diff --git a/Source/core/css/resolver/CascadedValues.h b/Source/core/css/resolver/CascadedValues.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a2e027f40580314db912640ffcaa618811a50403 |
| --- /dev/null |
| +++ b/Source/core/css/resolver/CascadedValues.h |
| @@ -0,0 +1,54 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CascadedValues_h |
| +#define CascadedValues_h |
| + |
| +#include "core/CSSPropertyNames.h" |
| +#include "core/css/RuleSet.h" |
| +#include "core/css/SelectorChecker.h" |
| +#include "core/rendering/style/RenderStyleConstants.h" |
| +#include "platform/text/TextDirection.h" |
| +#include "platform/text/WritingMode.h" |
| + |
| +namespace blink { |
| + |
| +class CSSValue; |
| +class MatchResult; |
| +class StyleResolverState; |
| +class StyleRule; |
| + |
| +class CascadedValues { |
| + STACK_ALLOCATED(); |
| +public: |
| + CascadedValues(StyleResolverState&, const MatchResult&, bool onlyAddUARules = false); |
| + void applyValues(CSSPropertyID first, CSSPropertyID last, bool inheritedOnly = false); |
| + |
| +private: |
| + void addMatchResult(const MatchResult&, CSSPropertyID firstId, CSSPropertyID lastId); |
| + void addMatchResultRange(const MatchResult&, bool isImportant, int firstIndex, int lastIndex, CSSPropertyID firstId, CSSPropertyID lastId); |
| + void addStylePropertySet(const StylePropertySet*, const StyleRule*, bool isImportant, CSSPropertyID first, CSSPropertyID last, PropertyWhitelistType, SelectorChecker::LinkMatchMask); |
| + void addValue(CSSPropertyID, CSSValue*, const StyleRule*, SelectorChecker::LinkMatchMask); |
| + void addAllProperty(CSSValue*, SelectorChecker::LinkMatchMask); |
| + |
| + CSSValue*& cascadedValue(CSSPropertyID id) |
|
esprehn
2014/07/28 17:38:35
Returning references to array values is pretty ske
Timothy Loh
2014/07/29 08:32:15
Good idea, done.
|
| + { |
| + return m_values[id - firstCSSProperty]; |
| + } |
| + CSSValue*& cascadedVisitedLinkValue(CSSPropertyID id) |
| + { |
| + return m_visitedLinkValues[id - firstCSSProperty]; |
| + } |
| + |
| + CSSValue* m_values[numCSSProperties]; |
| + CSSValue* m_visitedLinkValues[numCSSProperties]; |
| + |
| + StyleResolverState& m_state; |
| + TextDirection m_direction; |
| + WritingMode m_writingMode; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // CascadedValues_h |