New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 639806 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android , All
Pri: 2
Type: Feature



Sign in to add a comment

Enable hidden scrollbars selectively

Project Member Reported by eseckler@chromium.org, Aug 22 2016

Issue description

We'd like to be able to hide scrollbars only within specific WebContents. We should be able to reuse the existing mechanism for hiding scrollbars, but need a different configuration mechanism (e.g. can't use global overrides in ScrollbarTheme). This will also allow us to get rid of the "--hide-scrollbars" flag.
 
Cc: halliwell@chromium.org
Components: Blink>Scroll
Labels: OS-Android

Comment 3 by aelias@chromium.org, Aug 22 2016

Cc: aelias@chromium.org pkasting@chromium.org
Components: -Blink>Scroll Mobile>WebView
Labels: -Pri-3 M-55 Pri-2
Owner: eseckler@chromium.org
Status: Assigned (was: Available)
It doesn't really address pkasting@'s concern to open a new "available" bug.  It should be assigned and set a milestone.  Could you commit to doing this for 55?

Personally, I have the additional concern that the patch copy-pasted code from Android WebView scrollbar hiding instead of figuring out how to use the same setting for both use cases.
#3: I wasn't aware we were copy-pasting code. Can you expand on that? Do you propose a different way of enforcing hidden scrollbars? Thanks!

Comment 5 by aelias@chromium.org, Aug 22 2016

What I'm referring to is that in http://crrev.com/2175163005, you copy-pasted the two lines:

    settings.scrollbar_animator = cc::LayerTreeSettings::NO_ANIMATOR;
    settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT;

I'd like Android WebView to switch away from branching on "using_synchronous_compositor" to just reusing the same setting headless Chrome uses.  Once we come up with a proper content/ layer API for this, this shouldn't be too difficult given that Android WebView also embeds content/.
That sounds reasonable. Let's aim to do that following the removal of the flag and make sure both headless and WebView use the same "higher level" setting for NO_ANIMATOR/TRANSPARENT.

Comment 7 by aelias@chromium.org, Aug 22 2016

Sounds great, thanks!
Project Member

Comment 8 by bugdroid1@chromium.org, Sep 23 2016

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

commit 61ff9143240cc8bc02688b5d84cc939cb14e7685
Author: eseckler <eseckler@chromium.org>
Date: Fri Sep 23 22:57:59 2016

Replace hide-scrollbars flag with a web setting.

Instead of the composited/non-composited distinction, we now enforce this purely within in Blink in three places: PaintLayerScrollableArea, FrameView, VisualViewport.

Also updates the use of the flag in chromecast/.

