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

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

Issue 115693002: Remove several calls to Page::mainFrame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 | « Source/bindings/v8/custom/V8WindowCustom.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryEvaluator.cpp
diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp
index 8b3f768515ebd97aea698aed62d10e22ff150a8e..5673e6e98fcce6a374a17bda7fe294490d169bd1 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -189,7 +189,7 @@ static bool numberValue(CSSValue* value, float& result)
static bool colorMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
{
- int bitsPerComponent = screenDepthPerComponent(frame->page()->mainFrame()->view());
+ int bitsPerComponent = screenDepthPerComponent(frame->view());
float number;
if (value)
return numberValue(value, number) && compareValue(bitsPerComponent, static_cast<int>(number), op);
@@ -211,7 +211,7 @@ static bool colorIndexMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, Me
static bool monochromeMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix op)
{
- if (!screenIsMonochrome(frame->page()->mainFrame()->view())) {
+ if (!screenIsMonochrome(frame->view())) {
if (value) {
float number;
return numberValue(value, number) && compareValue(0, static_cast<int>(number), op);
@@ -258,7 +258,7 @@ static bool aspectRatioMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* fr
static bool deviceAspectRatioMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
{
if (value) {
- FloatRect sg = screenRect(frame->page()->mainFrame()->view());
+ FloatRect sg = screenRect(frame->view());
return compareAspectRatioValue(value, static_cast<int>(sg.width()), static_cast<int>(sg.height()), op);
}
@@ -363,7 +363,7 @@ static bool deviceHeightMediaFeatureEval(CSSValue* value, RenderStyle* style, Fr
int length;
if (!computeLength(value, !frame->document()->inQuirksMode(), style, length))
return false;
- int height = static_cast<int>(screenRect(frame->page()->mainFrame()->view()).height());
+ int height = static_cast<int>(screenRect(frame->view()).height());
if (frame->settings()->reportScreenSizeInPhysicalPixelsQuirk())
height = lroundf(height * frame->page()->deviceScaleFactor());
return compareValue(height, length, op);
@@ -379,7 +379,7 @@ static bool deviceWidthMediaFeatureEval(CSSValue* value, RenderStyle* style, Fra
int length;
if (!computeLength(value, !frame->document()->inQuirksMode(), style, length))
return false;
- int width = static_cast<int>(screenRect(frame->page()->mainFrame()->view()).width());
+ int width = static_cast<int>(screenRect(frame->view()).width());
if (frame->settings()->reportScreenSizeInPhysicalPixelsQuirk())
width = lroundf(width * frame->page()->deviceScaleFactor());
return compareValue(width, length, op);
« no previous file with comments | « Source/bindings/v8/custom/V8WindowCustom.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698