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

Side by Side 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: Nicer test. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 pair->append(zoomAdjustedPixelValueForLength(coordinate.x(), style)); 1349 pair->append(zoomAdjustedPixelValueForLength(coordinate.x(), style));
1350 pair->append(zoomAdjustedPixelValueForLength(coordinate.y(), style)); 1350 pair->append(zoomAdjustedPixelValueForLength(coordinate.y(), style));
1351 list->append(pair); 1351 list->append(pair);
1352 } 1352 }
1353 1353
1354 return list.release(); 1354 return list.release();
1355 } 1355 }
1356 1356
1357 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(const AtomicS tring customPropertyName, const ComputedStyle& style) 1357 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(const AtomicS tring customPropertyName, const ComputedStyle& style)
1358 { 1358 {
1359 CSSVariableData* data = style.variables()->getVariable(customPropertyName); 1359 StyleVariableData* variables = style.variables();
1360 if (!variables)
1361 return nullptr;
1362
1363 CSSVariableData* data = variables->getVariable(customPropertyName);
1360 if (!data) 1364 if (!data)
1361 return nullptr; 1365 return nullptr;
1362 1366
1363 return CSSCustomPropertyDeclaration::create(customPropertyName, data); 1367 return CSSCustomPropertyDeclaration::create(customPropertyName, data);
1364 } 1368 }
1365 1369
1370 const HashMap<AtomicString, RefPtr<CSSVariableData>>* ComputedStyleCSSValueMappi ng::getVariables(const ComputedStyle& style)
1371 {
1372 StyleVariableData* variables = style.variables();
1373 if (variables)
1374 return variables->getVariables();
1375 return nullptr;
1376 }
1377
1366 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) 1378 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle)
1367 { 1379 {
1368 const SVGComputedStyle& svgStyle = style.svgStyle(); 1380 const SVGComputedStyle& svgStyle = style.svgStyle();
1369 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di rection(), style.writingMode()); 1381 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di rection(), style.writingMode());
1370 switch (propertyID) { 1382 switch (propertyID) {
1371 case CSSPropertyInvalid: 1383 case CSSPropertyInvalid:
1372 return nullptr; 1384 return nullptr;
1373 1385
1374 case CSSPropertyBackgroundColor: 1386 case CSSPropertyBackgroundColor:
1375 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty le, style.backgroundColor()); 1387 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty le, style.backgroundColor());
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
2720 case CSSPropertyAll: 2732 case CSSPropertyAll:
2721 return nullptr; 2733 return nullptr;
2722 default: 2734 default:
2723 break; 2735 break;
2724 } 2736 }
2725 ASSERT_NOT_REACHED(); 2737 ASSERT_NOT_REACHED();
2726 return nullptr; 2738 return nullptr;
2727 } 2739 }
2728 2740
2729 } 2741 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698