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

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

Issue 339553004: DevTools: [MediaQueryInspector] Compute media query length on backend (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/Source/core/inspector/InspectorCSSAgent.cpp b/Source/core/inspector/InspectorCSSAgent.cpp
index c54fe65b658c9cd8bc39f031025f3208366027f9..df588c15cc54c3c503239b64fd1f2ee0aa8c505a 100644
--- a/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/Source/core/inspector/InspectorCSSAgent.cpp
@@ -41,6 +41,7 @@
#include "core/css/CSSStyleSheet.h"
#include "core/css/MediaList.h"
#include "core/css/MediaQuery.h"
+#include "core/css/MediaValues.h"
#include "core/css/StylePropertySet.h"
#include "core/css/StyleRule.h"
#include "core/css/StyleSheet.h"
@@ -1024,6 +1025,11 @@ PassRefPtr<TypeBuilder::CSS::CSSMedia> InspectorCSSAgent::buildMediaObject(const
.setValue(expValue.value)
.setUnit(String(valueName))
.setFeature(mediaQueryExp->mediaFeature());
+ RefPtr<MediaValues> mediaValues = MediaValues::createDynamicIfFrameExists(parentStyleSheet->ownerDocument()->frame());
+ int computedLength;
+ if (mediaValues->computeLength(expValue.value, expValue.unit, computedLength))
+ mediaQueryExpression->setComputedLength(computedLength);
+
expressionArray->addItem(mediaQueryExpression);
hasExpressionItems = true;
}
« no previous file with comments | « LayoutTests/inspector-protocol/css/css-get-media-queries-expected.txt ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698