Skip to content

Commit

Permalink
Rename RenderStyle effectiveScrollbarThumbColor() to usedScrollbarThu…
Browse files Browse the repository at this point in the history
…mbColor() & effectiveScrollbarTrackColor() to usedScrollbarTrackColor()

https://bugs.webkit.org/show_bug.cgi?id=270735

Reviewed by Tim Nguyen.

This aligns them with terminology used in CSS standards.

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::scrollbarThumbColorStyle const):
(WebCore::LocalFrameView::scrollbarTrackColorStyle const):
* Source/WebCore/rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::scrollbarThumbColorStyle const):
(WebCore::RenderLayerScrollableArea::scrollbarTrackColorStyle const):
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::usedScrollbarThumbColor const):
(WebCore::RenderStyle::usedScrollbarTrackColor const):
(WebCore::RenderStyle::effectiveScrollbarThumbColor const): Deleted.
(WebCore::RenderStyle::effectiveScrollbarTrackColor const): Deleted.
* Source/WebCore/rendering/style/RenderStyle.h:

Canonical link: https://commits.webkit.org/275889@main
  • Loading branch information
annevk committed Mar 10, 2024
1 parent d1c4d86 commit c67bb75
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Source/WebCore/page/LocalFrameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6087,7 +6087,7 @@ Color LocalFrameView::scrollbarThumbColorStyle() const
auto* document = m_frame->document();
auto scrollingObject = document && document->documentElement() ? document->documentElement()->renderer() : nullptr;
if (scrollingObject)
return scrollingObject->style().effectiveScrollbarThumbColor();
return scrollingObject->style().usedScrollbarThumbColor();
return { };
}

Expand All @@ -6096,7 +6096,7 @@ Color LocalFrameView::scrollbarTrackColorStyle() const
auto* document = m_frame->document();
auto scrollingObject = document && document->documentElement() ? document->documentElement()->renderer() : nullptr;
if (scrollingObject)
return scrollingObject->style().effectiveScrollbarTrackColor();
return scrollingObject->style().usedScrollbarTrackColor();
return { };
}

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/rendering/RenderLayerScrollableArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,14 +1024,14 @@ OverscrollBehavior RenderLayerScrollableArea::verticalOverscrollBehavior() const
Color RenderLayerScrollableArea::scrollbarThumbColorStyle() const
{
if (auto* renderer = m_layer.renderBox())
return renderer->style().effectiveScrollbarThumbColor();
return renderer->style().usedScrollbarThumbColor();
return { };
}

Color RenderLayerScrollableArea::scrollbarTrackColorStyle() const
{
if (auto* renderer = m_layer.renderBox())
return renderer->style().effectiveScrollbarTrackColor();
return renderer->style().usedScrollbarTrackColor();
return { };
}

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/rendering/style/RenderStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3106,7 +3106,7 @@ Color RenderStyle::usedAccentColor() const
return colorResolvingCurrentColor(accentColor());
}

Color RenderStyle::effectiveScrollbarThumbColor() const
Color RenderStyle::usedScrollbarThumbColor() const
{
if (!scrollbarColor().has_value())
return { };
Expand All @@ -3117,7 +3117,7 @@ Color RenderStyle::effectiveScrollbarThumbColor() const
return colorResolvingCurrentColor(scrollbarColor().value().thumbColor);
}

Color RenderStyle::effectiveScrollbarTrackColor() const
Color RenderStyle::usedScrollbarTrackColor() const
{
if (!scrollbarColor().has_value())
return { };
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/rendering/style/RenderStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -1016,8 +1016,8 @@ class RenderStyle {
const ScrollSnapAlign& scrollSnapAlign() const;
ScrollSnapStop scrollSnapStop() const;

Color effectiveScrollbarThumbColor() const;
Color effectiveScrollbarTrackColor() const;
Color usedScrollbarThumbColor() const;
Color usedScrollbarTrackColor() const;
inline std::optional<ScrollbarColor> scrollbarColor() const;
inline const StyleColor& scrollbarThumbColor() const;
inline const StyleColor& scrollbarTrackColor() const;
Expand Down

0 comments on commit c67bb75

Please sign in to comment.