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 {
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;
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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
......
......@@ -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_(
......@@ -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);
......@@ -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);
......
......@@ -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_;
......
......@@ -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"
......@@ -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),
......
......@@ -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();
}
......
......@@ -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();
......
......@@ -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&) {}
......
......@@ -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:
......
......@@ -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_;
......
......@@ -35,19 +35,10 @@ if (window.internals) {
#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">
......
......@@ -35,7 +35,7 @@ if (window.internals) {
#scrolled {
width: 100px;
height: 300px;
height: 400px;
background: green;
}
</style>
......
......@@ -36,7 +36,7 @@ if (window.internals) {
#scrolled {
width: 100px;
height: 300px;
height: 400px;
background: green;
}
</style>
......
......@@ -41,7 +41,7 @@ if (window.internals) {
#scrolled {
width: 100px;
height: 300px;
height: 400px;
background: green;
}
</style>
......
......@@ -16,7 +16,7 @@ html, body {
font-size : 12pt;
}
.scrollbar {
background-color: #808080;
background-color: rgba(128, 128, 128, 0.5);
position: absolute;
}
.vertical {
......@@ -48,4 +48,4 @@ should have a scrollbar on the left.</p>
<div class="scrollbar vertical" style="left: 4px; top: 4px;"></div>
</div>
</body>
</html>
\ No newline at end of file
</html>
......@@ -13,7 +13,7 @@ html, body {
position: relative;
}
.scrollbar {
background-color: #808080;
background-color: rgba(128, 128, 128, 0.5);
position: absolute;
}
.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