Commit d8af36ad authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Remove use_solid_color_scrollbars pref and settings (blink side)

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: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712010}
parent ce2cb5f9
...@@ -260,7 +260,8 @@ class WebSettings { ...@@ -260,7 +260,8 @@ class WebSettings {
virtual void SetBarrelButtonForDragEnabled(bool) = 0; virtual void SetBarrelButtonForDragEnabled(bool) = 0;
virtual void SetUseLegacyBackgroundSizeShorthandBehavior(bool) = 0; virtual void SetUseLegacyBackgroundSizeShorthandBehavior(bool) = 0;
virtual void SetViewportStyle(WebViewportStyle) = 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 SetUseWideViewport(bool) = 0;
virtual void SetV8CacheOptions(V8CacheOptions) = 0; virtual void SetV8CacheOptions(V8CacheOptions) = 0;
virtual void SetValidationMessageTimerMagnification(int) = 0; virtual void SetValidationMessageTimerMagnification(int) = 0;
......
...@@ -656,10 +656,6 @@ void WebSettingsImpl::SetSmartInsertDeleteEnabled(bool enabled) { ...@@ -656,10 +656,6 @@ void WebSettingsImpl::SetSmartInsertDeleteEnabled(bool enabled) {
settings_->SetSmartInsertDeleteEnabled(enabled); settings_->SetSmartInsertDeleteEnabled(enabled);
} }
void WebSettingsImpl::SetUseSolidColorScrollbars(bool enabled) {
settings_->SetUseSolidColorScrollbars(enabled);
}
void WebSettingsImpl::SetMainFrameResizesAreOrientationChanges(bool enabled) { void WebSettingsImpl::SetMainFrameResizesAreOrientationChanges(bool enabled) {
dev_tools_emulator_->SetMainFrameResizesAreOrientationChanges(enabled); dev_tools_emulator_->SetMainFrameResizesAreOrientationChanges(enabled);
} }
......
...@@ -182,7 +182,6 @@ class CORE_EXPORT WebSettingsImpl final : public WebSettings { ...@@ -182,7 +182,6 @@ class CORE_EXPORT WebSettingsImpl final : public WebSettings {
void SetBarrelButtonForDragEnabled(bool) override; void SetBarrelButtonForDragEnabled(bool) override;
void SetUseLegacyBackgroundSizeShorthandBehavior(bool) override; void SetUseLegacyBackgroundSizeShorthandBehavior(bool) override;
void SetViewportStyle(WebViewportStyle) override; void SetViewportStyle(WebViewportStyle) override;
void SetUseSolidColorScrollbars(bool) override;
void SetUseWideViewport(bool) override; void SetUseWideViewport(bool) override;
void SetV8CacheOptions(V8CacheOptions) override; void SetV8CacheOptions(V8CacheOptions) override;
void SetValidationMessageTimerMagnification(int) override; void SetValidationMessageTimerMagnification(int) override;
......
...@@ -450,14 +450,6 @@ ...@@ -450,14 +450,6 @@
initial: false, 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 // 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. // to the compositor thread. This will be set to true and eventually removed.
// crbug.com/133097 // crbug.com/133097
......
...@@ -69,7 +69,6 @@ DevToolsEmulator::DevToolsEmulator(WebViewImpl* web_view) ...@@ -69,7 +69,6 @@ DevToolsEmulator::DevToolsEmulator(WebViewImpl* web_view)
is_mobile_layout_theme_enabled_(false), is_mobile_layout_theme_enabled_(false),
original_default_minimum_page_scale_factor_(0), original_default_minimum_page_scale_factor_(0),
original_default_maximum_page_scale_factor_(0), original_default_maximum_page_scale_factor_(0),
use_solid_color_scrollbar_(false),
embedder_text_autosizing_enabled_( embedder_text_autosizing_enabled_(
web_view->GetPage()->GetSettings().TextAutosizingEnabled()), web_view->GetPage()->GetSettings().TextAutosizingEnabled()),
embedder_device_scale_adjustment_( embedder_device_scale_adjustment_(
...@@ -302,9 +301,6 @@ void DevToolsEmulator::EnableMobileEmulation() { ...@@ -302,9 +301,6 @@ void DevToolsEmulator::EnableMobileEmulation() {
RuntimeEnabledFeatures::SetMobileLayoutThemeEnabled(true); RuntimeEnabledFeatures::SetMobileLayoutThemeEnabled(true);
ComputedStyle::InvalidateInitialStyle(); ComputedStyle::InvalidateInitialStyle();
web_view_->GetPage()->GetSettings().SetForceAndroidOverlayScrollbar(true); 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( web_view_->GetPage()->GetSettings().SetViewportStyle(
WebViewportStyle::kMobile); WebViewportStyle::kMobile);
web_view_->GetPage()->GetSettings().SetViewportEnabled(true); web_view_->GetPage()->GetSettings().SetViewportEnabled(true);
...@@ -341,8 +337,6 @@ void DevToolsEmulator::DisableMobileEmulation() { ...@@ -341,8 +337,6 @@ void DevToolsEmulator::DisableMobileEmulation() {
RuntimeEnabledFeatures::SetMobileLayoutThemeEnabled( RuntimeEnabledFeatures::SetMobileLayoutThemeEnabled(
is_mobile_layout_theme_enabled_); is_mobile_layout_theme_enabled_);
ComputedStyle::InvalidateInitialStyle(); ComputedStyle::InvalidateInitialStyle();
web_view_->GetPage()->GetSettings().SetUseSolidColorScrollbars(
use_solid_color_scrollbar_);
web_view_->GetPage()->GetSettings().SetForceAndroidOverlayScrollbar(false); web_view_->GetPage()->GetSettings().SetForceAndroidOverlayScrollbar(false);
web_view_->GetPage()->GetSettings().SetViewportEnabled(false); web_view_->GetPage()->GetSettings().SetViewportEnabled(false);
web_view_->GetPage()->GetSettings().SetViewportMetaEnabled(false); web_view_->GetPage()->GetSettings().SetViewportMetaEnabled(false);
......
...@@ -118,7 +118,6 @@ class CORE_EXPORT DevToolsEmulator final ...@@ -118,7 +118,6 @@ class CORE_EXPORT DevToolsEmulator final
bool is_mobile_layout_theme_enabled_; bool is_mobile_layout_theme_enabled_;
float original_default_minimum_page_scale_factor_; float original_default_minimum_page_scale_factor_;
float original_default_maximum_page_scale_factor_; float original_default_maximum_page_scale_factor_;
bool use_solid_color_scrollbar_;
bool embedder_text_autosizing_enabled_; bool embedder_text_autosizing_enabled_;
float embedder_device_scale_adjustment_; float embedder_device_scale_adjustment_;
bool embedder_prefer_compositing_to_lcd_text_enabled_; bool embedder_prefer_compositing_to_lcd_text_enabled_;
......
...@@ -42,7 +42,6 @@ ...@@ -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_ukm_aggregator.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.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/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/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/chrome_client.h"
...@@ -358,10 +357,8 @@ void ScrollingCoordinator::ScrollableAreaScrollbarLayerDidChange( ...@@ -358,10 +357,8 @@ void ScrollingCoordinator::ScrollableAreaScrollbarLayerDidChange(
cc::ScrollbarLayerBase* scrollbar_layer = cc::ScrollbarLayerBase* scrollbar_layer =
GetScrollbarLayer(scrollable_area, orientation); GetScrollbarLayer(scrollable_area, orientation);
if (!scrollbar_layer) { if (!scrollbar_layer) {
Settings* settings = page_->MainFrame()->GetSettings();
scoped_refptr<cc::ScrollbarLayerBase> new_scrollbar_layer; scoped_refptr<cc::ScrollbarLayerBase> new_scrollbar_layer;
if (settings->GetUseSolidColorScrollbars()) { if (scrollbar.IsSolidColor()) {
DCHECK(scrollbar.IsOverlayScrollbar()); DCHECK(scrollbar.IsOverlayScrollbar());
new_scrollbar_layer = CreateSolidColorScrollbarLayer( new_scrollbar_layer = CreateSolidColorScrollbarLayer(
orientation, scrollbar.GetTheme().ThumbThickness(scrollbar), orientation, scrollbar.GetTheme().ThumbThickness(scrollbar),
......
...@@ -678,6 +678,10 @@ int Scrollbar::ScrollbarThickness() const { ...@@ -678,6 +678,10 @@ int Scrollbar::ScrollbarThickness() const {
scrollable_area_->GetLayoutBox()->GetFrame(), theme_scrollbar_thickness_); scrollable_area_->GetLayoutBox()->GetFrame(), theme_scrollbar_thickness_);
} }
bool Scrollbar::IsSolidColor() const {
return theme_.IsSolidColor();
}
bool Scrollbar::IsOverlayScrollbar() const { bool Scrollbar::IsOverlayScrollbar() const {
return theme_.UsesOverlayScrollbars(); return theme_.UsesOverlayScrollbars();
} }
......
...@@ -127,6 +127,7 @@ class CORE_EXPORT Scrollbar : public GarbageCollected<Scrollbar>, ...@@ -127,6 +127,7 @@ class CORE_EXPORT Scrollbar : public GarbageCollected<Scrollbar>,
void Paint(GraphicsContext&, const CullRect&) const; void Paint(GraphicsContext&, const CullRect&) const;
virtual bool IsSolidColor() const;
virtual bool IsOverlayScrollbar() const; virtual bool IsOverlayScrollbar() const;
bool ShouldParticipateInHitTesting(); bool ShouldParticipateInHitTesting();
......
...@@ -72,6 +72,7 @@ class CORE_EXPORT ScrollbarTheme { ...@@ -72,6 +72,7 @@ class CORE_EXPORT ScrollbarTheme {
return kWebScrollbarButtonsPlacementSingle; return kWebScrollbarButtonsPlacementSingle;
} }
virtual bool IsSolidColor() const { return false; }
virtual bool UsesOverlayScrollbars() const { return false; } virtual bool UsesOverlayScrollbars() const { return false; }
virtual void UpdateScrollbarOverlayColorTheme(const Scrollbar&) {} virtual void UpdateScrollbarOverlayColorTheme(const Scrollbar&) {}
......
...@@ -19,6 +19,7 @@ class CORE_EXPORT ScrollbarThemeOverlayMobile : public ScrollbarThemeOverlay { ...@@ -19,6 +19,7 @@ class CORE_EXPORT ScrollbarThemeOverlayMobile : public ScrollbarThemeOverlay {
ScrollbarPart HitTest(const Scrollbar&, const IntPoint&) override { ScrollbarPart HitTest(const Scrollbar&, const IntPoint&) override {
return kNoPart; return kNoPart;
} }
bool IsSolidColor() const override { return true; }
bool UsesNinePatchThumbResource() const override { return false; } bool UsesNinePatchThumbResource() const override { return false; }
protected: protected:
......
...@@ -38,8 +38,12 @@ namespace blink { ...@@ -38,8 +38,12 @@ namespace blink {
class CORE_EXPORT ScrollbarThemeOverlayMock class CORE_EXPORT ScrollbarThemeOverlayMock
: public ScrollbarThemeOverlayMobile { : public ScrollbarThemeOverlayMobile {
public: 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() ScrollbarThemeOverlayMock()
: ScrollbarThemeOverlayMobile(3, 4, Color(128, 128, 128)) {} : ScrollbarThemeOverlayMobile(3, 4, Color(128, 128, 128, 128)) {}
base::TimeDelta OverlayScrollbarFadeOutDelay() const override { base::TimeDelta OverlayScrollbarFadeOutDelay() const override {
return delay_; return delay_;
......
...@@ -35,19 +35,10 @@ if (window.internals) { ...@@ -35,19 +35,10 @@ if (window.internals) {
#scrolled { #scrolled {
width: 100px; width: 100px;
height: 300px; height: 400px;
background: green; background: green;
} }
</style> </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="container">
<div id="clipper"> <div id="clipper">
<div id="scroller"> <div id="scroller">
......
...@@ -35,7 +35,7 @@ if (window.internals) { ...@@ -35,7 +35,7 @@ if (window.internals) {
#scrolled { #scrolled {
width: 100px; width: 100px;
height: 300px; height: 400px;
background: green; background: green;
} }
</style> </style>
......
...@@ -36,7 +36,7 @@ if (window.internals) { ...@@ -36,7 +36,7 @@ if (window.internals) {
#scrolled { #scrolled {
width: 100px; width: 100px;
height: 300px; height: 400px;
background: green; background: green;
} }
</style> </style>
......
...@@ -41,7 +41,7 @@ if (window.internals) { ...@@ -41,7 +41,7 @@ if (window.internals) {
#scrolled { #scrolled {
width: 100px; width: 100px;
height: 300px; height: 400px;
background: green; background: green;
} }
</style> </style>
......
...@@ -16,7 +16,7 @@ html, body { ...@@ -16,7 +16,7 @@ html, body {
font-size : 12pt; font-size : 12pt;
} }
.scrollbar { .scrollbar {
background-color: #808080; background-color: rgba(128, 128, 128, 0.5);
position: absolute; position: absolute;
} }
.vertical { .vertical {
...@@ -48,4 +48,4 @@ should have a scrollbar on the left.</p> ...@@ -48,4 +48,4 @@ should have a scrollbar on the left.</p>
<div class="scrollbar vertical" style="left: 4px; top: 4px;"></div> <div class="scrollbar vertical" style="left: 4px; top: 4px;"></div>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -13,7 +13,7 @@ html, body { ...@@ -13,7 +13,7 @@ html, body {
position: relative; position: relative;
} }
.scrollbar { .scrollbar {
background-color: #808080; background-color: rgba(128, 128, 128, 0.5);
position: absolute; position: absolute;
} }
.horizontal { .horizontal {
......
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