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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e0b2588ea16adac7acd2a7971d118ca4085050c7
--- /dev/null
+++ b/Source/core/css/resolver/CascadedValues.h
@@ -0,0 +1,53 @@
+// 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) { return m_values[id - firstCSSProperty]; }
+ CSSValue* cascadedVisitedLinkValue(CSSPropertyID id) { return m_visitedLinkValues[id - firstCSSProperty]; }
+ void setCascadedValue(CSSPropertyID, CSSValue*);
+ void setCascadedVisitedLinkValue(CSSPropertyID, CSSValue*);
+ void clearCascadedValue(CSSPropertyID id) { setCascadedValue(id, nullptr); }
+
+ CSSValue* m_values[numCSSProperties];
+ CSSValue* m_visitedLinkValues[numCSSProperties];
+ Vector<CSSPropertyID, 32> setProperties;
+ Vector<CSSPropertyID, 32> setVisitedProperties;
+
+ StyleResolverState& m_state;
+ TextDirection m_direction;
+ WritingMode m_writingMode;
+};
+
+} // namespace blink
+
+#endif // CascadedValues_h
« 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