Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Issue 640063002: Hide scrollbars when their dimensions are not scrollable. (Closed)

Created:
6 years, 2 months ago by Tima Vaisburd
Modified:
5 years, 2 months ago
CC:
blink-reviews, mkwst+moarreviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Hide scrollbars when their dimensions are not scrollable. Make scrollbars disappear by setting their opacity to 0 (i.e. making them completely transparent) when they cannot be scrolled. BUG=370892

Patch Set 1 #

Total comments: 3

Patch Set 2 : Hide scrollbar by setting opacity to 0 #

Total comments: 1

Patch Set 3 : Added and used scrollable() method to scrollbar layer #

Patch Set 4 : Renamed scrollable() to can_scroll_orientation() to avoid polimorphic behavior #

Patch Set 5 : Added unit tests #

Total comments: 1

Patch Set 6 : Removed unused |time| variable, added comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -6 lines) Patch
M cc/animation/scrollbar_animation_controller_linear_fade.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc View 1 2 3 4 5 6 chunks +137 lines, -2 lines 0 comments Download
M cc/animation/scrollbar_animation_controller_thinning.cc View 1 2 3 1 chunk +6 lines, -2 lines 0 comments Download
M cc/animation/scrollbar_animation_controller_thinning_unittest.cc View 1 2 3 4 5 3 chunks +35 lines, -1 line 0 comments Download
M cc/layers/layer_impl.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M cc/layers/scrollbar_layer_impl_base.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cc/layers/scrollbar_layer_impl_base.cc View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (4 generated)
timav
This simple change seems to work. Please take a look, if it's ok I will ...
6 years, 2 months ago (2014-10-08 22:25:25 UTC) #2
bokan
https://codereview.chromium.org/640063002/diff/1/Source/core/frame/PinchViewport.cpp File Source/core/frame/PinchViewport.cpp (right): https://codereview.chromium.org/640063002/diff/1/Source/core/frame/PinchViewport.cpp#newcode164 Source/core/frame/PinchViewport.cpp:164: adjustScrollbarExistence(); Should we also call this in setSize? https://codereview.chromium.org/640063002/diff/1/Source/core/frame/PinchViewport.cpp#newcode331 ...
6 years, 2 months ago (2014-10-09 15:22:15 UTC) #3
aelias_OOO_until_Jul13
I don't think it's correct to remove these scrollbars on the Blink side. They need ...
6 years, 2 months ago (2014-10-09 18:20:19 UTC) #4
blink-reviews
While trying to disable scrollbar by not calling scrollbar_animation_controller_->DidScrollUpdate(on_resize): As far as I understand, DidScrollUpdate(), ...
6 years, 2 months ago (2014-10-10 02:41:06 UTC) #5
aelias_OOO_until_Jul13
Right, I forgot that the scrollbar_animation_controller was attached to the scroll layer, not the scrollbar ...
6 years, 2 months ago (2014-10-10 02:51:01 UTC) #6
timav
On 2014/10/10 02:51:01, aelias wrote: > Right, I forgot that the scrollbar_animation_controller was attached to ...
6 years, 2 months ago (2014-10-10 18:53:50 UTC) #7
aelias_OOO_until_Jul13
On 2014/10/10 at 18:53:50, timav wrote: > The properties user_scrollable_horizontal_ and user_scrollable_vertical are the properties ...
6 years, 2 months ago (2014-10-10 19:00:35 UTC) #8
timav
Alex and David, Please check whether this patch is what you meant. If it is, ...
6 years, 2 months ago (2014-10-11 00:16:49 UTC) #9
aelias_OOO_until_Jul13
The approach looks fine. https://codereview.chromium.org/640063002/diff/70001/cc/animation/scrollbar_animation_controller_linear_fade.cc File cc/animation/scrollbar_animation_controller_linear_fade.cc (right): https://codereview.chromium.org/640063002/diff/70001/cc/animation/scrollbar_animation_controller_linear_fade.cc#newcode66 cc/animation/scrollbar_animation_controller_linear_fade.cc:66: bool visible = scroll_layer_->user_scrollable(scrollbar->orientation()) && ...
6 years, 2 months ago (2014-10-13 18:30:03 UTC) #10
timav
On 2014/10/13 18:30:03, aelias wrote: > The approach looks fine. > > https://codereview.chromium.org/640063002/diff/70001/cc/animation/scrollbar_animation_controller_linear_fade.cc > File ...
6 years, 2 months ago (2014-10-14 00:52:15 UTC) #11
aelias_OOO_until_Jul13
Hmm, sorry, I wasn't thinking that there was already a base class method with that ...
6 years, 2 months ago (2014-10-14 01:01:14 UTC) #12
timav
On 2014/10/14 01:01:14, aelias wrote: > Hmm, sorry, I wasn't thinking that there was already ...
6 years, 2 months ago (2014-10-14 01:51:24 UTC) #13
aelias_OOO_until_Jul13
OK, looks fine. Just needs a test.
6 years, 2 months ago (2014-10-14 01:53:29 UTC) #14
timav
On 2014/10/14 01:53:29, aelias wrote: > OK, looks fine. Just needs a test. Added unit ...
6 years, 2 months ago (2014-10-14 23:18:27 UTC) #15
aelias_OOO_until_Jul13
https://codereview.chromium.org/640063002/diff/200001/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc File cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc (right): https://codereview.chromium.org/640063002/diff/200001/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc#newcode142 cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc:142: base::TimeTicks time; You're not doing anything with this time ...
6 years, 2 months ago (2014-10-14 23:23:41 UTC) #16
timav
On 2014/10/14 23:23:41, aelias wrote: > https://codereview.chromium.org/640063002/diff/200001/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc > File cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc > (right): > > https://codereview.chromium.org/640063002/diff/200001/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc#newcode142 ...
6 years, 2 months ago (2014-10-14 23:39:21 UTC) #17
aelias_OOO_until_Jul13
lgtm, except please edit the patch description to match the way this patch does it.
6 years, 2 months ago (2014-10-14 23:41:24 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/640063002/220001
6 years, 2 months ago (2014-10-14 23:54:12 UTC) #20
commit-bot: I haz the power
6 years, 2 months ago (2014-10-14 23:54:21 UTC) #22
Failed to apply patch for
cc/animation/scrollbar_animation_controller_linear_fade.cc:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  A         cc
  Created missing directory cc.
  A         cc/animation
  Created missing directory cc/animation.
  can't find file to patch at input line 6
  Perhaps you used the wrong -p or --strip option?
  The text leading up to this was:
  --------------------------
  |Index: cc/animation/scrollbar_animation_controller_linear_fade.cc
  |diff --git a/cc/animation/scrollbar_animation_controller_linear_fade.cc
b/cc/animation/scrollbar_animation_controller_linear_fade.cc
  |index
90437b3835b322c09649fe35d024d603d05bcc0b..f65fd727ac4fe50f9c8666ac3489a8426eb59b6a
100644
  |--- a/cc/animation/scrollbar_animation_controller_linear_fade.cc
  |+++ b/cc/animation/scrollbar_animation_controller_linear_fade.cc
  --------------------------
  No file to patch.  Skipping patch.
  1 out of 1 hunk ignored

Patch:       cc/animation/scrollbar_animation_controller_linear_fade.cc
Index: cc/animation/scrollbar_animation_controller_linear_fade.cc
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade.cc
b/cc/animation/scrollbar_animation_controller_linear_fade.cc
index
90437b3835b322c09649fe35d024d603d05bcc0b..f65fd727ac4fe50f9c8666ac3489a8426eb59b6a
100644
--- a/cc/animation/scrollbar_animation_controller_linear_fade.cc
+++ b/cc/animation/scrollbar_animation_controller_linear_fade.cc
@@ -62,8 +62,9 @@ void
ScrollbarAnimationControllerLinearFade::ApplyOpacityToScrollbars(
        it != scrollbars->end();
        ++it) {
     ScrollbarLayerImplBase* scrollbar = *it;
+
     if (scrollbar->is_overlay_scrollbar())
-      scrollbar->SetOpacity(opacity);
+      scrollbar->SetOpacity(scrollbar->can_scroll_orientation() ? opacity : 0);
   }
 }

Powered by Google App Engine
This is Rietveld 408576698