Skip to content

Commit

Permalink
Remove use_solid_color_scrollbars pref and settings (blink side)
Browse files Browse the repository at this point in the history
It didn't work by itself. It was just a redundant information of
whether the scrollbar theme supports solid color scrollbars.

Change-Id: Ib5f59fbc30ef8ef83a2e0b9b36729214ca68ce2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894433
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712010}
  • Loading branch information
wangxianzhu authored and Commit Bot committed Nov 2, 2019
1 parent ce2cb5f commit d8af36a
Show file tree
Hide file tree
Showing 26 changed files with 22 additions and 42 deletions.
3 changes: 2 additions & 1 deletion third_party/blink/public/web/web_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ class WebSettings {
virtual void SetBarrelButtonForDragEnabled(bool) = 0;
virtual void SetUseLegacyBackgroundSizeShorthandBehavior(bool) = 0;
virtual void SetViewportStyle(WebViewportStyle) = 0;
virtual void SetUseSolidColorScrollbars(bool) = 0;
// TODO(wangxianzhu): Remove this function when removing chrome side caller.
void SetUseSolidColorScrollbars(bool) {}
virtual void SetUseWideViewport(bool) = 0;
virtual void SetV8CacheOptions(V8CacheOptions) = 0;
virtual void SetValidationMessageTimerMagnification(int) = 0;
Expand Down
4 changes: 0 additions & 4 deletions third_party/blink/renderer/core/exported/web_settings_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,6 @@ void WebSettingsImpl::SetSmartInsertDeleteEnabled(bool enabled) {
settings_->SetSmartInsertDeleteEnabled(enabled);
}

void WebSettingsImpl::SetUseSolidColorScrollbars(bool enabled) {
settings_->SetUseSolidColorScrollbars(enabled);
}

void WebSettingsImpl::SetMainFrameResizesAreOrientationChanges(bool enabled) {
dev_tools_emulator_->SetMainFrameResizesAreOrientationChanges(enabled);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ class CORE_EXPORT WebSettingsImpl final : public WebSettings {
void SetBarrelButtonForDragEnabled(bool) override;
void SetUseLegacyBackgroundSizeShorthandBehavior(bool) override;
void SetViewportStyle(WebViewportStyle) override;
void SetUseSolidColorScrollbars(bool) override;
void SetUseWideViewport(bool) override;
void SetV8CacheOptions(V8CacheOptions) override;
void SetValidationMessageTimerMagnification(int) override;
Expand Down
8 changes: 0 additions & 8 deletions third_party/blink/renderer/core/frame/settings.json5
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,6 @@
initial: false,
},

// If true, scrollers will use overlay scrollbars. These do not take up any
// layout width, are drawn using solid color quads by the compositor, and fade away
// after a timeout.
{
name: "useSolidColorScrollbars",
initial: false,
},

// The rubber-band overscroll effect is implemented in Blink and is being moved
// to the compositor thread. This will be set to true and eventually removed.
// crbug.com/133097
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ DevToolsEmulator::DevToolsEmulator(WebViewImpl* web_view)
is_mobile_layout_theme_enabled_(false),
original_default_minimum_page_scale_factor_(0),
original_default_maximum_page_scale_factor_(0),
use_solid_color_scrollbar_(false),
embedder_text_autosizing_enabled_(
web_view->GetPage()->GetSettings().TextAutosizingEnabled()),
embedder_device_scale_adjustment_(
Expand Down Expand Up @@ -302,9 +301,6 @@ void DevToolsEmulator::EnableMobileEmulation() {
RuntimeEnabledFeatures::SetMobileLayoutThemeEnabled(true);
ComputedStyle::InvalidateInitialStyle();
web_view_->GetPage()->GetSettings().SetForceAndroidOverlayScrollbar(true);
use_solid_color_scrollbar_ =
web_view_->GetPage()->GetSettings().GetUseSolidColorScrollbars();
web_view_->GetPage()->GetSettings().SetUseSolidColorScrollbars(true);
web_view_->GetPage()->GetSettings().SetViewportStyle(
WebViewportStyle::kMobile);
web_view_->GetPage()->GetSettings().SetViewportEnabled(true);
Expand Down Expand Up @@ -341,8 +337,6 @@ void DevToolsEmulator::DisableMobileEmulation() {
RuntimeEnabledFeatures::SetMobileLayoutThemeEnabled(
is_mobile_layout_theme_enabled_);
ComputedStyle::InvalidateInitialStyle();
web_view_->GetPage()->GetSettings().SetUseSolidColorScrollbars(
use_solid_color_scrollbar_);
web_view_->GetPage()->GetSettings().SetForceAndroidOverlayScrollbar(false);
web_view_->GetPage()->GetSettings().SetViewportEnabled(false);
web_view_->GetPage()->GetSettings().SetViewportMetaEnabled(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class CORE_EXPORT DevToolsEmulator final
bool is_mobile_layout_theme_enabled_;
float original_default_minimum_page_scale_factor_;
float original_default_maximum_page_scale_factor_;
bool use_solid_color_scrollbar_;
bool embedder_text_autosizing_enabled_;
float embedder_device_scale_adjustment_;
bool embedder_prefer_compositing_to_lcd_text_enabled_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include "third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/page_scale_constraints_set.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
Expand Down Expand Up @@ -358,10 +357,8 @@ void ScrollingCoordinator::ScrollableAreaScrollbarLayerDidChange(
cc::ScrollbarLayerBase* scrollbar_layer =
GetScrollbarLayer(scrollable_area, orientation);
if (!scrollbar_layer) {
Settings* settings = page_->MainFrame()->GetSettings();

scoped_refptr<cc::ScrollbarLayerBase> new_scrollbar_layer;
if (settings->GetUseSolidColorScrollbars()) {
if (scrollbar.IsSolidColor()) {
DCHECK(scrollbar.IsOverlayScrollbar());
new_scrollbar_layer = CreateSolidColorScrollbarLayer(
orientation, scrollbar.GetTheme().ThumbThickness(scrollbar),
Expand Down
4 changes: 4 additions & 0 deletions third_party/blink/renderer/core/scroll/scrollbar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,10 @@ int Scrollbar::ScrollbarThickness() const {
scrollable_area_->GetLayoutBox()->GetFrame(), theme_scrollbar_thickness_);
}

bool Scrollbar::IsSolidColor() const {
return theme_.IsSolidColor();
}

bool Scrollbar::IsOverlayScrollbar() const {
return theme_.UsesOverlayScrollbars();
}
Expand Down
1 change: 1 addition & 0 deletions third_party/blink/renderer/core/scroll/scrollbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class CORE_EXPORT Scrollbar : public GarbageCollected<Scrollbar>,

void Paint(GraphicsContext&, const CullRect&) const;

virtual bool IsSolidColor() const;
virtual bool IsOverlayScrollbar() const;
bool ShouldParticipateInHitTesting();

Expand Down
1 change: 1 addition & 0 deletions third_party/blink/renderer/core/scroll/scrollbar_theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class CORE_EXPORT ScrollbarTheme {
return kWebScrollbarButtonsPlacementSingle;
}

virtual bool IsSolidColor() const { return false; }
virtual bool UsesOverlayScrollbars() const { return false; }
virtual void UpdateScrollbarOverlayColorTheme(const Scrollbar&) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class CORE_EXPORT ScrollbarThemeOverlayMobile : public ScrollbarThemeOverlay {
ScrollbarPart HitTest(const Scrollbar&, const IntPoint&) override {
return kNoPart;
}
bool IsSolidColor() const override { return true; }
bool UsesNinePatchThumbResource() const override { return false; }

protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ namespace blink {
class CORE_EXPORT ScrollbarThemeOverlayMock
: public ScrollbarThemeOverlayMobile {
public:
// These parameters should be the same as those used by
// cc::SolidColorScrollbarLayerImpl to make sure composited and
// non-composited scrollbars have the same appearance for tests using mock
// overlay scrollbars.
ScrollbarThemeOverlayMock()
: ScrollbarThemeOverlayMobile(3, 4, Color(128, 128, 128)) {}
: ScrollbarThemeOverlayMobile(3, 4, Color(128, 128, 128, 128)) {}

base::TimeDelta OverlayScrollbarFadeOutDelay() const override {
return delay_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,10 @@

#scrolled {
width: 100px;
height: 300px;
height: 400px;
background: green;
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsTextWithPixelResults();

onload = function() {
if (window.internals && window.testRunner)
testRunner.setCustomTextOutput(internals.layerTreeAsText(document));
};
</script>
<div id="container">
<div id="clipper">
<div id="scroller">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#scrolled {
width: 100px;
height: 300px;
height: 400px;
background: green;
}
</style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#scrolled {
width: 100px;
height: 300px;
height: 400px;
background: green;
}
</style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#scrolled {
width: 100px;
height: 300px;
height: 400px;
background: green;
}
</style>
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
font-size : 12pt;
}
.scrollbar {
background-color: #808080;
background-color: rgba(128, 128, 128, 0.5);
position: absolute;
}
.vertical {
Expand Down Expand Up @@ -48,4 +48,4 @@
<div class="scrollbar vertical" style="left: 4px; top: 4px;"></div>
</div>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
position: relative;
}
.scrollbar {
background-color: #808080;
background-color: rgba(128, 128, 128, 0.5);
position: absolute;
}
.horizontal {
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d8af36a

Please sign in to comment.