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

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2310823002: Skeleton implementation of CSS Properties and Values API (Closed)
Patch Set: fix stylevardata copy ctor Created 4 years, 3 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
Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 19f3072b0fe9baa230a89d1f91bdd70e69daf7f3..23d3b172a14fb8cf40de6a0d323e4f1704f79f85 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -53,6 +53,7 @@
#include "core/css/CSSURIValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/CSSValuePair.h"
+#include "core/css/PropertyRegistry.h"
#include "core/layout/LayoutBlock.h"
#include "core/layout/LayoutBox.h"
#include "core/layout/LayoutGrid.h"
@@ -1633,9 +1634,21 @@ static EBreak mapToColumnBreakValue(EBreak genericBreakValue)
}
}
-const CSSValue* ComputedStyleCSSValueMapping::get(const AtomicString customPropertyName, const ComputedStyle& style)
+const CSSValue* ComputedStyleCSSValueMapping::get(const AtomicString customPropertyName, const ComputedStyle& style, const PropertyRegistry* registry)
{
StyleVariableData* variables = style.variables();
+ if (registry) {
+ const PropertyRegistry::Registration* registration = registry->registration(customPropertyName);
+ if (registration) {
+ if (variables) {
+ const CSSValue* result = variables->registeredInheritedProperty(customPropertyName);
+ if (result)
+ return result;
+ }
+ return registration->initial();
+ }
+ }
+
if (!variables)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698