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

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

Issue 14659008: Include scrollbar size in @media width/height (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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/MediaQueryEvaluator.cpp
diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp
index db54b7745bd630e9548e8c5356a84526e4eac674..a2412375682dd36b527f187c215ffdc1e68231dc 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -248,8 +248,8 @@ static bool monochromeMediaFeatureEval(CSSValue* value, RenderStyle* style, Fram
static bool orientationMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix)
{
FrameView* view = frame->view();
- int width = view->layoutWidth();
- int height = view->layoutHeight();
+ int width = view->mediaWidth();
+ int height = view->mediaHeight();
if (value && value->isPrimitiveValue()) {
const int id = static_cast<CSSPrimitiveValue*>(value)->getIdent();
if (width > height) // Square viewport is portrait.
@@ -265,7 +265,7 @@ static bool aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* f
{
if (value) {
FrameView* view = frame->view();
- return compareAspectRatioValue(value, view->layoutWidth(), view->layoutHeight(), op);
+ return compareAspectRatioValue(value, view->mediaWidth(), view->mediaHeight(), op);
}
// ({,min-,max-}aspect-ratio)
@@ -476,7 +476,7 @@ static bool heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* f
FrameView* view = frame->view();
if (value) {
- int height = view->layoutHeight();
+ int height = view->mediaHeight();
if (RenderView* renderView = frame->document()->renderView())
height = adjustForAbsoluteZoom(height, renderView);
RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle();
@@ -484,7 +484,7 @@ static bool heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* f
return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(height, length, op);
}
- return view->layoutHeight() != 0;
+ return view->mediaHeight();
}
static bool widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix op)
@@ -492,7 +492,7 @@ static bool widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* fr
FrameView* view = frame->view();
if (value) {
- int width = view->layoutWidth();
+ int width = view->mediaWidth();
if (RenderView* renderView = frame->document()->renderView())
width = adjustForAbsoluteZoom(width, renderView);
RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle();
@@ -500,7 +500,7 @@ static bool widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* fr
return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(width, length, op);
}
- return view->layoutWidth() != 0;
+ return view->mediaWidth();
}
// rest of the functions are trampolines which set the prefix according to the media feature expression used

Powered by Google App Engine
This is Rietveld 408576698