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

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

Issue 2682073004: Added a UseCounter for hover:on-demand media query parsing. (Closed)
Patch Set: Created 3 years, 10 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 | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
index 5d3f0b3b2bca3c57326b5f36635abce626f18d0a..431d0d44ea40be7a0a4c709b7e47745f27354c8a 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
+++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
@@ -643,6 +643,9 @@ static bool hoverMediaFeatureEval(const MediaQueryExpValue& value,
if (!value.isID)
return false;
+ if (value.id == CSSValueOnDemand)
+ UseCounter::count(mediaValues.document(), UseCounter::CSSValueOnDemand);
+
return (hover == HoverTypeNone && value.id == CSSValueNone) ||
(hover == HoverTypeOnDemand && value.id == CSSValueOnDemand) ||
(hover == HoverTypeHover && value.id == CSSValueHover);
@@ -663,6 +666,7 @@ static bool anyHoverMediaFeatureEval(const MediaQueryExpValue& value,
case CSSValueNone:
return availableHoverTypes & HoverTypeNone;
case CSSValueOnDemand:
+ UseCounter::count(mediaValues.document(), UseCounter::CSSValueOnDemand);
return availableHoverTypes & HoverTypeOnDemand;
case CSSValueHover:
return availableHoverTypes & HoverTypeHover;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698