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

Unified Diff: Source/core/css/MediaQueryEvaluator.cpp

Issue 141163011: Add UseCounters for prefixed media features (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: oops Created 6 years, 11 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
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryEvaluator.cpp
diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp
index 0a6bdd40503acced7dfb96c140e4d9e2e8318d62..07006bb81415d10033577586c4b38e4f4d4b9835 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -317,6 +317,8 @@ static bool evalResolution(CSSValue* value, Frame* frame, MediaFeaturePrefix op)
static bool devicePixelRatioMediaFeatureEval(CSSValue *value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
{
+ UseCounter::count(frame->document(), UseCounter::PrefixedDevicePixelRatioMediaFeature);
+
return (!value || toCSSPrimitiveValue(value)->isNumber()) && evalResolution(value, frame, op);
}
@@ -474,11 +476,15 @@ static bool maxDeviceAspectRatioMediaFeatureEval(CSSValue* value, RenderStyle* s
static bool minDevicePixelRatioMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
{
+ UseCounter::count(frame->document(), UseCounter::PrefixedMinDevicePixelRatioMediaFeature);
+
return devicePixelRatioMediaFeatureEval(value, style, frame, MinPrefix);
}
static bool maxDevicePixelRatioMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
{
+ UseCounter::count(frame->document(), UseCounter::PrefixedMaxDevicePixelRatioMediaFeature);
+
return devicePixelRatioMediaFeatureEval(value, style, frame, MaxPrefix);
}
@@ -532,8 +538,10 @@ static bool maxResolutionMediaFeatureEval(CSSValue* value, RenderStyle* style, F
return resolutionMediaFeatureEval(value, style, frame, MaxPrefix);
}
-static bool animationMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFeaturePrefix op)
+static bool animationMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
{
+ UseCounter::count(frame->document(), UseCounter::PrefixedAnimationMediaFeature);
+
if (value) {
float number;
return numberValue(value, number) && compareValue(1, static_cast<int>(number), op);
@@ -541,8 +549,10 @@ static bool animationMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, Med
return true;
}
-static bool transform2dMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFeaturePrefix op)
+static bool transform2dMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
{
+ UseCounter::count(frame->document(), UseCounter::PrefixedTransform2dMediaFeature);
+
if (value) {
float number;
return numberValue(value, number) && compareValue(1, static_cast<int>(number), op);
@@ -552,6 +562,8 @@ static bool transform2dMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, M
static bool transform3dMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
{
+ UseCounter::count(frame->document(), UseCounter::PrefixedTransform3dMediaFeature);
+
bool returnValueIfNoParameter;
int have3dRendering;
@@ -571,6 +583,8 @@ static bool transform3dMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* fr
static bool viewModeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix)
{
+ UseCounter::count(frame->document(), UseCounter::PrefixedViewModeMediaFeature);
+
if (!value)
return true;
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698