Commit af9106b5 authored by Matt Giuca's avatar Matt Giuca Committed by Commit Bot

Revert "Implemented fluent style for select multiple"

This reverts commit 6881d10f.

Reason for revert: Introduces a use of uninitialized value.

NativeThemeBase::PaintInnerSpinButton passes |arrow| to PaintArrowButton without
initializing its |right_to_left| member.

See https://crbug.com/990672

Original change's description:
> Implemented fluent style for select multiple
> 
> -Styled the in-page select, options, and optgroups via css.
> -Modified the scrollbar to have rounded corners
> (had to plumb the zoom factor through the Scrollbar so that the native
> theme aura code can get the rounding correct at paint time)
> 
> Bug: 987292
> Change-Id: Id11d1a47fe3d5b2be01aa578aa066f80577a9bbd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715553
> Commit-Queue: Allison Pastewka <alpastew@microsoft.com>
> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> Reviewed-by: Kent Tamura <tkent@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Mason Freed <masonfreed@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#683728}

TBR=ellyjones@chromium.org,chrishtr@chromium.org,haraken@chromium.org,tkent@chromium.org,masonfreed@chromium.org,alpastew@microsoft.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 987292, 990672
Change-Id: I778b09437c79061b23de1d5e8335c8f0cf124e12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1735548Reviewed-by: default avatarMatt Giuca <mgiuca@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Matt Giuca <mgiuca@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683912}
parent 91933845
...@@ -418,13 +418,11 @@ SkColor NativeThemeGtk::GetSystemColor(ColorId color_id, ...@@ -418,13 +418,11 @@ SkColor NativeThemeGtk::GetSystemColor(ColorId color_id,
return color; return color;
} }
void NativeThemeGtk::PaintArrowButton( void NativeThemeGtk::PaintArrowButton(cc::PaintCanvas* canvas,
cc::PaintCanvas* canvas, const gfx::Rect& rect,
const gfx::Rect& rect, Part direction,
Part direction, State state,
State state, ColorScheme color_scheme) const {
ColorScheme color_scheme,
const ScrollbarArrowExtraParams& arrow) const {
auto context = GetStyleContextFromCss( auto context = GetStyleContextFromCss(
GtkVersionCheck(3, 20) GtkVersionCheck(3, 20)
? "GtkScrollbar#scrollbar #contents GtkButton#button" ? "GtkScrollbar#scrollbar #contents GtkButton#button"
......
...@@ -33,8 +33,7 @@ class NativeThemeGtk : public ui::NativeThemeBase { ...@@ -33,8 +33,7 @@ class NativeThemeGtk : public ui::NativeThemeBase {
const gfx::Rect& rect, const gfx::Rect& rect,
Part direction, Part direction,
State state, State state,
ColorScheme color_scheme, ColorScheme color_scheme) const override;
const ScrollbarArrowExtraParams& arrow) const override;
void PaintScrollbarTrack(cc::PaintCanvas* canvas, void PaintScrollbarTrack(cc::PaintCanvas* canvas,
Part part, Part part,
State state, State state,
......
...@@ -216,15 +216,6 @@ static void GetNativeThemeExtraParams( ...@@ -216,15 +216,6 @@ static void GetNativeThemeExtraParams(
NativeThemeScrollbarOverlayColorTheme( NativeThemeScrollbarOverlayColorTheme(
extra_params->scrollbar_thumb.scrollbar_theme); extra_params->scrollbar_thumb.scrollbar_theme);
break; break;
case WebThemeEngine::kPartScrollbarDownArrow:
case WebThemeEngine::kPartScrollbarLeftArrow:
case WebThemeEngine::kPartScrollbarRightArrow:
case WebThemeEngine::kPartScrollbarUpArrow:
native_theme_extra_params->scrollbar_arrow.zoom =
extra_params->scrollbar_button.zoom;
native_theme_extra_params->scrollbar_arrow.right_to_left =
extra_params->scrollbar_button.right_to_left;
break;
default: default:
break; // Parts that have no extra params get here. break; // Parts that have no extra params get here.
} }
......
...@@ -148,11 +148,6 @@ class WebThemeEngine { ...@@ -148,11 +148,6 @@ class WebThemeEngine {
WebScrollbarOverlayColorTheme scrollbar_theme; WebScrollbarOverlayColorTheme scrollbar_theme;
}; };
struct ScrollbarButtonExtraParams {
float zoom;
bool right_to_left;
};
union ExtraParams { union ExtraParams {
ScrollbarTrackExtraParams scrollbar_track; ScrollbarTrackExtraParams scrollbar_track;
ButtonExtraParams button; ButtonExtraParams button;
...@@ -162,7 +157,6 @@ class WebThemeEngine { ...@@ -162,7 +157,6 @@ class WebThemeEngine {
InnerSpinButtonExtraParams inner_spin; InnerSpinButtonExtraParams inner_spin;
ProgressBarExtraParams progress_bar; ProgressBarExtraParams progress_bar;
ScrollbarThumbExtraParams scrollbar_thumb; ScrollbarThumbExtraParams scrollbar_thumb;
ScrollbarButtonExtraParams scrollbar_button;
}; };
virtual ~WebThemeEngine() {} virtual ~WebThemeEngine() {}
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
input, input,
select, select,
select:-internal-list-box,
textarea { textarea {
background-color: #ffffff; background-color: #ffffff;
border-color: #cecece; border-color: #cecece;
...@@ -18,7 +17,6 @@ textarea { ...@@ -18,7 +17,6 @@ textarea {
input:hover, input:hover,
select:hover, select:hover,
select:-internal-list-box:hover,
textarea:hover { textarea:hover {
border-color: #9d9d9d; border-color: #9d9d9d;
} }
...@@ -105,55 +103,3 @@ meter::-webkit-meter-even-less-good-value { ...@@ -105,55 +103,3 @@ meter::-webkit-meter-even-less-good-value {
background: #d83b01; background: #d83b01;
border-radius: 1px 0px 0px 1px; border-radius: 1px 0px 0px 1px;
} }
/* -internal-list-box is how we specify select[multiple] */
/* select[multiple] is an exception to the prohibition on sizes here
because it is one of the few controls with borders that grow on zoom
(to solve a nasty scrollbar location problem) */
select:-internal-list-box {
border-radius: 2px;
}
/* These options only apply to in-page 'multiple' select elements.
The options in the popup are handled in listPicker.css */
select:-internal-list-box option, select:-internal-list-box optgroup {
padding: 0 3px;
}
select:-internal-list-box option {
border-radius: 2px;
}
select:-internal-list-box option:hover {
background-color: #f3f3f3;
}
/* option selected */
select:-internal-list-box:focus option:checked,
select:-internal-list-box:focus option:checked:hover,
select:-internal-list-box option:checked,
select:-internal-list-box option:checked:hover {
background-color: #cecece !important;
color: #101010 !important;
}
/* option disabled */
select:-internal-list-box option:disabled,
select:-internal-list-box option:disabled:hover,
select:-internal-list-box:disabled option,
select:-internal-list-box:disabled option:hover {
background-color: #ffffff !important;
}
/* option both disabled and selected */
option:checked:disabled,
option:checked:disabled:hover,
select:-internal-list-box:focus option:checked:disabled,
select:-internal-list-box:focus option:checked:disabled:hover,
select:-internal-list-box:disabled option:checked,
select:-internal-list-box:disabled option:checked:hover,
select:-internal-list-box option:checked:disabled,
select:-internal-list-box option:checked:disabled:hover {
background-color: #f0f0f0 !important;
color: #c5c5c5 !important;
}
\ No newline at end of file
...@@ -50,9 +50,9 @@ LayoutScrollbar::LayoutScrollbar(ScrollableArea* scrollable_area, ...@@ -50,9 +50,9 @@ LayoutScrollbar::LayoutScrollbar(ScrollableArea* scrollable_area,
: Scrollbar(scrollable_area, : Scrollbar(scrollable_area,
orientation, orientation,
kRegularScrollbar, kRegularScrollbar,
style_source,
nullptr, nullptr,
LayoutScrollbarTheme::GetLayoutScrollbarTheme()) { LayoutScrollbarTheme::GetLayoutScrollbarTheme()),
style_source_(style_source) {
DCHECK(style_source); DCHECK(style_source);
// FIXME: We need to do this because LayoutScrollbar::styleChanged is called // FIXME: We need to do this because LayoutScrollbar::styleChanged is called
...@@ -104,6 +104,7 @@ int LayoutScrollbar::HypotheticalScrollbarThickness( ...@@ -104,6 +104,7 @@ int LayoutScrollbar::HypotheticalScrollbarThickness(
} }
void LayoutScrollbar::Trace(blink::Visitor* visitor) { void LayoutScrollbar::Trace(blink::Visitor* visitor) {
visitor->Trace(style_source_);
Scrollbar::Trace(visitor); Scrollbar::Trace(visitor);
} }
...@@ -152,11 +153,11 @@ void LayoutScrollbar::SetPressedPart(ScrollbarPart part, ...@@ -152,11 +153,11 @@ void LayoutScrollbar::SetPressedPart(ScrollbarPart part,
scoped_refptr<ComputedStyle> LayoutScrollbar::GetScrollbarPseudoStyle( scoped_refptr<ComputedStyle> LayoutScrollbar::GetScrollbarPseudoStyle(
ScrollbarPart part_type, ScrollbarPart part_type,
PseudoId pseudo_id) { PseudoId pseudo_id) {
if (!StyleSource()->GetLayoutObject()) if (!style_source_->GetLayoutObject())
return nullptr; return nullptr;
return StyleSource()->StyleForPseudoElement( return style_source_->StyleForPseudoElement(
PseudoStyleRequest(pseudo_id, this, part_type), PseudoStyleRequest(pseudo_id, this, part_type),
StyleSource()->GetLayoutObject()->Style()); style_source_->GetLayoutObject()->Style());
} }
void LayoutScrollbar::UpdateScrollbarParts(bool destroy) { void LayoutScrollbar::UpdateScrollbarParts(bool destroy) {
...@@ -279,7 +280,7 @@ void LayoutScrollbar::UpdateScrollbarPart(ScrollbarPart part_type, ...@@ -279,7 +280,7 @@ void LayoutScrollbar::UpdateScrollbarPart(ScrollbarPart part_type,
LayoutScrollbarPart* part_layout_object = parts_.at(part_type); LayoutScrollbarPart* part_layout_object = parts_.at(part_type);
if (!part_layout_object && need_layout_object && scrollable_area_) { if (!part_layout_object && need_layout_object && scrollable_area_) {
part_layout_object = LayoutScrollbarPart::CreateAnonymous( part_layout_object = LayoutScrollbarPart::CreateAnonymous(
&StyleSource()->GetDocument(), scrollable_area_, this, part_type); &style_source_->GetDocument(), scrollable_area_, this, part_type);
parts_.Set(part_type, part_layout_object); parts_.Set(part_type, part_layout_object);
SetNeedsPaintInvalidation(part_type); SetNeedsPaintInvalidation(part_type);
} else if (part_layout_object && !need_layout_object) { } else if (part_layout_object && !need_layout_object) {
......
...@@ -55,6 +55,11 @@ class LayoutScrollbar final : public Scrollbar { ...@@ -55,6 +55,11 @@ class LayoutScrollbar final : public Scrollbar {
const LayoutBox& enclosing_box, const LayoutBox& enclosing_box,
const LayoutObject& style_source); const LayoutObject& style_source);
// The Element that supplies our style information. If the scrollbar is
// for a document, this is either the <body> or <html> element. Otherwise, it
// is the element that owns our PaintLayerScrollableArea.
Element* StyleSource() const { return style_source_.Get(); }
IntRect ButtonRect(ScrollbarPart) const; IntRect ButtonRect(ScrollbarPart) const;
IntRect TrackRect(int start_length, int end_length) const; IntRect TrackRect(int start_length, int end_length) const;
IntRect TrackPieceRectWithMargins(ScrollbarPart, const IntRect&) const; IntRect TrackPieceRectWithMargins(ScrollbarPart, const IntRect&) const;
...@@ -94,6 +99,9 @@ class LayoutScrollbar final : public Scrollbar { ...@@ -94,6 +99,9 @@ class LayoutScrollbar final : public Scrollbar {
scoped_refptr<ComputedStyle> GetScrollbarPseudoStyle(ScrollbarPart, PseudoId); scoped_refptr<ComputedStyle> GetScrollbarPseudoStyle(ScrollbarPart, PseudoId);
void UpdateScrollbarPart(ScrollbarPart, bool destroy = false); void UpdateScrollbarPart(ScrollbarPart, bool destroy = false);
// The element that supplies our style information.
Member<Element> style_source_;
HashMap<unsigned, LayoutScrollbarPart*> parts_; HashMap<unsigned, LayoutScrollbarPart*> parts_;
}; };
......
...@@ -2444,17 +2444,13 @@ Scrollbar* PaintLayerScrollableArea::ScrollbarManager::CreateScrollbar( ...@@ -2444,17 +2444,13 @@ Scrollbar* PaintLayerScrollableArea::ScrollbarManager::CreateScrollbar(
scrollbar_size = LayoutTheme::GetTheme().ScrollbarControlSizeForPart( scrollbar_size = LayoutTheme::GetTheme().ScrollbarControlSizeForPart(
style_source.StyleRef().EffectiveAppearance()); style_source.StyleRef().EffectiveAppearance());
} }
Element* style_source_element = nullptr; scrollbar = MakeGarbageCollected<Scrollbar>(ScrollableArea(), orientation,
if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) { scrollbar_size,
style_source_element = DynamicTo<Element>(style_source.GetNode()); &ScrollableArea()
} ->GetLayoutBox()
scrollbar = MakeGarbageCollected<Scrollbar>( ->GetFrame()
ScrollableArea(), orientation, scrollbar_size, style_source_element, ->GetPage()
&ScrollableArea() ->GetChromeClient());
->GetLayoutBox()
->GetFrame()
->GetPage()
->GetChromeClient());
} }
ScrollableArea()->GetLayoutBox()->GetDocument().View()->AddScrollbar( ScrollableArea()->GetLayoutBox()->GetDocument().View()->AddScrollbar(
scrollbar); scrollbar);
......
...@@ -106,9 +106,8 @@ TEST_F(ScrollableAreaTest, ScrollbarGraphicsLayerInvalidation) { ...@@ -106,9 +106,8 @@ TEST_F(ScrollableAreaTest, ScrollbarGraphicsLayerInvalidation) {
EXPECT_CALL(*scrollable_area, LayerForHorizontalScrollbar()) EXPECT_CALL(*scrollable_area, LayerForHorizontalScrollbar())
.WillRepeatedly(Return(&graphics_layer)); .WillRepeatedly(Return(&graphics_layer));
auto* scrollbar = auto* scrollbar = MakeGarbageCollected<Scrollbar>(
MakeGarbageCollected<Scrollbar>(scrollable_area, kHorizontalScrollbar, scrollable_area, kHorizontalScrollbar, kRegularScrollbar, nullptr);
kRegularScrollbar, nullptr, nullptr);
graphics_layer.ResetTrackedRasterInvalidations(); graphics_layer.ResetTrackedRasterInvalidations();
scrollbar->SetNeedsPaintInvalidation(kNoPart); scrollbar->SetNeedsPaintInvalidation(kNoPart);
EXPECT_TRUE(graphics_layer.HasTrackedRasterInvalidations()); EXPECT_TRUE(graphics_layer.HasTrackedRasterInvalidations());
......
...@@ -31,22 +31,18 @@ ...@@ -31,22 +31,18 @@
#include "third_party/blink/public/platform/web_gesture_event.h" #include "third_party/blink/public/platform/web_gesture_event.h"
#include "third_party/blink/public/platform/web_mouse_event.h" #include "third_party/blink/public/platform/web_mouse_event.h"
#include "third_party/blink/public/platform/web_scrollbar_overlay_color_theme.h" #include "third_party/blink/public/platform/web_scrollbar_overlay_color_theme.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/scroll/scroll_animator_base.h" #include "third_party/blink/renderer/core/scroll/scroll_animator_base.h"
#include "third_party/blink/renderer/core/scroll/scrollable_area.h" #include "third_party/blink/renderer/core/scroll/scrollable_area.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme.h" #include "third_party/blink/renderer/core/scroll/scrollbar_theme.h"
#include "third_party/blink/renderer/platform/geometry/float_rect.h" #include "third_party/blink/renderer/platform/geometry/float_rect.h"
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h" #include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
#include "third_party/blink/renderer/platform/text/text_direction.h"
namespace blink { namespace blink {
Scrollbar::Scrollbar(ScrollableArea* scrollable_area, Scrollbar::Scrollbar(ScrollableArea* scrollable_area,
ScrollbarOrientation orientation, ScrollbarOrientation orientation,
ScrollbarControlSize control_size, ScrollbarControlSize control_size,
Element* style_source,
ChromeClient* chrome_client, ChromeClient* chrome_client,
ScrollbarTheme* theme) ScrollbarTheme* theme)
: scrollable_area_(scrollable_area), : scrollable_area_(scrollable_area),
...@@ -71,8 +67,7 @@ Scrollbar::Scrollbar(ScrollableArea* scrollable_area, ...@@ -71,8 +67,7 @@ Scrollbar::Scrollbar(ScrollableArea* scrollable_area,
elastic_overscroll_(0), elastic_overscroll_(0),
track_needs_repaint_(true), track_needs_repaint_(true),
thumb_needs_repaint_(true), thumb_needs_repaint_(true),
injected_gesture_scroll_begin_(false), injected_gesture_scroll_begin_(false) {
style_source_(style_source) {
theme_.RegisterScrollbar(*this); theme_.RegisterScrollbar(*this);
// FIXME: This is ugly and would not be necessary if we fix cross-platform // FIXME: This is ugly and would not be necessary if we fix cross-platform
...@@ -93,7 +88,6 @@ Scrollbar::~Scrollbar() =default; ...@@ -93,7 +88,6 @@ Scrollbar::~Scrollbar() =default;
void Scrollbar::Trace(blink::Visitor* visitor) { void Scrollbar::Trace(blink::Visitor* visitor) {
visitor->Trace(scrollable_area_); visitor->Trace(scrollable_area_);
visitor->Trace(chrome_client_); visitor->Trace(chrome_client_);
visitor->Trace(style_source_);
} }
void Scrollbar::SetFrameRect(const IntRect& frame_rect) { void Scrollbar::SetFrameRect(const IntRect& frame_rect) {
...@@ -790,23 +784,6 @@ CompositorElementId Scrollbar::GetElementId() { ...@@ -790,23 +784,6 @@ CompositorElementId Scrollbar::GetElementId() {
return scrollable_area_->GetScrollbarElementId(orientation_); return scrollable_area_->GetScrollbarElementId(orientation_);
} }
float Scrollbar::EffectiveZoom() const {
if (RuntimeEnabledFeatures::FormControlsRefreshEnabled() && style_source_ &&
style_source_->GetLayoutObject()) {
return style_source_->GetLayoutObject()->Style()->EffectiveZoom();
}
return 1.0;
}
bool Scrollbar::ContainerIsRightToLeft() const {
if (RuntimeEnabledFeatures::FormControlsRefreshEnabled() && style_source_ &&
style_source_->GetLayoutObject()) {
TextDirection dir = style_source_->GetLayoutObject()->Style()->Direction();
return IsRtl(dir);
}
return false;
}
STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeDark, STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeDark,
kScrollbarOverlayColorThemeDark); kScrollbarOverlayColorThemeDark);
STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeLight, STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeLight,
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
namespace blink { namespace blink {
class CullRect; class CullRect;
class Element;
class GraphicsContext; class GraphicsContext;
class IntRect; class IntRect;
class ChromeClient; class ChromeClient;
...@@ -56,13 +55,12 @@ class CORE_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>, ...@@ -56,13 +55,12 @@ class CORE_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>,
ScrollbarControlSize size, ScrollbarControlSize size,
ScrollbarTheme* theme) { ScrollbarTheme* theme) {
return MakeGarbageCollected<Scrollbar>(scrollable_area, orientation, size, return MakeGarbageCollected<Scrollbar>(scrollable_area, orientation, size,
nullptr, nullptr, theme); nullptr, theme);
} }
Scrollbar(ScrollableArea*, Scrollbar(ScrollableArea*,
ScrollbarOrientation, ScrollbarOrientation,
ScrollbarControlSize, ScrollbarControlSize,
Element* style_source,
ChromeClient* = nullptr, ChromeClient* = nullptr,
ScrollbarTheme* = nullptr); ScrollbarTheme* = nullptr);
~Scrollbar() override; ~Scrollbar() override;
...@@ -191,14 +189,6 @@ class CORE_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>, ...@@ -191,14 +189,6 @@ class CORE_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>,
CompositorElementId GetElementId(); CompositorElementId GetElementId();
float EffectiveZoom() const;
bool ContainerIsRightToLeft() const;
// The Element that supplies our style information. If the scrollbar is
// for a document, this is either the <body> or <html> element. Otherwise, it
// is the element that owns our PaintLayerScrollableArea.
Element* StyleSource() const { return style_source_.Get(); }
virtual void Trace(blink::Visitor*); virtual void Trace(blink::Visitor*);
protected: protected:
...@@ -252,7 +242,6 @@ class CORE_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>, ...@@ -252,7 +242,6 @@ class CORE_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>,
bool injected_gesture_scroll_begin_; bool injected_gesture_scroll_begin_;
IntRect visual_rect_; IntRect visual_rect_;
IntRect frame_rect_; IntRect frame_rect_;
Member<Element> style_source_;
}; };
} // namespace blink } // namespace blink
......
...@@ -281,13 +281,8 @@ void ScrollbarThemeAura::PaintButton(GraphicsContext& gc, ...@@ -281,13 +281,8 @@ void ScrollbarThemeAura::PaintButton(GraphicsContext& gc,
if (!params.should_paint) if (!params.should_paint)
return; return;
DrawingRecorder recorder(gc, scrollbar, display_item_type); DrawingRecorder recorder(gc, scrollbar, display_item_type);
WebThemeEngine::ExtraParams extra_params;
extra_params.scrollbar_button.zoom = scrollbar.EffectiveZoom();
extra_params.scrollbar_button.right_to_left =
scrollbar.ContainerIsRightToLeft();
Platform::Current()->ThemeEngine()->Paint( Platform::Current()->ThemeEngine()->Paint(
gc.Canvas(), params.part, params.state, WebRect(rect), &extra_params, gc.Canvas(), params.part, params.state, WebRect(rect), nullptr,
WebColorScheme:: WebColorScheme::
kLight /* TODO(futhark): pass color scheme to scrollbar parts */); kLight /* TODO(futhark): pass color scheme to scrollbar parts */);
} }
......
...@@ -550,6 +550,3 @@ crbug.com/985388 virtual/threaded/fast/scrolling/fractional-scroll-offset-iframe ...@@ -550,6 +550,3 @@ crbug.com/985388 virtual/threaded/fast/scrolling/fractional-scroll-offset-iframe
# Added to land BGPT-fixes # Added to land BGPT-fixes
crbug.com/979002 virtual/threaded/fast/scrolling/uncomposite-and-composite-scroll.html [ Failure ] crbug.com/979002 virtual/threaded/fast/scrolling/uncomposite-and-composite-scroll.html [ Failure ]
crbug.com/981749 virtual/threaded/fast/scrolling/scroll-chaining-from-position-fixed.html [ Failure ] crbug.com/981749 virtual/threaded/fast/scrolling/scroll-chaining-from-position-fixed.html [ Failure ]
# These tests are failing due to subpixel differences but can't be rebaselined.
Bug(none) virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic.html [ Failure ]
<!DOCTYPE html>
<script src="../../../resources/run-after-layout-and-paint.js"></script>
<body>
<!-- no style for reference -->
<select multiple>
<optgroup label="unstyled">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select> <br>
<!-- disabled select -->
<select multiple disabled>
<optgroup label="disabled select">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select>
<!-- disabled option -->
<select multiple>
<optgroup label="disabled option">
<option selected>first selected option</option>
<option disabled>disabled unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select>
<!-- disabled selected option -->
<select multiple>
<optgroup label="disabled selected option">
<option disabled selected>disabled first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select> <br>
<!-- border -->
<select multiple style="border: 3px solid lime;">
<optgroup label="thick lime border">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select>
<select multiple style="border-radius: 6px;">
<optgroup label="border-radius: 6px">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select>
<!-- rtl -->
<select dir="rtl" multiple>
<optgroup label="right-to-left">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select> <br>
<!-- background -->
<select multiple style="background: linear-gradient(to bottom, #dea 0%,#9c7 44%,#494 100%);">
<optgroup label="gradient background">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select>
<!-- shadow -->
<select multiple style="box-shadow: 4px 4px 10px rgba(255,0,0,0.5), inset 4px 4px 4px rgba(0,255,0,0.5);">
<optgroup label="box-shadow">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select>
<!-- size -->
<select multiple style="width: 8px; height: 8px;">
<optgroup label="size: 8px">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select>
<select multiple style="width: 16px; height: 16px;">
<optgroup label="size: 16px">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup></select>
<select multiple style="width: 24px; height: 24px;">
<optgroup label="size: 24px">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select>
<select multiple style="width: 26px; height: 20px;">
<optgroup label="width: 26px; height: 20px">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select>
<select multiple style="width: 60px; height: 60px;">
<optgroup label="size: 60px">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select> <br>
<!-- zoom -->
<select multiple style="zoom: 1.5;">
<optgroup label="zoom: 1.5">
<option selected>first selected option</option>
<option>unselected option</option>
<option selected>second selected option</option>
</optgroup>
</select><br>
<script>
if (window.testRunner)
testRunner.setUseMockTheme(false);
</script>
</body>
\ No newline at end of file
...@@ -197,8 +197,6 @@ class NATIVE_THEME_EXPORT NativeTheme { ...@@ -197,8 +197,6 @@ class NATIVE_THEME_EXPORT NativeTheme {
struct ScrollbarArrowExtraParams { struct ScrollbarArrowExtraParams {
bool is_hovering; bool is_hovering;
float zoom;
bool right_to_left;
}; };
struct ScrollbarTrackExtraParams { struct ScrollbarTrackExtraParams {
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "ui/gfx/rrect_f.h"
#include "ui/gfx/skia_util.h" #include "ui/gfx/skia_util.h"
#include "ui/native_theme/common_theme.h" #include "ui/native_theme/common_theme.h"
#include "ui/native_theme/native_theme_features.h" #include "ui/native_theme/native_theme_features.h"
...@@ -43,8 +42,6 @@ constexpr int kOverlayScrollbarBorderPatchWidth = 2; ...@@ -43,8 +42,6 @@ constexpr int kOverlayScrollbarBorderPatchWidth = 2;
constexpr int kOverlayScrollbarCenterPatchSize = 1; constexpr int kOverlayScrollbarCenterPatchSize = 1;
const SkColor kTrackColor = SkColorSetRGB(0xF1, 0xF1, 0xF1); const SkColor kTrackColor = SkColorSetRGB(0xF1, 0xF1, 0xF1);
const SkScalar kScrollRadius =
1; // select[multiple] radius+width are set in css
const int kCheckboxBorderRadius = 2; const int kCheckboxBorderRadius = 2;
const int kCheckboxAndRadioBorderWidth = 1; const int kCheckboxAndRadioBorderWidth = 1;
...@@ -191,13 +188,11 @@ void NativeThemeAura::PaintMenuItemBackground( ...@@ -191,13 +188,11 @@ void NativeThemeAura::PaintMenuItemBackground(
color_scheme); color_scheme);
} }
void NativeThemeAura::PaintArrowButton( void NativeThemeAura::PaintArrowButton(cc::PaintCanvas* canvas,
cc::PaintCanvas* canvas, const gfx::Rect& rect,
const gfx::Rect& rect, Part direction,
Part direction, State state,
State state, ColorScheme color_scheme) const {
ColorScheme color_scheme,
const ScrollbarArrowExtraParams& arrow) const {
SkColor bg_color = kTrackColor; SkColor bg_color = kTrackColor;
// Aura-win uses slightly different arrow colors. // Aura-win uses slightly different arrow colors.
SkColor arrow_color = gfx::kPlaceholderColor; SkColor arrow_color = gfx::kPlaceholderColor;
...@@ -222,35 +217,7 @@ void NativeThemeAura::PaintArrowButton( ...@@ -222,35 +217,7 @@ void NativeThemeAura::PaintArrowButton(
cc::PaintFlags flags; cc::PaintFlags flags;
flags.setColor(bg_color); flags.setColor(bg_color);
canvas->drawIRect(gfx::RectToSkIRect(rect), flags);
if (!features::IsFormControlsRefreshEnabled()) {
canvas->drawIRect(gfx::RectToSkIRect(rect), flags);
return PaintArrow(canvas, rect, direction, arrow_color);
}
SkScalar upper_left_radius = 0;
SkScalar lower_left_radius = 0;
SkScalar upper_right_radius = 0;
SkScalar lower_right_radius = 0;
float zoom = arrow.zoom ? arrow.zoom : 1.0;
if (direction == kScrollbarUpArrow) {
static_assert(kInputBorderRadius > 0, "no border radius present");
if (arrow.right_to_left) {
upper_left_radius = kScrollRadius * zoom;
} else {
upper_right_radius = kScrollRadius * zoom;
}
} else if (direction == kScrollbarDownArrow) {
static_assert(kInputBorderRadius > 0, "no border radius present");
if (arrow.right_to_left) {
lower_left_radius = kScrollRadius * zoom;
} else {
lower_right_radius = kScrollRadius * zoom;
}
}
DrawPartiallyRoundRect(canvas, rect, upper_left_radius, upper_right_radius,
lower_right_radius, lower_left_radius, flags);
PaintArrow(canvas, rect, direction, arrow_color); PaintArrow(canvas, rect, direction, arrow_color);
} }
...@@ -797,21 +764,6 @@ gfx::Size NativeThemeAura::GetPartSize(Part part, ...@@ -797,21 +764,6 @@ gfx::Size NativeThemeAura::GetPartSize(Part part,
return NativeThemeBase::GetPartSize(part, state, extra); return NativeThemeBase::GetPartSize(part, state, extra);
} }
void NativeThemeAura::DrawPartiallyRoundRect(cc::PaintCanvas* canvas,
const gfx::Rect& rect,
const SkScalar upper_left_radius,
const SkScalar upper_right_radius,
const SkScalar lower_right_radius,
const SkScalar lower_left_radius,
const cc::PaintFlags& flags) {
gfx::RRectF rounded_rect(
gfx::RectF(rect), upper_left_radius, upper_left_radius,
upper_right_radius, upper_right_radius, lower_right_radius,
lower_right_radius, lower_left_radius, lower_left_radius);
canvas->drawRRect(static_cast<SkRRect>(rounded_rect), flags);
}
bool NativeThemeAura::SupportsNinePatch(Part part) const { bool NativeThemeAura::SupportsNinePatch(Part part) const {
if (!IsOverlayScrollbarEnabled()) if (!IsOverlayScrollbarEnabled())
return false; return false;
......
...@@ -41,8 +41,7 @@ class NATIVE_THEME_EXPORT NativeThemeAura : public NativeThemeBase { ...@@ -41,8 +41,7 @@ class NATIVE_THEME_EXPORT NativeThemeAura : public NativeThemeBase {
const gfx::Rect& rect, const gfx::Rect& rect,
Part direction, Part direction,
State state, State state,
ColorScheme color_scheme, ColorScheme color_scheme) const override;
const ScrollbarArrowExtraParams& arrow) const override;
void PaintScrollbarTrack(cc::PaintCanvas* canvas, void PaintScrollbarTrack(cc::PaintCanvas* canvas,
Part part, Part part,
State state, State state,
...@@ -110,14 +109,6 @@ class NATIVE_THEME_EXPORT NativeThemeAura : public NativeThemeBase { ...@@ -110,14 +109,6 @@ class NATIVE_THEME_EXPORT NativeThemeAura : public NativeThemeBase {
const SkScalar borderRadius, const SkScalar borderRadius,
ColorScheme color_scheme) const; ColorScheme color_scheme) const;
static void DrawPartiallyRoundRect(cc::PaintCanvas* canvas,
const gfx::Rect& rect,
const SkScalar upper_left_radius,
const SkScalar upper_right_radius,
const SkScalar lower_right_radius,
const SkScalar lower_left_radius,
const cc::PaintFlags& flags);
bool use_overlay_scrollbars_; bool use_overlay_scrollbars_;
DISALLOW_COPY_AND_ASSIGN(NativeThemeAura); DISALLOW_COPY_AND_ASSIGN(NativeThemeAura);
......
...@@ -215,8 +215,7 @@ void NativeThemeBase::Paint(cc::PaintCanvas* canvas, ...@@ -215,8 +215,7 @@ void NativeThemeBase::Paint(cc::PaintCanvas* canvas,
case kScrollbarLeftArrow: case kScrollbarLeftArrow:
case kScrollbarRightArrow: case kScrollbarRightArrow:
if (scrollbar_button_length_ > 0) if (scrollbar_button_length_ > 0)
PaintArrowButton(canvas, rect, part, state, color_scheme, PaintArrowButton(canvas, rect, part, state, color_scheme);
extra.scrollbar_arrow);
break; break;
case kScrollbarHorizontalThumb: case kScrollbarHorizontalThumb:
case kScrollbarVerticalThumb: case kScrollbarVerticalThumb:
...@@ -283,13 +282,11 @@ NativeThemeBase::NativeThemeBase() ...@@ -283,13 +282,11 @@ NativeThemeBase::NativeThemeBase()
NativeThemeBase::~NativeThemeBase() { NativeThemeBase::~NativeThemeBase() {
} }
void NativeThemeBase::PaintArrowButton( void NativeThemeBase::PaintArrowButton(cc::PaintCanvas* canvas,
cc::PaintCanvas* canvas, const gfx::Rect& rect,
const gfx::Rect& rect, Part direction,
Part direction, State state,
State state, ColorScheme color_scheme) const {
ColorScheme color_scheme,
const ScrollbarArrowExtraParams& arrow) const {
cc::PaintFlags flags; cc::PaintFlags flags;
// Calculate button color. // Calculate button color.
...@@ -893,14 +890,11 @@ void NativeThemeBase::PaintInnerSpinButton( ...@@ -893,14 +890,11 @@ void NativeThemeBase::PaintInnerSpinButton(
gfx::Rect half = rect; gfx::Rect half = rect;
half.set_height(rect.height() / 2); half.set_height(rect.height() / 2);
ScrollbarArrowExtraParams arrow; PaintArrowButton(canvas, half, kScrollbarUpArrow, north_state, color_scheme);
arrow.zoom = 1.0;
PaintArrowButton(canvas, half, kScrollbarUpArrow, north_state, color_scheme,
arrow);
half.set_y(rect.y() + rect.height() / 2); half.set_y(rect.y() + rect.height() / 2);
PaintArrowButton(canvas, half, kScrollbarDownArrow, south_state, color_scheme, PaintArrowButton(canvas, half, kScrollbarDownArrow, south_state,
arrow); color_scheme);
} }
void NativeThemeBase::PaintProgressBar( void NativeThemeBase::PaintProgressBar(
......
...@@ -47,8 +47,7 @@ class NATIVE_THEME_EXPORT NativeThemeBase : public NativeTheme { ...@@ -47,8 +47,7 @@ class NATIVE_THEME_EXPORT NativeThemeBase : public NativeTheme {
const gfx::Rect& rect, const gfx::Rect& rect,
Part direction, Part direction,
State state, State state,
ColorScheme color_scheme, ColorScheme color_scheme) const;
const ScrollbarArrowExtraParams& arrow) const;
// Paint the scrollbar track. Done before the thumb so that it can contain // Paint the scrollbar track. Done before the thumb so that it can contain
// alpha. // alpha.
virtual void PaintScrollbarTrack( virtual void PaintScrollbarTrack(
......
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