New issue
Advanced search Search tips

Issue 810573 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Page scale Factor is not clamped in blink

Project Member Reported by khushals...@chromium.org, Feb 8 2018

Issue description

Blink pushes 3 page scale associated values in cc[1], the page scale factor and the min/max values that the final page scale should be clamped to. These limits are used in cc to clamp the value when manipulate on the compositor thread from user input.

But blink should be doing the clamping itself when pushing the values to cc. I did a layout test run with a CHECK for it and a bunch of tests break[2].

[1]: https://cs.chromium.org/chromium/src/cc/trees/layer_tree_host.cc?sq=package:chromium&l=1084
[2]: https://storage.googleapis.com/chromium-layout-test-archives/linux_chromium_rel_ng/643172/layout-test-results/results.html

 

Comment 1 by rtoy@chromium.org, Feb 9 2018

Components: -Blink Blink>Compositing
Could you put up a WIP patch for the change that you made to test the effect of changing Blink? And link it here?

Comment 3 by bokan@chromium.org, Feb 9 2018

Layout tests generally assume desktop behavior so the limits are minimum: 1 maximum: 4 IIRC. I've noticed tests that try to set the page scale to < 1 to test out Android like behavior. They're often wrong in other ways since layout tests don't behave like Android in all sorts of ways.

The issue here isn't so much that Blink doesn't clamp these values but that the test itself is setting an invalid scale. I think all these tests are explicitly setting a scale from the internals method. A quick look at a few of these shows they aren't also changing the limits from the default desktop ones.

A simple fix would be to make sure all these tests also call SetPageScaleFactorLimits. That'll keep them working as today and make CC happy - though it puts them into a weird mode that probably has other quirks (well, it keeps them in that mode).

Comment 4 by bokan@chromium.org, Feb 12 2018

Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Feb 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9f6f4b570a323c115bab307d14c02005035abcbd

commit 9f6f4b570a323c115bab307d14c02005035abcbd
Author: David Bokan <bokan@chromium.org>
Date: Thu Feb 15 01:50:54 2018

Fix page scale limit errors in layout tests

Adding DCHECKs in LayerTreeHost::SetPageScaleFactorAndLimits shows that
we sometimes set inconsistent limits and page scale factor. This shows
up in Blink for two reasons, fixed in this patch:

1. When we finish running a layout test, we call
Internals::ResetToConsistentState which calls SetPageScaleFactor(1). If
the test modified the limits this may not be a valid scale factor. We
now reset the limits in this method as well.

2. Some tests set the page scale factor without regard for the default
limits. The default limits in layout tests are [1, 4] so many tests that
tried setting scale factors < 1.0 would silently fail to do so. This CL
fixes these tests by changing the limits appropriately.

As a result of #2, behavior on some tests has changed as they now
actually run using the scale factor they purported to set. This required
rebaselining tests in compositing/layer-creation since the root layer
size depends on the minimum-scale which is now changed.
zoom-scroll-page-test.html also needed a small change to increase the
amount of scrollable content. Without this change, zooming out makes
some of the requested scroll positions outside the maximum scroll
position.

Finally, this CL actually ensures the Blink only clamps the page scale
factor before setting it. This also revealed that all unit tests based
on PageTestBase were running without scale factor limits set.

Bug:  810573 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I4f662777da82c8f33263a0eb05f49958f3112e45
Reviewed-on: https://chromium-review.googlesource.com/913972
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Khushal <khushalsagar@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536922}
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/cc/trees/layer_tree_host.cc
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/compositing/background-color/background-color-outside-document.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport-expected.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled-expected.txt
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled-iframe-scroll.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled-iframe.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled-scroll-expected.txt
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled-scroll.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/fast/backgrounds/root-background-with-page-scaled-out-expected.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/fast/backgrounds/root-background-with-page-scaled-out.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/fast/dom/zoom-scroll-page-test.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/fast/frames/iframe-double-scale-contents.html
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/virtual/spv175/compositing/layer-creation/fixed-position-out-of-view-scaled-expected.txt
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/LayoutTests/virtual/spv175/compositing/layer-creation/fixed-position-out-of-view-scaled-scroll-expected.txt
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/Source/core/editing/finder/TextFinderTest.cpp
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/9f6f4b570a323c115bab307d14c02005035abcbd/third_party/WebKit/Source/core/testing/PageTestBase.cpp

Comment 6 by bokan@chromium.org, Feb 15 2018

Status: Fixed (was: Started)

Sign in to add a comment