Skip to content

Commit

Permalink
Cleanup RenderThemeMac::adjustRepaintRect()
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264872

Reviewed by Aditya Keerthi.

There's no need for USE(NEW_THEME) here as we're inside PLATFORM(MAC).

* Source/WebCore/rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::adjustRepaintRect):

Canonical link: https://commits.webkit.org/270811@main
  • Loading branch information
annevk committed Nov 16, 2023
1 parent b52c0f4 commit 0f48687
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions Source/WebCore/rendering/RenderThemeMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -797,33 +797,31 @@ static FloatRect inflateRect(const FloatRect& rect, const IntSize& size, const i
{
auto appearance = renderer.style().effectiveAppearance();

#if USE(NEW_THEME)
switch (appearance) {
case StyleAppearance::Button:
case StyleAppearance::Checkbox:
case StyleAppearance::Radio:
case StyleAppearance::PushButton:
case StyleAppearance::SquareButton:
#if ENABLE(INPUT_TYPE_COLOR)
case StyleAppearance::ColorWell:
#endif
case StyleAppearance::DefaultButton:
case StyleAppearance::Button:
case StyleAppearance::InnerSpinButton:
case StyleAppearance::PushButton:
case StyleAppearance::Radio:
case StyleAppearance::SquareButton:
case StyleAppearance::Switch:
return RenderTheme::adjustRepaintRect(renderer, rect);
default:
break;
}
#endif

float zoomLevel = renderer.style().effectiveZoom();

if (appearance == StyleAppearance::Menulist) {
RenderTheme::adjustRepaintRect(renderer, rect);
break;
case StyleAppearance::Menulist: {
auto zoomLevel = renderer.style().effectiveZoom();
setPopupButtonCellState(renderer, IntSize(rect.size()));
IntSize size = popupButtonSizes()[[popupButton() controlSize]];
auto size = popupButtonSizes()[[popupButton() controlSize]];
size.setHeight(size.height() * zoomLevel);
size.setWidth(rect.width());
rect = inflateRect(rect, size, popupButtonMargins(), zoomLevel);
break;
}
default:
break;
}
}

Expand Down

0 comments on commit 0f48687

Please sign in to comment.