1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 #include "web/ResizeViewportAnchor.h"
8 #include "core/frame/FrameView.h"
9 #include "core/frame/VisualViewport.h"
10 #include "platform/geometry/DoubleRect.h"
11 #include "platform/geometry/DoubleSize.h"
12 #include "platform/geometry/FloatSize.h"
16 ResizeViewportAnchor::ResizeViewportAnchor(FrameView
& rootFrameView
, VisualViewport
& visualViewport
)
17 : ViewportAnchor(rootFrameView
, visualViewport
)
18 , m_visualViewportInDocument(rootFrameView
.scrollableArea()->visibleContentRectDouble().location())
22 ResizeViewportAnchor::~ResizeViewportAnchor()
24 m_rootFrameView
->scrollableArea()->setScrollPosition(m_visualViewportInDocument
, ProgrammaticScroll
);