diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index e97aeb8ccaa..7236656aa03 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -193,6 +193,7 @@ set(SOURCES CSS/StyleValues/PositionStyleValue.cpp CSS/StyleValues/RadialGradientStyleValue.cpp CSS/StyleValues/RectStyleValue.cpp + CSS/StyleValues/ScrollbarColorStyleValue.cpp CSS/StyleValues/ShadowStyleValue.cpp CSS/StyleValues/ShorthandStyleValue.cpp CSS/StyleValues/StyleValueList.cpp diff --git a/Libraries/LibWeb/CSS/CSSStyleValue.cpp b/Libraries/LibWeb/CSS/CSSStyleValue.cpp index 3740acb2431..dbbf0701f42 100644 --- a/Libraries/LibWeb/CSS/CSSStyleValue.cpp +++ b/Libraries/LibWeb/CSS/CSSStyleValue.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -338,6 +339,12 @@ ResolutionStyleValue const& CSSStyleValue::as_resolution() const return static_cast(*this); } +ScrollbarColorStyleValue const& CSSStyleValue::as_scrollbar_color() const +{ + VERIFY(is_scrollbar_color()); + return static_cast(*this); +} + ScrollbarGutterStyleValue const& CSSStyleValue::as_scrollbar_gutter() const { VERIFY(is_scrollbar_gutter()); diff --git a/Libraries/LibWeb/CSS/CSSStyleValue.h b/Libraries/LibWeb/CSS/CSSStyleValue.h index b402a0287cb..35236c61e47 100644 --- a/Libraries/LibWeb/CSS/CSSStyleValue.h +++ b/Libraries/LibWeb/CSS/CSSStyleValue.h @@ -130,6 +130,7 @@ public: Ratio, Rect, Resolution, + ScrollbarColor, ScrollbarGutter, Shadow, Shorthand, @@ -325,6 +326,10 @@ public: ResolutionStyleValue const& as_resolution() const; ResolutionStyleValue& as_resolution() { return const_cast(const_cast(*this).as_resolution()); } + bool is_scrollbar_color() const { return type() == Type::ScrollbarColor; } + ScrollbarColorStyleValue const& as_scrollbar_color() const; + ScrollbarColorStyleValue& as_scrollbar_color() { return const_cast(const_cast(*this).as_scrollbar_color()); } + bool is_scrollbar_gutter() const { return type() == Type::ScrollbarGutter; } ScrollbarGutterStyleValue const& as_scrollbar_gutter() const; ScrollbarGutterStyleValue& as_scrollbar_gutter() { return const_cast(const_cast(*this).as_scrollbar_gutter()); } diff --git a/Libraries/LibWeb/CSS/ComputedProperties.cpp b/Libraries/LibWeb/CSS/ComputedProperties.cpp index 29f68241f39..43b13a9b3e1 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.cpp +++ b/Libraries/LibWeb/CSS/ComputedProperties.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1852,6 +1853,22 @@ Vector ComputedProperties::counter_data(PropertyID property_id) con return {}; } +ScrollbarColorData ComputedProperties::scrollbar_color(Layout::NodeWithStyle const& layout_node) const +{ + auto const& value = property(PropertyID::ScrollbarColor); + if (value.is_keyword() && value.as_keyword().keyword() == Keyword::Auto) + return InitialValues::scrollbar_color(); + + if (value.is_scrollbar_color()) { + auto& scrollbar_color_value = value.as_scrollbar_color(); + auto thumb_color = scrollbar_color_value.thumb_color()->to_color(layout_node); + auto track_color = scrollbar_color_value.track_color()->to_color(layout_node); + return { thumb_color, track_color }; + } + + return {}; +} + ScrollbarWidth ComputedProperties::scrollbar_width() const { auto const& value = property(PropertyID::ScrollbarWidth); diff --git a/Libraries/LibWeb/CSS/ComputedProperties.h b/Libraries/LibWeb/CSS/ComputedProperties.h index 934776046cc..1e9b0e65d46 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.h +++ b/Libraries/LibWeb/CSS/ComputedProperties.h @@ -228,6 +228,7 @@ public: QuotesData quotes() const; Vector counter_data(PropertyID) const; + ScrollbarColorData scrollbar_color(Layout::NodeWithStyle const& layout_node) const; ScrollbarWidth scrollbar_width() const; static NonnullRefPtr font_fallback(bool monospace, bool bold, float point_size); diff --git a/Libraries/LibWeb/CSS/ComputedValues.h b/Libraries/LibWeb/CSS/ComputedValues.h index 0ed1c1dd33d..9c751b67550 100644 --- a/Libraries/LibWeb/CSS/ComputedValues.h +++ b/Libraries/LibWeb/CSS/ComputedValues.h @@ -81,6 +81,11 @@ struct Containment { bool is_empty() const { return !(size_containment || inline_size_containment || layout_containment || style_containment || paint_containment); } }; +struct ScrollbarColorData { + Color thumb_color { Color::Transparent }; + Color track_color { Color::Transparent }; +}; + using CursorData = Variant, Cursor>; using ListStyleType = Variant; @@ -211,6 +216,13 @@ public: static CSS::MathStyle math_style() { return CSS::MathStyle::Normal; } static int math_depth() { return 0; } + static ScrollbarColorData scrollbar_color() + { + return ScrollbarColorData { + .thumb_color = Color(Color::NamedColor::DarkGray).with_alpha(192), + .track_color = Color(Color::NamedColor::WarmGray).with_alpha(192), + }; + } static CSS::ScrollbarWidth scrollbar_width() { return CSS::ScrollbarWidth::Auto; } }; @@ -581,6 +593,7 @@ public: CSS::MathStyle math_style() const { return m_inherited.math_style; } int math_depth() const { return m_inherited.math_depth; } + ScrollbarColorData scrollbar_color() const { return m_inherited.scrollbar_color; } CSS::ScrollbarWidth scrollbar_width() const { return m_noninherited.scrollbar_width; } NonnullOwnPtr clone_inherited_values() const @@ -655,6 +668,8 @@ protected: CSS::MathShift math_shift { InitialValues::math_shift() }; CSS::MathStyle math_style { InitialValues::math_style() }; int math_depth { InitialValues::math_depth() }; + + ScrollbarColorData scrollbar_color { InitialValues::scrollbar_color() }; } m_inherited; struct { @@ -967,6 +982,7 @@ public: void set_math_style(CSS::MathStyle value) { m_inherited.math_style = value; } void set_math_depth(int value) { m_inherited.math_depth = value; } + void set_scrollbar_color(ScrollbarColorData value) { m_inherited.scrollbar_color = move(value); } void set_scrollbar_width(CSS::ScrollbarWidth value) { m_noninherited.scrollbar_width = value; } void set_counter_increment(Vector value) { m_noninherited.counter_increment = move(value); } diff --git a/Libraries/LibWeb/CSS/Parser/Parser.h b/Libraries/LibWeb/CSS/Parser/Parser.h index 6ddf6bc27f6..f988ea49157 100644 --- a/Libraries/LibWeb/CSS/Parser/Parser.h +++ b/Libraries/LibWeb/CSS/Parser/Parser.h @@ -417,6 +417,7 @@ private: RefPtr parse_place_items_value(TokenStream&); RefPtr parse_place_self_value(TokenStream&); RefPtr parse_quotes_value(TokenStream&); + RefPtr parse_scrollbar_color_value(TokenStream&); RefPtr parse_scrollbar_gutter_value(TokenStream&); enum class AllowInsetKeyword { No, diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index d98336b6c96..1968320d0b4 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -644,6 +645,10 @@ Parser::ParseErrorOr> Parser::parse_css_value if (auto parsed_value = parse_rotate_value(tokens); parsed_value && !tokens.has_next_token()) return parsed_value.release_nonnull(); return ParseError::SyntaxError; + case PropertyID::ScrollbarColor: + if (auto parsed_value = parse_scrollbar_color_value(tokens); parsed_value && !tokens.has_next_token()) + return parsed_value.release_nonnull(); + return ParseError::SyntaxError; case PropertyID::ScrollbarGutter: if (auto parsed_value = parse_scrollbar_gutter_value(tokens); parsed_value && !tokens.has_next_token()) return parsed_value.release_nonnull(); @@ -4057,6 +4062,32 @@ RefPtr Parser::parse_scale_value(TokenStream Parser::parse_scrollbar_color_value(TokenStream& tokens) +{ + // auto | {2} + if (!tokens.has_next_token()) + return nullptr; + if (auto auto_keyword = parse_all_as_single_keyword_value(tokens, Keyword::Auto)) + return auto_keyword; + + auto transaction = tokens.begin_transaction(); + + auto thumb_color = parse_color_value(tokens); + if (!thumb_color) + return nullptr; + + tokens.discard_whitespace(); + + auto track_color = parse_color_value(tokens); + if (!track_color) + return nullptr; + tokens.discard_whitespace(); + transaction.commit(); + + return ScrollbarColorStyleValue::create(thumb_color.release_nonnull(), track_color.release_nonnull()); +} + // https://drafts.csswg.org/css-overflow/#propdef-scrollbar-gutter RefPtr Parser::parse_scrollbar_gutter_value(TokenStream& tokens) { diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index 3cedb16c9f8..6a23b26e9cd 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -2684,6 +2684,12 @@ "affects-layout": false, "affects-stacking-context": true }, + "scrollbar-color": { + "affects-layout": false, + "animation-type": "by-computed-value", + "inherited": "yes", + "initial": "auto" + }, "scrollbar-gutter": { "affects-layout": false, "animation-type": "discrete", diff --git a/Libraries/LibWeb/CSS/StyleValues/ScrollbarColorStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/ScrollbarColorStyleValue.cpp new file mode 100644 index 00000000000..97557b3bb9b --- /dev/null +++ b/Libraries/LibWeb/CSS/StyleValues/ScrollbarColorStyleValue.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025, Tim Ledbetter + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include "ScrollbarColorStyleValue.h" + +namespace Web::CSS { + +ValueComparingNonnullRefPtr ScrollbarColorStyleValue::create(NonnullRefPtr thumb_color, NonnullRefPtr track_color) +{ + return adopt_ref(*new ScrollbarColorStyleValue(move(thumb_color), move(track_color))); +} + +String ScrollbarColorStyleValue::to_string(SerializationMode mode) const +{ + return MUST(String::formatted("{} {}", m_thumb_color->to_string(mode), m_track_color->to_string(mode))); +} + +} diff --git a/Libraries/LibWeb/CSS/StyleValues/ScrollbarColorStyleValue.h b/Libraries/LibWeb/CSS/StyleValues/ScrollbarColorStyleValue.h new file mode 100644 index 00000000000..e0c31ecc9b1 --- /dev/null +++ b/Libraries/LibWeb/CSS/StyleValues/ScrollbarColorStyleValue.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2025, Tim Ledbetter + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include +#include +#include + +namespace Web::CSS { + +class ScrollbarColorStyleValue final : public StyleValueWithDefaultOperators { +public: + static ValueComparingNonnullRefPtr create(NonnullRefPtr thumb_color, NonnullRefPtr track_color); + virtual ~ScrollbarColorStyleValue() override = default; + + virtual String to_string(SerializationMode) const override; + bool properties_equal(ScrollbarColorStyleValue const& other) const { return m_thumb_color == other.m_thumb_color && m_track_color == other.m_track_color; } + + NonnullRefPtr thumb_color() const { return m_thumb_color; } + NonnullRefPtr track_color() const { return m_track_color; } + +private: + explicit ScrollbarColorStyleValue(NonnullRefPtr thumb_color, NonnullRefPtr track_color) + : StyleValueWithDefaultOperators(Type::ScrollbarColor) + , m_thumb_color(move(thumb_color)) + , m_track_color(move(track_color)) + { + } + + NonnullRefPtr m_thumb_color; + NonnullRefPtr m_track_color; +}; + +} diff --git a/Libraries/LibWeb/Forward.h b/Libraries/LibWeb/Forward.h index 687c69e13d6..399e7400cb3 100644 --- a/Libraries/LibWeb/Forward.h +++ b/Libraries/LibWeb/Forward.h @@ -288,6 +288,7 @@ class Selector; class ShadowStyleValue; class ShorthandStyleValue; class Size; +class ScrollbarColorStyleValue; class StringStyleValue; class StyleComputer; class ComputedProperties; diff --git a/Libraries/LibWeb/Layout/Node.cpp b/Libraries/LibWeb/Layout/Node.cpp index 51c5c714444..802942e556e 100644 --- a/Libraries/LibWeb/Layout/Node.cpp +++ b/Libraries/LibWeb/Layout/Node.cpp @@ -962,6 +962,7 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style) computed_values.set_object_position(computed_style.object_position()); computed_values.set_direction(computed_style.direction()); computed_values.set_unicode_bidi(computed_style.unicode_bidi()); + computed_values.set_scrollbar_color(computed_style.scrollbar_color(*this)); computed_values.set_scrollbar_width(computed_style.scrollbar_width()); computed_values.set_writing_mode(computed_style.writing_mode()); computed_values.set_user_select(computed_style.user_select()); diff --git a/Libraries/LibWeb/Painting/Command.h b/Libraries/LibWeb/Painting/Command.h index 2fc4bcef464..005657c084e 100644 --- a/Libraries/LibWeb/Painting/Command.h +++ b/Libraries/LibWeb/Painting/Command.h @@ -405,6 +405,8 @@ struct PaintScrollBar { Gfx::IntRect gutter_rect; Gfx::IntRect thumb_rect; CSSPixelFraction scroll_size; + Color thumb_color; + Color track_color; bool vertical; void translate_by(Gfx::IntPoint const& offset) diff --git a/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp b/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp index a34e558893d..5cd8ec53186 100644 --- a/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp +++ b/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp @@ -1001,17 +1001,20 @@ void DisplayListPlayerSkia::paint_scrollbar(PaintScrollBar const& command) auto& canvas = surface().canvas(); - auto gutter_fill_color = Color(Color::NamedColor::WarmGray).with_alpha(192); + auto gutter_fill_color = command.track_color; SkPaint gutter_fill_paint; gutter_fill_paint.setColor(to_skia_color(gutter_fill_color)); canvas.drawRect(gutter_rect, gutter_fill_paint); - auto thumb_fill_color = Color(Color::NamedColor::DarkGray).with_alpha(gutter_rect.isEmpty() ? 128 : 192); + auto thumb_fill_color = command.thumb_color; + if (command.gutter_rect.is_empty() && thumb_fill_color == CSS::InitialValues::scrollbar_color().thumb_color) + thumb_fill_color = thumb_fill_color.with_alpha(128); + SkPaint thumb_fill_paint; thumb_fill_paint.setColor(to_skia_color(thumb_fill_color)); canvas.drawRRect(thumb_rrect, thumb_fill_paint); - auto stroke_color = Color(Color::NamedColor::LightGray).with_alpha(128); + auto stroke_color = thumb_fill_color.lightened(); SkPaint stroke_paint; stroke_paint.setStroke(true); stroke_paint.setStrokeWidth(1); diff --git a/Libraries/LibWeb/Painting/DisplayListRecorder.cpp b/Libraries/LibWeb/Painting/DisplayListRecorder.cpp index 83581304de9..457588bb366 100644 --- a/Libraries/LibWeb/Painting/DisplayListRecorder.cpp +++ b/Libraries/LibWeb/Painting/DisplayListRecorder.cpp @@ -400,13 +400,15 @@ void DisplayListRecorder::draw_triangle_wave(Gfx::IntPoint a_p1, Gfx::IntPoint a .thickness = thickness }); } -void DisplayListRecorder::paint_scrollbar(int scroll_frame_id, Gfx::IntRect gutter_rect, Gfx::IntRect thumb_rect, CSSPixelFraction scroll_size, bool vertical) +void DisplayListRecorder::paint_scrollbar(int scroll_frame_id, Gfx::IntRect gutter_rect, Gfx::IntRect thumb_rect, CSSPixelFraction scroll_size, Color thumb_color, Color track_color, bool vertical) { append(PaintScrollBar { .scroll_frame_id = scroll_frame_id, .gutter_rect = gutter_rect, .thumb_rect = thumb_rect, .scroll_size = scroll_size, + .thumb_color = thumb_color, + .track_color = track_color, .vertical = vertical }); } diff --git a/Libraries/LibWeb/Painting/DisplayListRecorder.h b/Libraries/LibWeb/Painting/DisplayListRecorder.h index 19b3cf996ac..9a68a22c321 100644 --- a/Libraries/LibWeb/Painting/DisplayListRecorder.h +++ b/Libraries/LibWeb/Painting/DisplayListRecorder.h @@ -146,7 +146,7 @@ public: void draw_triangle_wave(Gfx::IntPoint a_p1, Gfx::IntPoint a_p2, Color color, int amplitude, int thickness); - void paint_scrollbar(int scroll_frame_id, Gfx::IntRect gutter_rect, Gfx::IntRect thumb_rect, CSSPixelFraction scroll_size, bool vertical); + void paint_scrollbar(int scroll_frame_id, Gfx::IntRect gutter_rect, Gfx::IntRect thumb_rect, CSSPixelFraction scroll_size, Color thumb_color, Color track_color, bool vertical); void apply_opacity(float opacity); void apply_compositing_and_blending_operator(Gfx::CompositingAndBlendingOperator compositing_and_blending_operator); diff --git a/Libraries/LibWeb/Painting/PaintableBox.cpp b/Libraries/LibWeb/Painting/PaintableBox.cpp index 74645e9766d..8a24880e12f 100644 --- a/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -479,16 +479,16 @@ void PaintableBox::paint(PaintContext& context, PaintPhase phase) const } if (phase == PaintPhase::Overlay && (g_paint_viewport_scrollbars || !is_viewport()) && computed_values().scrollbar_width() != CSS::ScrollbarWidth::None) { + auto scrollbar_colors = computed_values().scrollbar_color(); if (auto scrollbar_data = compute_scrollbar_data(ScrollDirection::Vertical); scrollbar_data.has_value()) { auto gutter_rect = context.rounded_device_rect(scrollbar_data->gutter_rect).to_type(); auto thumb_rect = context.rounded_device_rect(scrollbar_data->thumb_rect).to_type(); - context.display_list_recorder().paint_scrollbar(own_scroll_frame_id().value(), gutter_rect, thumb_rect, scrollbar_data->scroll_length, true); + context.display_list_recorder().paint_scrollbar(own_scroll_frame_id().value(), gutter_rect, thumb_rect, scrollbar_data->scroll_length, scrollbar_colors.thumb_color, scrollbar_colors.track_color, true); } - if (auto scrollbar_data = compute_scrollbar_data(ScrollDirection::Horizontal); scrollbar_data.has_value()) { auto gutter_rect = context.rounded_device_rect(scrollbar_data->gutter_rect).to_type(); auto thumb_rect = context.rounded_device_rect(scrollbar_data->thumb_rect).to_type(); - context.display_list_recorder().paint_scrollbar(own_scroll_frame_id().value(), gutter_rect, thumb_rect, scrollbar_data->scroll_length, false); + context.display_list_recorder().paint_scrollbar(own_scroll_frame_id().value(), gutter_rect, thumb_rect, scrollbar_data->scroll_length, scrollbar_colors.thumb_color, scrollbar_colors.track_color, false); } } diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt index 20278e180a8..3975a41b29c 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt @@ -208,6 +208,7 @@ All properties associated with getComputedStyle(document.body): "rx", "ry", "scale", + "scrollbar-color", "scrollbar-gutter", "scrollbar-width", "stop-color", diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt index 0ef0a0cdcd7..e5093445757 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt @@ -564,6 +564,8 @@ All supported properties and their default values exposed from CSSStylePropertie 'rx': 'auto' 'ry': 'auto' 'scale': 'none' +'scrollbarColor': 'auto' +'scrollbar-color': 'auto' 'scrollbarGutter': 'auto' 'scrollbar-gutter': 'auto' 'scrollbarWidth': 'auto' diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index 7901825f878..ea9bc7d2fec 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -206,6 +206,7 @@ row-gap: normal rx: auto ry: auto scale: none +scrollbar-color: auto scrollbar-gutter: auto scrollbar-width: auto stop-color: rgb(0, 0, 0) diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt index f8f8ba907cd..994090408ba 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt @@ -1,8 +1,8 @@ Harness status: OK -Found 199 tests +Found 200 tests -189 Pass +190 Pass 10 Fail Pass accent-color Pass border-collapse @@ -175,6 +175,7 @@ Pass row-gap Pass rx Pass ry Pass scale +Pass scrollbar-color Pass scrollbar-gutter Pass scrollbar-width Pass stop-color diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-scrollbars/scrollbar-color-parsing.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-scrollbars/scrollbar-color-parsing.txt new file mode 100644 index 00000000000..a075912f66a --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-scrollbars/scrollbar-color-parsing.txt @@ -0,0 +1,18 @@ +Harness status: OK + +Found 13 tests + +13 Pass +Pass e.style['scrollbar-color'] = "initial" should set the property value +Pass e.style['scrollbar-color'] = "inherit" should set the property value +Pass e.style['scrollbar-color'] = "unset" should set the property value +Pass e.style['scrollbar-color'] = "revert" should set the property value +Pass e.style['scrollbar-color'] = "auto" should set the property value +Pass e.style['scrollbar-color'] = "red green" should set the property value +Pass e.style['scrollbar-color'] = "#FF0000 #00FF00" should set the property value +Pass e.style['scrollbar-color'] = "currentcolor currentcolor" should set the property value +Pass e.style['scrollbar-color'] = "" should not set the property value +Pass e.style['scrollbar-color'] = "auto auto" should not set the property value +Pass e.style['scrollbar-color'] = "auto currentcolor" should not set the property value +Pass e.style['scrollbar-color'] = "red" should not set the property value +Pass e.style['scrollbar-color'] = "#FF0000" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-scrollbars/scrollbar-color-parsing.html b/Tests/LibWeb/Text/input/wpt-import/css/css-scrollbars/scrollbar-color-parsing.html new file mode 100644 index 00000000000..0dcee40eb35 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-scrollbars/scrollbar-color-parsing.html @@ -0,0 +1,26 @@ + + +CSS Scrollbars: parsing scrollbar-color declarations + + + + + + +