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

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

Issue 2432153005: Always evaluate media features to true without MediaValues. (Closed)
Patch Set: DCHECK(view). Created 4 years, 2 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/css/MediaQueryEvaluator.cpp
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
index 605a29bd38dfd0fe3e5c25b63b6ad1a101e1a9e0..1242991ba5d2cd89464e0613837ac3c52dd1e4c7 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
+++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
@@ -67,12 +67,8 @@ using EvalFunc = bool (*)(const MediaQueryExpValue&,
using FunctionMap = HashMap<StringImpl*, EvalFunc>;
static FunctionMap* gFunctionMap;
-MediaQueryEvaluator::MediaQueryEvaluator(bool mediaFeatureResult)
- : m_expectedResult(mediaFeatureResult) {}
-
-MediaQueryEvaluator::MediaQueryEvaluator(const char* acceptedMediaType,
- bool mediaFeatureResult)
- : m_mediaType(acceptedMediaType), m_expectedResult(mediaFeatureResult) {}
+MediaQueryEvaluator::MediaQueryEvaluator(const char* acceptedMediaType)
+ : m_mediaType(acceptedMediaType) {}
MediaQueryEvaluator::MediaQueryEvaluator(LocalFrame* frame)
: m_mediaValues(MediaValues::createDynamicIfFrameExists(frame)) {}
@@ -745,7 +741,7 @@ void MediaQueryEvaluator::init() {
bool MediaQueryEvaluator::eval(const MediaQueryExp* expr) const {
if (!m_mediaValues || !m_mediaValues->hasValues())
- return m_expectedResult;
+ return true;
DCHECK(gFunctionMap);

Powered by Google App Engine
This is Rietveld 408576698