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

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

Issue 336553003: Change Page::m_mainFrame to be a Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Android/Mac fixes 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/MediaValues.cpp
diff --git a/Source/core/css/MediaValues.cpp b/Source/core/css/MediaValues.cpp
index b0b6a80b4cba943b28d1157e8e615c0a73b28f3c..e12af99d1a7a1a03ee8b0e8dad6b8935cb5952c3 100644
--- a/Source/core/css/MediaValues.cpp
+++ b/Source/core/css/MediaValues.cpp
@@ -73,10 +73,13 @@ float MediaValues::calculateDevicePixelRatio(LocalFrame* frame) const
return frame->devicePixelRatio();
}
+// FIXME: Broken for OOPI. These checks can't assume there will be a top level
+// FrameView.
int MediaValues::calculateColorBitsPerComponent(LocalFrame* frame) const
{
ASSERT(frame && frame->page() && frame->page()->mainFrame());
- if (screenIsMonochrome(frame->page()->mainFrame()->view()))
+ if (!frame->page()->mainFrame()->isLocalFrame()
+ || screenIsMonochrome(toLocalFrame(frame->page()->mainFrame())->view()))
return 0;
return screenDepthPerComponent(frame->view());
}
@@ -84,9 +87,10 @@ int MediaValues::calculateColorBitsPerComponent(LocalFrame* frame) const
int MediaValues::calculateMonochromeBitsPerComponent(LocalFrame* frame) const
{
ASSERT(frame && frame->page() && frame->page()->mainFrame());
- if (screenIsMonochrome(frame->page()->mainFrame()->view()))
- return screenDepthPerComponent(frame->view());
- return 0;
+ if (!frame->page()->mainFrame()->isLocalFrame()
+ || !screenIsMonochrome(toLocalFrame(frame->page()->mainFrame())->view()))
+ return 0;
+ return screenDepthPerComponent(frame->view());
}
int MediaValues::calculateDefaultFontSize(LocalFrame* frame) const

Powered by Google App Engine
This is Rietveld 408576698