BUG= 639806 ,internal b/29253042
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2339873002
Cr-Commit-Position: refs/heads/master@{#420766}

[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/chromecast/browser/BUILD.gn
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/chromecast/browser/DEPS
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/chromecast/browser/cast_browser_main_parts.cc
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/chromecast/browser/cast_content_browser_client.cc
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/content/browser/renderer_host/render_process_host_impl.cc
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/content/child/runtime_features.cc
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/content/public/common/common_param_traits_macros.h
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/content/public/common/web_preferences.cc
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/content/public/common/web_preferences.h
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/content/renderer/gpu/render_widget_compositor.cc
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/content/renderer/render_view_impl.cc
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/LayoutTests/fast/scrolling/hide-scrollbars-expected.html
[add] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/LayoutTests/fast/scrolling/hide-scrollbars-in-frame-expected.html
[add] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/LayoutTests/fast/scrolling/hide-scrollbars-in-frame.html
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/LayoutTests/fast/scrolling/hide-scrollbars.html
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/core/frame/Settings.in
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/core/testing/InternalSettings.cpp
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/core/testing/InternalSettings.h
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/core/testing/InternalSettings.idl
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlayMock.h
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/web/WebSettingsImpl.cpp
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/web/WebSettingsImpl.h
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/public/web/WebRuntimeFeatures.h
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/third_party/WebKit/public/web/WebSettings.h
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/ui/native_theme/native_theme_switches.cc
[modify] https://crrev.com/61ff9143240cc8bc02688b5d84cc939cb14e7685/ui/native_theme/native_theme_switches.h

Comment 9 by aelias@chromium.org, Sep 26 2016

Cc: sgu...@chromium.org
eseckler@ asked me by email whether we should move WebView to this setting, replying here for the record:

It sounds great to move WebView to use this new setting.  The only reason WebView hid them at the compositor level is because that was the easiest place to apply the toggle (years ago, Blink was in a separate repo and the scrollbar code was all tangled up with layout and scrollability, so it was too difficult to do it the way you did, but we would've preferred your way if feasible).  I appreciate your following up on my request.

I don't think there are any tests for WebView's hiding behavior (it would require pixel tests which we're reluctant to add), but you can manually check by looking if scrollable divs have no scrollbars in system_webview_shell_apk.

To be clear, the reason WebView wants to hide scrollbars is because scrollbars can be customized by the app, therefore WebView utilizes the Android Java View system scrollbar code and disables the Blink scrollbars to avoid having double-scrollbars.  Any means of hiding the Blink scrollbars is therefore acceptable.  The fact that scrollable divs also lose scrollbars in WebView is a somewhat unfortunate side effect, but it's a behavior WebView has always had, so at this point introducing scrollbars to them would break backwards compatibility (and we also still have no means of using the customized Android scrollbars for them).
Project Member

Comment 10 by bugdroid1@chromium.org, Sep 30 2016

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

commit 8df0b84f79a9f4eb95f6acbd5c7e5fb1a1adc1fd
Author: eseckler <eseckler@chromium.org>
Date: Fri Sep 30 19:07:33 2016

Don't use ScrollbarAlwaysOff for hide_scrollbars.

Currently we use ScrollbarAlwaysOff to hide scrollbars in FrameView, but this also has the side effect that users can't scroll the frame anymore (userScrollable() checks the scrollbar modes). Instead, we now enforce the hide_scrollbars setting in setHasHorizontal/VerticalScrollbar().

BUG= 639806 

Review-Url: https://codereview.chromium.org/2377283003
Cr-Commit-Position: refs/heads/master@{#422169}

[modify] https://crrev.com/8df0b84f79a9f4eb95f6acbd5c7e5fb1a1adc1fd/third_party/WebKit/Source/core/frame/FrameView.cpp

Project Member

Comment 11 by bugdroid1@chromium.org, Sep 30 2016

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

commit 3d4d1a3324c680f6ef88deee59b25418c87be660
Author: eseckler <eseckler@chromium.org>
Date: Fri Sep 30 21:13:40 2016

Use hide_scrollbars setting for Android WebView.

Removes the original logic to disable scrollbars from the compositor and replaces it with configuring the new WebPreference for blink.

BUG= 639806 

Review-Url: https://codereview.chromium.org/2380963002
Cr-Commit-Position: refs/heads/master@{#422219}

[modify] https://crrev.com/3d4d1a3324c680f6ef88deee59b25418c87be660/android_webview/native/aw_settings.cc
[modify] https://crrev.com/3d4d1a3324c680f6ef88deee59b25418c87be660/content/renderer/gpu/render_widget_compositor.cc

Status: Fixed (was: Assigned)
Thanks for following up, I appreciate it.
Project Member

Comment 14 by bugdroid1@chromium.org, Oct 6 2016

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

commit d9b6e52af3a84c562f57a751463cf180d5499928
Author: eseckler <eseckler@chromium.org>
Date: Thu Oct 06 20:55:36 2016

Fix performance regression and bug with hide_scrollbars setting.

FrameView and PaintLayerScrollableArea may perform more work than
necessary if hide_scrollbars is true (e.g. trigger unnecessary
layouts), because they think that scrollbar existence has changed
even if it didn't.

For FrameView, we can avoid this by enforcing hide_scrollbars
in computeScrollbarExistence instead. For PLSA, we check for
hide_scrollbars in updateAfterLayout to determine if the
scrollbar existence will change.

Also fixes another potential bug in PLSA, which may incorrectly
assume existence of scrollbars if hide_scrollbars is true.

BUG=652317, 639806 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2394163002
Cr-Commit-Position: refs/heads/master@{#423671}

[modify] https://crrev.com/d9b6e52af3a84c562f57a751463cf180d5499928/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/d9b6e52af3a84c562f57a751463cf180d5499928/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Project Member

Comment 15 by bugdroid1@chromium.org, Oct 27 2016

Labels: merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d9b6e52af3a84c562f57a751463cf180d5499928

commit d9b6e52af3a84c562f57a751463cf180d5499928
Author: eseckler <eseckler@chromium.org>
Date: Thu Oct 06 20:55:36 2016

Fix performance regression and bug with hide_scrollbars setting.

FrameView and PaintLayerScrollableArea may perform more work than
necessary if hide_scrollbars is true (e.g. trigger unnecessary
layouts), because they think that scrollbar existence has changed
even if it didn't.

For FrameView, we can avoid this by enforcing hide_scrollbars
in computeScrollbarExistence instead. For PLSA, we check for
hide_scrollbars in updateAfterLayout to determine if the
scrollbar existence will change.

Also fixes another potential bug in PLSA, which may incorrectly
assume existence of scrollbars if hide_scrollbars is true.

BUG=652317, 639806 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2394163002
Cr-Commit-Position: refs/heads/master@{#423671}

[modify] https://crrev.com/d9b6e52af3a84c562f57a751463cf180d5499928/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/d9b6e52af3a84c562f57a751463cf180d5499928/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Comment 16 by dimu@google.com, Nov 4 2016

Labels: -merge-merged-2840
[Automated comment] removing mislabelled merge-merged-2840
Project Member

Comment 17 by bugdroid1@chromium.org, Jan 10 2017

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

commit 31baaeb8eb7991bc1a28fc93a6257ee23558cfcb
Author: aelias <aelias@chromium.org>
Date: Tue Jan 10 02:37:21 2017

Revert "Use hide_scrollbars setting for Android WebView."

This reverts commit 3d4d1a3324c680f6ef88deee59b25418c87be660.
This caused an unexpected regression in -webkit custom scrollbar
property support.

TBR=torne@chromium.org
BUG= 677348 ,  639806 

Review-Url: https://codereview.chromium.org/2620743003
Cr-Commit-Position: refs/heads/master@{#442451}

[modify] https://crrev.com/31baaeb8eb7991bc1a28fc93a6257ee23558cfcb/android_webview/native/aw_settings.cc
[modify] https://crrev.com/31baaeb8eb7991bc1a28fc93a6257ee23558cfcb/content/renderer/gpu/render_widget_compositor.cc

Sign in to add a comment