Index: Source/core/frame/PinchViewport.cpp |
diff --git a/Source/core/frame/PinchViewport.cpp b/Source/core/frame/PinchViewport.cpp |
index 24c49aefce4ae2651dcba554425b57355ef4a596..3c877332714d5e26b104395b96ea3ed1bfde8e5f 100644 |
--- a/Source/core/frame/PinchViewport.cpp |
+++ b/Source/core/frame/PinchViewport.cpp |
@@ -67,7 +67,6 @@ |
PinchViewport::PinchViewport(FrameHost& owner) |
: m_frameHost(owner) |
, m_scale(1) |
- , m_topControlsAdjustment(0) |
{ |
reset(); |
} |
@@ -81,6 +80,8 @@ |
TRACE_EVENT2("blink", "PinchViewport::setSize", "width", size.width(), "height", size.height()); |
m_size = size; |
+ |
+ clampToBoundaries(); |
if (m_innerViewportContainerLayer) { |
m_innerViewportContainerLayer->setSize(m_size); |
@@ -110,7 +111,6 @@ |
FloatRect PinchViewport::visibleRect() const |
{ |
FloatSize scaledSize(m_size); |
- scaledSize.expand(0, m_topControlsAdjustment); |
scaledSize.scale(1 / m_scale); |
return FloatRect(m_offset, scaledSize); |
} |
@@ -356,25 +356,7 @@ |
IntPoint PinchViewport::maximumScrollPosition() const |
{ |
- // FIXME: We probably shouldn't be storing the bounds in a float. crbug.com/422331. |
- FloatSize frameViewSize(contentsSize()); |
- |
- if (m_topControlsAdjustment) { |
- float aspectRatio = visibleRect().width() / visibleRect().height(); |
- float adjustment = frameViewSize.width() / aspectRatio - frameViewSize.height(); |
- frameViewSize.expand(0, adjustment); |
- } |
- |
- frameViewSize.scale(m_scale); |
- frameViewSize = flooredIntSize(frameViewSize); |
- |
- FloatSize viewportSize(m_size); |
- viewportSize.expand(0, m_topControlsAdjustment); |
- |
- FloatSize maxPosition = frameViewSize - viewportSize; |
- maxPosition.scale(1 / m_scale); |
- |
- return flooredIntPoint(maxPosition); |
+ return flooredIntPoint(FloatSize(contentsSize()) - visibleRect().size()); |
} |
IntPoint PinchViewport::clampDocumentOffsetAtScale(const IntPoint& offset, float scale) |
@@ -395,11 +377,6 @@ |
clamped = clamped.shrunkTo(max); |
clamped = clamped.expandedTo(min); |
return clamped; |
-} |
- |
-void PinchViewport::setTopControlsAdjustment(float adjustment) |
-{ |
- m_topControlsAdjustment = adjustment; |
} |
IntRect PinchViewport::scrollableAreaBoundingBox() const |