Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Side by Side Diff: Source/core/css/resolver/CascadedValues.h

Issue 350333003: Cascade declared property values instead of applying values on top of each other (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/CSSPropertyNames.in ('k') | Source/core/css/resolver/CascadedValues.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CascadedValues_h
6 #define CascadedValues_h
7
8 #include "core/CSSPropertyNames.h"
9 #include "core/css/RuleSet.h"
10 #include "core/css/SelectorChecker.h"
11 #include "core/rendering/style/RenderStyleConstants.h"
12 #include "platform/text/TextDirection.h"
13 #include "platform/text/WritingMode.h"
14
15 namespace blink {
16
17 class CSSValue;
18 class MatchResult;
19 class StyleResolverState;
20 class StyleRule;
21
22 class CascadedValues {
23 STACK_ALLOCATED();
24 public:
25 CascadedValues(StyleResolverState&, const MatchResult&, bool onlyAddUARules = false);
26 void applyValues(CSSPropertyID first, CSSPropertyID last, bool inheritedOnly = false);
27
28 private:
29 void addMatchResult(const MatchResult&, CSSPropertyID firstId, CSSPropertyID lastId);
30 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);
32 void addValue(CSSPropertyID, CSSValue*, const StyleRule*, SelectorChecker::L inkMatchMask);
33 void addAllProperty(CSSValue*, SelectorChecker::LinkMatchMask);
34
35 CSSValue* cascadedValue(CSSPropertyID id) { return m_values[id - firstCSSPro perty]; }
36 CSSValue* cascadedVisitedLinkValue(CSSPropertyID id) { return m_visitedLinkV alues[id - firstCSSProperty]; }
37 void setCascadedValue(CSSPropertyID, CSSValue*);
38 void setCascadedVisitedLinkValue(CSSPropertyID, CSSValue*);
39 void clearCascadedValue(CSSPropertyID id) { setCascadedValue(id, nullptr); }
40
41 CSSValue* m_values[numCSSProperties];
42 CSSValue* m_visitedLinkValues[numCSSProperties];
43 Vector<CSSPropertyID, 32> setProperties;
44 Vector<CSSPropertyID, 32> setVisitedProperties;
45
46 StyleResolverState& m_state;
47 TextDirection m_direction;
48 WritingMode m_writingMode;
49 };
50
51 } // namespace blink
52
53 #endif // CascadedValues_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSPropertyNames.in ('k') | Source/core/css/resolver/CascadedValues.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698