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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp

Issue 2203473002: DevTools: fix CSS.getComputedStyle protocol method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: we should not query for descriptors only properties Created 4 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
Index: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index b12c36c3da2345b1e26264d5c9ce1c3bd7834298..8eb363cc34498c686a010e9cf74c5206006c2e38 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -994,8 +994,15 @@ void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int no
return;
CSSComputedStyleDeclaration* computedStyleInfo = CSSComputedStyleDeclaration::create(node, true);
- InspectorStyle* inspectorStyle = InspectorStyle::create(computedStyleInfo, nullptr, nullptr);
- *style = inspectorStyle->buildArrayForComputedStyle();
+ *style = protocol::Array<protocol::CSS::CSSComputedStyleProperty>::create();
+ for (int id = firstCSSProperty; id <= lastCSSProperty; ++id) {
+ CSSPropertyID propertyId = static_cast<CSSPropertyID>(id);
+ if (!CSSPropertyMetadata::isEnabledProperty(propertyId) || isShorthandProperty(propertyId) || CSSPropertyMetadata::isDescriptorOnly(propertyId))
+ continue;
+ (*style)->addItem(protocol::CSS::CSSComputedStyleProperty::create()
+ .setName(getPropertyNameString(propertyId))
+ .setValue(computedStyleInfo->getPropertyValue(propertyId)).build());
+ }
if (!RuntimeEnabledFeatures::cssVariablesEnabled())
return;

Powered by Google App Engine
This is Rietveld 408576698