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

Unified Diff: Source/core/rendering/RenderView.cpp

Issue 15927026: Enabled using viewport on desktop browsers behind experimental flag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP Created 7 years, 5 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/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 89e7169c5c08d83d5b18c51f9839b8b1b81cc380..0919483c436d4cd88474d19584261576624e7b01 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -28,6 +28,7 @@
#include "core/page/Frame.h"
#include "core/page/FrameView.h"
#include "core/page/Page.h"
+#include "core/page/Settings.h"
#include "core/platform/graphics/filters/custom/CustomFilterGlobalContext.h"
#include "core/platform/graphics/FloatQuad.h"
#include "core/platform/graphics/GraphicsContext.h"
@@ -950,6 +951,16 @@ bool RenderView::rootBackgroundIsEntirelyFixed() const
return rootRenderer->hasEntirelyFixedBackground();
}
+bool RenderView::useDesktopStyleLayout() const
+{
+ Page* page = document()->page();
+
+ if (!page)
+ return false;
+
+ return !page->settings()->layoutFallbackWidth();
+}
+
LayoutRect RenderView::backgroundRect(RenderBox* backgroundRenderer) const
{
if (!hasColumns())
@@ -977,8 +988,9 @@ int RenderView::viewHeight() const
int height = 0;
if (!shouldUsePrintingLayout() && m_frameView) {
height = m_frameView->layoutHeight();
- height = m_frameView->useFixedLayout() ? ceilf(style()->effectiveZoom() * float(height)) : height;
aelias_OOO_until_Jul13 2013/07/31 22:31:21 This is a legacy of one of the other WebKit ports,
+ height = !useDesktopStyleLayout() ? ceilf(style()->effectiveZoom() * float(height)) : height;
}
+
return height;
}
@@ -987,8 +999,9 @@ int RenderView::viewWidth() const
int width = 0;
if (!shouldUsePrintingLayout() && m_frameView) {
width = m_frameView->layoutWidth();
- width = m_frameView->useFixedLayout() ? ceilf(style()->effectiveZoom() * float(width)) : width;
+ width = !useDesktopStyleLayout() ? ceilf(style()->effectiveZoom() * float(width)) : width;
}
+
return width;
}

Powered by Google App Engine
This is Rietveld 408576698