Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / css / MediaValuesCached.cpp
index 570a3a5..8f9f547 100644 (file)
@@ -8,10 +8,9 @@
 #include "core/css/CSSPrimitiveValue.h"
 #include "core/dom/Document.h"
 #include "core/frame/LocalFrame.h"
-#include "core/html/imports/HTMLImportsController.h"
 #include "core/rendering/RenderObject.h"
 
-namespace WebCore {
+namespace blink {
 
 PassRefPtr<MediaValues> MediaValuesCached::create()
 {
@@ -25,9 +24,7 @@ PassRefPtr<MediaValues> MediaValuesCached::create(MediaValuesCachedData& data)
 
 PassRefPtr<MediaValues> MediaValuesCached::create(Document& document)
 {
-    Document* executingDocument = document.importsController() ? document.importsController()->master() : &document;
-    ASSERT(executingDocument);
-    return MediaValuesCached::create(executingDocument->frame());
+    return MediaValuesCached::create(frameFrom(document));
 }
 
 PassRefPtr<MediaValues> MediaValuesCached::create(LocalFrame* frame)
@@ -60,10 +57,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();
 }
 
 MediaValuesCached::MediaValuesCached(const MediaValuesCachedData& data)
@@ -136,25 +133,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
 {