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

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

Issue 1521323002: Show custom properties in the computed style pane of the inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 4f41f9a1f3e5d2d0e5374cee545bd78942b6560b..ef53f27a56d352cc1dcfff3777105ba4edc59bd8 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -1357,13 +1357,25 @@ static PassRefPtrWillBeRawPtr<CSSValue> valueForScrollSnapCoordinate(const Vecto
PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(const AtomicString customPropertyName, const ComputedStyle& style)
{
- CSSVariableData* data = style.variables()->getVariable(customPropertyName);
+ StyleVariableData* variables = style.variables();
+ if (!variables)
+ return nullptr;
+
+ CSSVariableData* data = variables->getVariable(customPropertyName);
if (!data)
return nullptr;
return CSSCustomPropertyDeclaration::create(customPropertyName, data);
}
+const HashMap<AtomicString, RefPtr<CSSVariableData>>* ComputedStyleCSSValueMapping::getVariables(const ComputedStyle& style)
+{
+ StyleVariableData* variables = style.variables();
+ if (variables)
+ return variables->getVariables();
+ return nullptr;
+}
+
PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle)
{
const SVGComputedStyle& svgStyle = style.svgStyle();

Powered by Google App Engine
This is Rietveld 408576698