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

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

Issue 335313003: MediaQueryEvaluator getting mediaType from MediaValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed a bug and added tests 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/css/MediaValuesCached.cpp
diff --git a/Source/core/css/MediaValuesCached.cpp b/Source/core/css/MediaValuesCached.cpp
index 570a3a517098c3eaab139305381ea11e04c2563c..3f435f850c7d29657d4bfa53580ce9f1faca216e 100644
--- a/Source/core/css/MediaValuesCached.cpp
+++ b/Source/core/css/MediaValuesCached.cpp
@@ -60,10 +60,10 @@ MediaValuesCached::MediaValuesCached(LocalFrame* frame)
m_data.pointer = calculateLeastCapablePrimaryPointerDeviceType(frame);
m_data.defaultFontSize = calculateDefaultFontSize(frame);
m_data.threeDEnabled = calculateThreeDEnabled(frame);
- m_data.scanMediaType = calculateScanMediaType(frame);
- m_data.screenMediaType = calculateScreenMediaType(frame);
- m_data.printMediaType = calculatePrintMediaType(frame);
m_data.strictMode = calculateStrictMode(frame);
+ const String mediaType = calculateMediaType(frame);
+ if (!mediaType.isEmpty())
+ m_data.mediaType = mediaType.isolatedCopy();
esprehn 2014/06/27 08:10:32 Why do you need a copy?
}
MediaValuesCached::MediaValuesCached(const MediaValuesCachedData& data)
@@ -136,25 +136,14 @@ bool MediaValuesCached::threeDEnabled() const
return m_data.threeDEnabled;
}
-bool MediaValuesCached::scanMediaType() const
-{
- return m_data.scanMediaType;
-}
-
-bool MediaValuesCached::screenMediaType() const
-{
- return m_data.screenMediaType;
-}
-
-bool MediaValuesCached::printMediaType() const
-{
- return m_data.printMediaType;
-}
-
bool MediaValuesCached::strictMode() const
{
return m_data.strictMode;
}
+const String MediaValuesCached::mediaType() const
+{
+ return m_data.mediaType;
+}
Document* MediaValuesCached::document() const
{

Powered by Google App Engine
This is Rietveld 408576698