Commit 249504f0 authored by aelias@chromium.org's avatar aelias@chromium.org

Reland of place pinch scrollbars with regular scrollbars. (patchset #1 id:1 of...

Reland of place pinch scrollbars with regular scrollbars. (patchset #1 id:1 of https://codereview.chromium.org/1318603005/ )

Reason for revert:
After discussion with samuong@, the original patch should be OK to reland as is and https://codereview.chromium.org/1317153002 is an appropriate fix for the crasher.

Original issue's description:
> Revert of Replace pinch scrollbars with regular scrollbars. (patchset #10 id:180001 of https://codereview.chromium.org/1308053003/ )
> 
> Reason for revert:
> Introduced ChromeDriver devtools mobile emulation crash https://code.google.com/p/chromedriver/issues/detail?id=1205
> 
> Original issue's description:
> > Replace pinch scrollbars with regular scrollbars.
> > 
> > This patch makes the visual-viewport-managed scrollbars exclusive to
> > Android and improves normal scrollbars to be usable during pinch as follows:
> > 
> > 1. Attach the scrollbar layers to the visual viewport, so they're always
> >    onscreen as you zoom in (as already shipped on Mac).
> > 2. Set the container layer to the inner clip layer, so that the size and
> >    position of the thumb reflects the sum of the two viewports,
> >    instead of just the layout viewport.
> > 
> > Note that result of these changes is visually indistiguishable at
> > minimum page scale.  It only improves the behavior when zoomed in.
> > 
> > BUG=523056
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201285
> 
> TBR=rbyers@chromium.org,skobes@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=523056
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201333

TBR=rbyers@chromium.org,skobes@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=523056

Review URL: https://codereview.chromium.org/1305223004

git-svn-id: svn://svn.chromium.org/blink/trunk@201337 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e69db098
......@@ -917,6 +917,20 @@ crbug.com/492511 [ Mac ] fast/text/atsui-negative-spacing-features.html [ ImageO
crbug.com/492511 [ Mac ] fast/text/atsui-spacing-features.html [ ImageOnlyFailure ]
crbug.com/492511 [ Mac ] fast/text/international/arabic-justify.html [ ImageOnlyFailure ]
crbug.com/523056 compositing/fixed-body-background-positioned.html [ NeedsRebaseline ]
crbug.com/523056 compositing/geometry/fixed-position.html [ NeedsRebaseline ]
crbug.com/523056 compositing/geometry/vertical-scroll-composited.html [ NeedsRebaseline ]
crbug.com/523056 compositing/overflow/fixed-position-ancestor-clip.html [ NeedsRebaseline ]
crbug.com/523056 fast/repaint/absolute-position-changed.html [ NeedsRebaseline ]
crbug.com/523056 virtual/prefer_compositing_to_lcd_text/compositing/overflow/fixed-position-ancestor-clip.html [ NeedsRebaseline ]
crbug.com/523056 compositing/geometry/fixed-position-composited-page-scale-down.html [ NeedsRebaseline ]
crbug.com/523056 compositing/geometry/fixed-position-iframe-composited-page-scale-down.html [ NeedsRebaseline ]
crbug.com/523056 compositing/geometry/fixed-position-transform-composited-page-scale-down.html [ NeedsRebaseline ]
crbug.com/523056 compositing/geometry/fixed-position-iframe-composited-page-scale.html [ NeedsRebaseline ]
crbug.com/523056 compositing/geometry/fixed-position-composited-page-scale.html [ NeedsRebaseline ]
crbug.com/523056 compositing/geometry/fixed-position-transform-composited-page-scale.html [ NeedsRebaseline ]
crbug.com/523056 compositing/scaling/tiled-layer-recursion.html [ NeedsRebaseline ]
# Temporary, until [Unforgeable] attributes have the right accessors 'get' and 'set'.
crbug.com/491006 http/tests/security/cross-origin-access-over-property-descriptor.html [ Failure ]
......@@ -1013,8 +1027,6 @@ crbug.com/509025 [ Yosemite ] paint/invalidation/animated-gif.html [ Failure ]
crbug.com/509025 [ Yosemite ] svg/custom/absolute-sized-content-with-resources.xhtml [ Failure ]
crbug.com/509025 [ Yosemite ] svg/custom/bug78807.svg [ Failure ]
crbug.com/509025 [ Yosemite ] svg/text/text-rescale.html [ Failure ]
crbug.com/509025 [ Yosemite ] compositing/geometry/fixed-position-iframe-composited-page-scale-down.html [ ImageOnlyFailure ]
crbug.com/509025 [ Yosemite ] compositing/geometry/fixed-position-iframe-composited-page-scale.html [ ImageOnlyFailure ]
crbug.com/509025 [ Yosemite ] compositing/iframes/iframe-copy-on-scroll.html [ ImageOnlyFailure ]
crbug.com/509025 [ Yosemite ] compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents.html [ ImageOnlyFailure ]
crbug.com/509025 [ Yosemite ] compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers.html [ ImageOnlyFailure Failure Timeout ]
......@@ -1061,7 +1073,6 @@ crbug.com/509025 [ Yosemite ] virtual/prefer_compositing_to_lcd_text/scrollbars/
crbug.com/509025 [ Yosemite ] virtual/threaded/compositing/visibility/visibility-image-layers.html [ ImageOnlyFailure ]
crbug.com/509025 [ Yosemite ] virtual/threaded/printing/return-from-printing-mode.html [ ImageOnlyFailure ]
crbug.com/509025 [ Yosemite ] paint/inline/outline-offset.html [ Missing ]
crbug.com/509025 [ Yosemite ] compositing/geometry/vertical-scroll-composited.html [ Failure ]
crbug.com/509025 [ Yosemite ] fast/block/lineboxcontain/block-with-ideographs.xhtml [ Failure ]
# TODO(tkent): Needs to increase padding-right.
crbug.com/509025 [ Yosemite ] fast/encoding/denormalised-voiced-japanese-chars.html [ Failure ]
......
......@@ -2,6 +2,10 @@
<html>
<head>
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.fixed-no-z-index {
position: absolute;
left: 10px;
......
......@@ -2,6 +2,10 @@
<html>
<head>
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.fixed-no-z-index {
position: absolute;
left: 10px;
......
......@@ -2,6 +2,10 @@
<html>
<head>
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.fixed-no-z-index {
position: absolute;
left: 10px;
......
......@@ -2,6 +2,10 @@
<html>
<head>
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.fixed-no-z-index {
position: absolute;
left: 10px;
......
......@@ -2,6 +2,10 @@
<html>
<head>
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.fixed-no-z-index {
position: absolute;
left: 10px;
......
......@@ -2,6 +2,10 @@
<html>
<head>
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.fixed-no-z-index {
position: absolute;
left: 10px;
......
......@@ -7,6 +7,10 @@
<title>Position fixed</title>
<script src="../resources/mock_scrollbars.js"></script>
<style type="text/css" media="screen">
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
body {
height: 1000px;
width: 1000px;
......
......@@ -5,7 +5,12 @@
if (window.testRunner)
testRunner.waitUntilDone();
</script>
<script src="../resources/mock_scrollbars.js"></script>
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
</style>
</head>
<body style="height: 600px">
<div style="transform: rotate3d(0,0,1,20deg); width: 800px; height: 1000px; border-style: solid; border-color: Red; border-width: 3px; background-image: url(../resources/apple.jpg); background-repeat:repeat"></div>
......
......@@ -4,6 +4,10 @@
<head>
<title>Position fixed with transform</title>
<style type="text/css" media="screen">
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
body {
height: 1000px;
width: 1000px;
......
......@@ -3,6 +3,10 @@
<html>
<head>
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.composited {
background-color: green;
width: 200px;
......
......@@ -2,6 +2,10 @@
<head>
<link rel="stylesheet" href="resources/default.css">
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
html {
overflow: scroll;
}
......
......@@ -8,6 +8,10 @@ internals.settings.setViewportMetaEnabled(true);
</script>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
body {
width: 1000px;
height: 1000px;
......
......@@ -666,6 +666,13 @@ bool FrameView::usesCompositedScrolling() const
return false;
}
GraphicsLayer* FrameView::layerForScrollbarContainer() const
{
if (m_frame->isMainFrame())
return page()->frameHost().visualViewport().layerForScrollbarContainer();
return layerForContainer();
}
GraphicsLayer* FrameView::layerForScrolling() const
{
LayoutView* layoutView = this->layoutView();
......
......@@ -345,6 +345,7 @@ public:
IntRect scrollableAreaBoundingBox() const override;
bool scrollAnimatorEnabled() const override;
bool usesCompositedScrolling() const override;
GraphicsLayer* layerForScrollbarContainer() const override;
GraphicsLayer* layerForScrolling() const override;
GraphicsLayer* layerForHorizontalScrollbar() const override;
GraphicsLayer* layerForVerticalScrollbar() const override;
......
......@@ -49,7 +49,7 @@
#include "platform/graphics/GraphicsLayer.h"
#include "platform/graphics/GraphicsLayerFactory.h"
#include "platform/scroll/Scrollbar.h"
#include "platform/scroll/ScrollbarTheme.h"
#include "platform/scroll/ScrollbarThemeOverlay.h"
#include "public/platform/Platform.h"
#include "public/platform/WebCompositorSupport.h"
#include "public/platform/WebLayer.h"
......@@ -106,8 +106,7 @@ void VisualViewport::setSize(const IntSize& size)
m_innerViewportContainerLayer->setSize(m_size);
// Need to re-compute sizes for the overlay scrollbars.
setupScrollbar(WebScrollbar::Horizontal);
setupScrollbar(WebScrollbar::Vertical);
initializeScrollbars();
}
if (autosizerNeedsUpdating) {
......@@ -273,11 +272,9 @@ bool VisualViewport::magnifyScaleAroundAnchor(float magnifyDelta, const FloatPoi
// | +-- outerViewportContainerLayer (fixed pos container) [frame container layer in DeprecatedPaintLayerCompositor]
// | | +-- outerViewportScrollLayer [frame scroll layer in DeprecatedPaintLayerCompositor]
// | | +-- content layers ...
// | +-- horizontal ScrollbarLayer (non-overlay)
// | +-- verticalScrollbarLayer (non-overlay)
// | +-- scroll corner (non-overlay)
// +- *horizontalScrollbarLayer (overlay)
// +- *verticalScrollbarLayer (overlay)
// +- horizontalScrollbarLayer
// +- verticalScrollbarLayer
// +- scroll corner (non-overlay only)
//
void VisualViewport::attachToLayerTree(GraphicsLayer* currentLayerTreeRoot, GraphicsLayerFactory* graphicsLayerFactory)
{
......@@ -324,21 +321,33 @@ void VisualViewport::attachToLayerTree(GraphicsLayer* currentLayerTreeRoot, Grap
m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get());
m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get());
m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get());
m_innerViewportContainerLayer->addChild(m_overlayScrollbarHorizontal.get());
m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.get());
// Ensure this class is set as the scroll layer's ScrollableArea.
coordinator->scrollableAreaScrollLayerDidChange(this);
// Setup the inner viewport overlay scrollbars.
setupScrollbar(WebScrollbar::Horizontal);
setupScrollbar(WebScrollbar::Vertical);
initializeScrollbars();
}
m_innerViewportScrollLayer->removeAllChildren();
m_innerViewportScrollLayer->addChild(currentLayerTreeRoot);
}
void VisualViewport::initializeScrollbars()
{
if (visualViewportSuppliesScrollbars()) {
if (!m_overlayScrollbarHorizontal->parent())
m_innerViewportContainerLayer->addChild(m_overlayScrollbarHorizontal.get());
if (!m_overlayScrollbarVertical->parent())
m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.get());
} else {
m_overlayScrollbarHorizontal->removeFromParent();
m_overlayScrollbarVertical->removeFromParent();
}
setupScrollbar(WebScrollbar::Horizontal);
setupScrollbar(WebScrollbar::Vertical);
}
void VisualViewport::setupScrollbar(WebScrollbar::Orientation orientation)
{
bool isHorizontal = orientation == WebScrollbar::Horizontal;
......@@ -347,17 +356,10 @@ void VisualViewport::setupScrollbar(WebScrollbar::Orientation orientation)
OwnPtr<WebScrollbarLayer>& webScrollbarLayer = isHorizontal ?
m_webOverlayScrollbarHorizontal : m_webOverlayScrollbarVertical;
int thumbThickness = frameHost().settings().pinchOverlayScrollbarThickness();
int scrollbarThickness = thumbThickness;
int scrollbarMargin = scrollbarThickness;
// FIXME: Rather than manually creating scrollbar layers, we should create
// real scrollbars so we can reuse all the machinery from ScrollbarTheme.
#if OS(ANDROID)
thumbThickness = ScrollbarTheme::theme()->thumbThickness(0);
scrollbarThickness = ScrollbarTheme::theme()->scrollbarThickness(RegularScrollbar);
scrollbarMargin = ScrollbarTheme::theme()->scrollbarMargin();
#endif
ScrollbarTheme* theme = ScrollbarThemeOverlay::mobileTheme();
int thumbThickness = theme->thumbThickness(0);
int scrollbarThickness = theme->scrollbarThickness(RegularScrollbar);
int scrollbarMargin = theme->scrollbarMargin();
if (!webScrollbarLayer) {
ScrollingCoordinator* coordinator = frameHost().page().scrollingCoordinator();
......@@ -370,7 +372,6 @@ void VisualViewport::setupScrollbar(WebScrollbar::Orientation orientation)
// The compositor will control the scrollbar's visibility. Set to invisible by defualt
// so scrollbars don't show up in layout tests.
webScrollbarLayer->layer()->setOpacity(0);
scrollbarGraphicsLayer->setContentsToPlatformLayer(webScrollbarLayer->layer());
scrollbarGraphicsLayer->setDrawsContent(false);
}
......@@ -409,6 +410,14 @@ void VisualViewport::registerLayersWithTreeView(WebLayerTreeView* layerTreeView)
m_pageScaleLayer->platformLayer(),
m_innerViewportScrollLayer->platformLayer(),
scrollLayer);
// TODO(aelias): Remove this call after this setting is deleted.
layerTreeView->setHidePinchScrollbarsNearMinScale(false);
}
bool VisualViewport::visualViewportSuppliesScrollbars() const
{
return frameHost().settings().viewportMetaEnabled();
}
void VisualViewport::clearLayersForTreeView(WebLayerTreeView* layerTreeView) const
......
......@@ -87,6 +87,8 @@ public:
return m_innerViewportScrollLayer.get();
}
void initializeScrollbars();
// Sets the location of the visual viewport relative to the outer viewport. The
// coordinates are in partial CSS pixels.
void setLocation(const FloatPoint&);
......@@ -195,6 +197,8 @@ public:
private:
explicit VisualViewport(FrameHost&);
bool visualViewportSuppliesScrollbars() const;
// GraphicsLayerClient implementation.
void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) override;
String debugName(const GraphicsLayer*) override;
......
......@@ -30,6 +30,7 @@
#include "core/HTMLNames.h"
#include "core/dom/DOMNodeIds.h"
#include "core/fetch/ImageResource.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/RemoteFrame.h"
#include "core/html/HTMLCanvasElement.h"
......@@ -1070,6 +1071,8 @@ void CompositedDeprecatedPaintLayerMapping::updateInternalHierarchy()
// Now constructing the subtree for the overflow controls.
bottomLayer = m_graphicsLayer.get();
if (m_isMainFrameLayoutViewLayer)
bottomLayer = layoutObject()->frame()->page()->frameHost().visualViewport().containerLayer();
updateBottomLayer(m_overflowControlsClippingLayer.get());
updateBottomLayer(m_overflowControlsHostLayer.get());
if (m_layerForHorizontalScrollbar)
......
......@@ -907,14 +907,12 @@ bool DeprecatedPaintLayerCompositor::requiresScrollCornerLayer() const
void DeprecatedPaintLayerCompositor::updateOverflowControlsLayers()
{
GraphicsLayer* controlsParent = m_rootTransformLayer.get() ? m_rootTransformLayer.get() : m_overflowControlsHostLayer.get();
// On Mac, main frame scrollbars should always be stuck to the sides of the screen (in overscroll and in pinch-zoom), so
// Main frame scrollbars should always be stuck to the sides of the screen (in overscroll and in pinch-zoom), so
// make the parent for the scrollbars be the viewport container layer.
#if OS(MACOSX)
if (m_layoutView.frame()->isMainFrame()) {
VisualViewport& visualViewport = m_layoutView.frameView()->page()->frameHost().visualViewport();
controlsParent = visualViewport.containerLayer();
}
#endif
if (requiresHorizontalScrollbarLayer()) {
if (!m_layerForHorizontalScrollbar) {
......
......@@ -381,8 +381,8 @@ void ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea*
}
WebLayer* scrollLayer = toWebLayer(scrollableArea->layerForScrolling());
WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer());
setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollLayer, containerLayer);
WebLayer* scrollbarContainerLayer = toWebLayer(scrollableArea->layerForScrollbarContainer());
setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollLayer, scrollbarContainerLayer);
// Root layer non-overlay scrollbars should be marked opaque to disable
// blending.
......@@ -403,6 +403,7 @@ bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
WebLayer* webLayer = toWebLayer(scrollableArea->layerForScrolling());
WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer());
WebLayer* scrollbarContainerLayer = toWebLayer(scrollableArea->layerForScrollbarContainer());
if (webLayer) {
webLayer->setScrollClipLayer(containerLayer);
// Non-layered Viewport constrained objects, e.g. fixed position elements, are
......@@ -431,12 +432,13 @@ bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, HorizontalScrollbar)) {
GraphicsLayer* horizontalScrollbarLayer = scrollableArea->layerForHorizontalScrollbar();
if (horizontalScrollbarLayer)
setupScrollbarLayer(horizontalScrollbarLayer, scrollbarLayer, webLayer, containerLayer);
setupScrollbarLayer(horizontalScrollbarLayer, scrollbarLayer, webLayer, scrollbarContainerLayer);
}
if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, VerticalScrollbar)) {
GraphicsLayer* verticalScrollbarLayer = scrollableArea->layerForVerticalScrollbar();
if (verticalScrollbarLayer)
setupScrollbarLayer(verticalScrollbarLayer, scrollbarLayer, webLayer, containerLayer);
setupScrollbarLayer(verticalScrollbarLayer, scrollbarLayer, webLayer, scrollbarContainerLayer);
}
// Update the viewport layer registration if the outer viewport may have changed.
......
......@@ -49,6 +49,7 @@
#include "core/dom/Node.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/FrameSelection.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
......@@ -170,6 +171,13 @@ HostWindow* DeprecatedPaintLayerScrollableArea::hostWindow() const
return nullptr;
}
GraphicsLayer* DeprecatedPaintLayerScrollableArea::layerForScrollbarContainer() const
{
if (layer()->isRootLayer())
return box().frame()->host()->visualViewport().layerForScrollbarContainer();
return layerForContainer();
}
GraphicsLayer* DeprecatedPaintLayerScrollableArea::layerForScrolling() const
{
return layer()->hasCompositedDeprecatedPaintLayerMapping() ? layer()->compositedDeprecatedPaintLayerMapping()->scrollingContentsLayer() : 0;
......
......@@ -85,6 +85,7 @@ public:
HostWindow* hostWindow() const override;
GraphicsLayer* layerForScrollbarContainer() const override;
GraphicsLayer* layerForScrolling() const override;
GraphicsLayer* layerForHorizontalScrollbar() const override;
GraphicsLayer* layerForVerticalScrollbar() const override;
......
......@@ -259,6 +259,7 @@ public:
}
virtual GraphicsLayer* layerForContainer() const;
virtual GraphicsLayer* layerForScrollbarContainer() const { return layerForContainer(); }
virtual GraphicsLayer* layerForScrolling() const { return 0; }
virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; }
virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; }
......
......@@ -32,8 +32,7 @@ namespace blink {
ScrollbarTheme* ScrollbarTheme::nativeTheme()
{
DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (3, 3, ScrollbarThemeOverlay::DisallowHitTest, Color(128, 128, 128, 128)));
return &theme;
return ScrollbarThemeOverlay::mobileTheme();
}
} // namespace blink
......@@ -170,4 +170,10 @@ ScrollbarPart ScrollbarThemeOverlay::hitTest(ScrollbarThemeClient* scrollbar, co
return ScrollbarTheme::hitTest(scrollbar, position);
}
ScrollbarTheme* ScrollbarThemeOverlay::mobileTheme()
{
DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (3, 3, ScrollbarThemeOverlay::DisallowHitTest, Color(128, 128, 128, 128)));
return &theme;
}
} // namespace blink
......@@ -59,6 +59,8 @@ public:
void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) override;
ScrollbarPart hitTest(ScrollbarThemeClient*, const IntPoint&) override;
static ScrollbarTheme* mobileTheme();
private:
int m_thumbThickness;
int m_scrollbarMargin;
......
......@@ -5,6 +5,7 @@
#include "config.h"
#include "web/DevToolsEmulator.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
#include "core/page/Page.h"
......@@ -213,6 +214,7 @@ void DevToolsEmulator::enableMobileEmulation()
RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true);
m_webViewImpl->enableViewport();
m_webViewImpl->settings()->setViewportMetaEnabled(true);
m_webViewImpl->page()->frameHost().visualViewport().initializeScrollbars();
m_webViewImpl->settings()->setShrinksViewportContentToFit(true);
m_webViewImpl->page()->settings().setTextAutosizingEnabled(true);
m_webViewImpl->page()->settings().setPreferCompositingToLCDTextEnabled(true);
......@@ -223,8 +225,6 @@ void DevToolsEmulator::enableMobileEmulation()
m_originalDefaultMinimumPageScaleFactor = m_webViewImpl->defaultMinimumPageScaleFactor();
m_originalDefaultMaximumPageScaleFactor = m_webViewImpl->defaultMaximumPageScaleFactor();
m_webViewImpl->setDefaultPageScaleLimits(0.25f, 5);
if (m_webViewImpl->layerTreeView())
m_webViewImpl->layerTreeView()->setHidePinchScrollbarsNearMinScale(false);
}
void DevToolsEmulator::disableMobileEmulation()
......@@ -234,6 +234,7 @@ void DevToolsEmulator::disableMobileEmulation()
RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_isOverlayScrollbarsEnabled);
m_webViewImpl->disableViewport();
m_webViewImpl->settings()->setViewportMetaEnabled(false);
m_webViewImpl->page()->frameHost().visualViewport().initializeScrollbars();
m_webViewImpl->settings()->setShrinksViewportContentToFit(false);
m_webViewImpl->page()->settings().setTextAutosizingEnabled(m_embedderTextAutosizingEnabled);
m_webViewImpl->page()->settings().setPreferCompositingToLCDTextEnabled(m_embedderPreferCompositingToLCDTextEnabled);
......@@ -244,10 +245,6 @@ void DevToolsEmulator::disableMobileEmulation()
m_webViewImpl->setDefaultPageScaleLimits(
m_originalDefaultMinimumPageScaleFactor,
m_originalDefaultMaximumPageScaleFactor);
if (m_webViewImpl->layerTreeView()) {
m_webViewImpl->layerTreeView()->setHidePinchScrollbarsNearMinScale(
m_hidePinchScrollbarsNearMinScale);
}
}
void DevToolsEmulator::setTouchEventEmulationEnabled(bool enabled)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment