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

Unified Diff: third_party/WebKit/Source/core/frame/PageScaleConstraintsSet.cpp

Issue 1573283002: Don't change layout size due to top control show/hide (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant call to viewportSizeForViewportUnits Created 4 years, 11 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: third_party/WebKit/Source/core/frame/PageScaleConstraintsSet.cpp
diff --git a/third_party/WebKit/Source/core/frame/PageScaleConstraintsSet.cpp b/third_party/WebKit/Source/core/frame/PageScaleConstraintsSet.cpp
index aa08eada8d871ea8f1c5b82c88110cf05286260d..3b9c24a2c273878dbaec7d603456bb853ca18619 100644
--- a/third_party/WebKit/Source/core/frame/PageScaleConstraintsSet.cpp
+++ b/third_party/WebKit/Source/core/frame/PageScaleConstraintsSet.cpp
@@ -57,7 +57,7 @@ const PageScaleConstraints& PageScaleConstraintsSet::defaultConstraints() const
void PageScaleConstraintsSet::updatePageDefinedConstraints(const ViewportDescription& description, Length legacyFallbackWidth)
{
- m_pageDefinedConstraints = description.resolve(FloatSize(m_viewSize), legacyFallbackWidth);
+ m_pageDefinedConstraints = description.resolve(FloatSize(m_icbSize), legacyFallbackWidth);
m_constraintsDirty = true;
}
@@ -99,7 +99,7 @@ void PageScaleConstraintsSet::computeFinalConstraints()
void PageScaleConstraintsSet::adjustFinalConstraintsToContentsSize(IntSize contentsSize, int nonOverlayScrollbarWidth, bool shrinksViewportContentToFit)
{
if (shrinksViewportContentToFit)
- m_finalConstraints.fitToContentsWidth(contentsSize.width(), m_viewSize.width() - nonOverlayScrollbarWidth);
+ m_finalConstraints.fitToContentsWidth(contentsSize.width(), m_icbSize.width() - nonOverlayScrollbarWidth);
m_finalConstraints.resolveAutoInitialScale();
}
@@ -152,24 +152,15 @@ static float computeHeightByAspectRatio(float width, const FloatSize& deviceSize
return width * (deviceSize.height() / deviceSize.width());
}
-void PageScaleConstraintsSet::didChangeViewSize(const IntSize& size)
+void PageScaleConstraintsSet::didChangeInitialContainingBlockSize(const IntSize& size)
{
- if (m_viewSize == size)
+ if (m_icbSize == size)
return;
- m_viewSize = size;
+ m_icbSize = size;
m_constraintsDirty = true;
}
-IntSize PageScaleConstraintsSet::mainFrameSize() const
-{
- // The frame size should match the viewport size at minimum scale, since the
- // viewport must always be contained by the frame.
- FloatSize frameSize(m_viewSize);
- frameSize.scale(1 / finalConstraints().minimumScale);
- return expandedIntSize(frameSize);
-}
-
IntSize PageScaleConstraintsSet::layoutSize() const
{
return flooredIntSize(computeConstraintsStack().layoutSize);
@@ -215,16 +206,16 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
if (useWideViewport && (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom) && description.zoom != 1.0f) {
if (layoutFallbackWidth)
adjustedLayoutSizeWidth = layoutFallbackWidth;
- adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, FloatSize(m_viewSize));
+ adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, FloatSize(m_icbSize));
} else if (!useWideViewport) {
const float nonWideScale = description.zoom < 1 && description.maxWidth.type() != DeviceWidth && description.maxWidth.type() != DeviceHeight ? -1 : oldInitialScale;
- adjustedLayoutSizeWidth = getLayoutWidthForNonWideViewport(FloatSize(m_viewSize), nonWideScale) / targetDensityDPIFactor;
+ adjustedLayoutSizeWidth = getLayoutWidthForNonWideViewport(FloatSize(m_icbSize), nonWideScale) / targetDensityDPIFactor;
float newInitialScale = targetDensityDPIFactor;
if (m_userAgentConstraints.initialScale != -1 && (description.maxWidth.type() == DeviceWidth || ((description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom) && description.zoom == -1))) {
adjustedLayoutSizeWidth /= m_userAgentConstraints.initialScale;
newInitialScale = m_userAgentConstraints.initialScale;
}
- adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, FloatSize(m_viewSize));
+ adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, FloatSize(m_icbSize));
if (description.zoom < 1) {
m_pageDefinedConstraints.initialScale = newInitialScale;
if (m_pageDefinedConstraints.minimumScale != -1)
@@ -240,8 +231,8 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
m_pageDefinedConstraints.minimumScale = m_pageDefinedConstraints.initialScale;
m_pageDefinedConstraints.maximumScale = m_pageDefinedConstraints.initialScale;
if (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom || description.maxWidth.type() == DeviceWidth) {
- adjustedLayoutSizeWidth = m_viewSize.width() / targetDensityDPIFactor;
- adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, FloatSize(m_viewSize));
+ adjustedLayoutSizeWidth = m_icbSize.width() / targetDensityDPIFactor;
+ adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, FloatSize(m_icbSize));
}
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/PageScaleConstraintsSet.h ('k') | third_party/WebKit/Source/core/layout/LayoutView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698