[webkit-changes] [WebKit/WebKit] 5b6dcd: Rename ControlPartType enum class to StyleAppearance

Tim Nguyen noreply at github.com
Mon Jan 9 16:03:03 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5b6dcd213c1d1503c197db3060322c18b1ee4ae4
      https://github.com/WebKit/WebKit/commit/5b6dcd213c1d1503c197db3060322c18b1ee4ae4
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-01-09 (Mon, 09 Jan 2023)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp
    M Source/WebCore/accessibility/AccessibilitySlider.cpp
    M Source/WebCore/css/CSSPrimitiveValueMappings.h
    M Source/WebCore/css/CSSValueKeywords.in
    M Source/WebCore/html/RangeInputType.cpp
    M Source/WebCore/html/shadow/SliderThumbElement.cpp
    M Source/WebCore/html/shadow/TextControlInnerElements.cpp
    M Source/WebCore/platform/Theme.cpp
    M Source/WebCore/platform/Theme.h
    M Source/WebCore/platform/ThemeTypes.h
    M Source/WebCore/platform/adwaita/ThemeAdwaita.cpp
    M Source/WebCore/platform/adwaita/ThemeAdwaita.h
    M Source/WebCore/platform/graphics/controls/ButtonPart.h
    M Source/WebCore/platform/graphics/controls/ColorWellPart.h
    M Source/WebCore/platform/graphics/controls/ControlPart.cpp
    M Source/WebCore/platform/graphics/controls/ControlPart.h
    R Source/WebCore/platform/graphics/controls/ControlPartType.cpp
    R Source/WebCore/platform/graphics/controls/ControlPartType.h
    M Source/WebCore/platform/graphics/controls/InnerSpinButtonPart.h
    M Source/WebCore/platform/graphics/controls/MenuListButtonPart.h
    M Source/WebCore/platform/graphics/controls/MenuListPart.h
    M Source/WebCore/platform/graphics/controls/MeterPart.cpp
    M Source/WebCore/platform/graphics/controls/ProgressBarPart.cpp
    M Source/WebCore/platform/graphics/controls/SearchFieldCancelButtonPart.h
    M Source/WebCore/platform/graphics/controls/SearchFieldPart.h
    M Source/WebCore/platform/graphics/controls/SliderThumbPart.h
    M Source/WebCore/platform/graphics/controls/SliderTrackPart.cpp
    M Source/WebCore/platform/graphics/controls/SliderTrackPart.h
    M Source/WebCore/platform/graphics/controls/TextAreaPart.h
    M Source/WebCore/platform/graphics/controls/TextFieldPart.h
    M Source/WebCore/platform/graphics/controls/ToggleButtonPart.h
    M Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
    M Source/WebCore/platform/graphics/mac/controls/ButtonMac.mm
    M Source/WebCore/platform/graphics/mac/controls/ControlFactoryMac.mm
    M Source/WebCore/platform/graphics/mac/controls/SliderThumbMac.mm
    M Source/WebCore/platform/graphics/mac/controls/SliderTrackMac.mm
    M Source/WebCore/platform/graphics/mac/controls/TextAreaMac.mm
    M Source/WebCore/platform/graphics/mac/controls/ToggleButtonMac.mm
    M Source/WebCore/platform/mac/ThemeMac.h
    M Source/WebCore/platform/mac/ThemeMac.mm
    M Source/WebCore/rendering/RenderAttachment.cpp
    M Source/WebCore/rendering/RenderLayerScrollableArea.cpp
    M Source/WebCore/rendering/RenderListBox.cpp
    M Source/WebCore/rendering/RenderMenuList.cpp
    M Source/WebCore/rendering/RenderTheme.cpp
    M Source/WebCore/rendering/RenderTheme.h
    M Source/WebCore/rendering/RenderThemeAdwaita.cpp
    M Source/WebCore/rendering/RenderThemeIOS.h
    M Source/WebCore/rendering/RenderThemeIOS.mm
    M Source/WebCore/rendering/RenderThemeMac.h
    M Source/WebCore/rendering/RenderThemeMac.mm
    M Source/WebCore/rendering/RenderThemeWin.cpp
    M Source/WebCore/rendering/RenderThemeWin.h
    M Source/WebCore/rendering/style/RenderStyle.h
    A Source/WebCore/style/StyleAppearance.cpp
    A Source/WebCore/style/StyleAppearance.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  Rename ControlPartType enum class to StyleAppearance
https://bugs.webkit.org/show_bug.cgi?id=250067
rdar://103865254

Reviewed by Aditya Keerthi.

This makes checks like `style.effectiveAppearance() == ControlPartType::X` less confusing, and emphasizes the connection with the appearance property.
Also, rename ControlPartType::NoControl to StyleAppearance::None.

The ControlPart terminology is preserved for form control drawing code.

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isApplePayButton const):
* Source/WebCore/accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::orientation const):
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator StyleAppearance const):
(WebCore::CSSPrimitiveValue::operator ControlPartType const): Deleted.
* Source/WebCore/css/CSSValueKeywords.in:
* Source/WebCore/html/RangeInputType.cpp:
(WebCore::RangeInputType::handleKeydownEvent):
* Source/WebCore/html/shadow/SliderThumbElement.cpp:
(WebCore::hasVerticalAppearance):
(WebCore::SliderThumbElement::resolveCustomStyle):
* Source/WebCore/html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::resolveCustomStyle):
(WebCore::SearchFieldCancelButtonElement::resolveCustomStyle):
* Source/WebCore/platform/Theme.cpp:
(WebCore::Theme::baselinePositionAdjustment const):
(WebCore::Theme::controlFont const):
(WebCore::Theme::controlSize const):
(WebCore::Theme::minimumControlSize const):
(WebCore::Theme::controlRequiresPreWhiteSpace const):
(WebCore::Theme::paint):
(WebCore::Theme::inflateControlPaintRect const):
(WebCore::Theme::controlBorder const):
(WebCore::Theme::controlPadding const):
* Source/WebCore/platform/Theme.h:
* Source/WebCore/platform/ThemeTypes.h:
* Source/WebCore/platform/adwaita/ThemeAdwaita.cpp:
(WebCore::ThemeAdwaita::controlSize const):
(WebCore::ThemeAdwaita::minimumControlSize const):
(WebCore::ThemeAdwaita::controlBorder const):
(WebCore::ThemeAdwaita::paint):
* Source/WebCore/platform/adwaita/ThemeAdwaita.h:
* Source/WebCore/platform/graphics/controls/ButtonPart.h:
* Source/WebCore/platform/graphics/controls/ColorWellPart.h:
* Source/WebCore/platform/graphics/controls/ControlPart.cpp:
(WebCore::ControlPart::ControlPart):
* Source/WebCore/platform/graphics/controls/ControlPart.h:
(WebCore::ControlPart::type const):
* Source/WebCore/platform/graphics/controls/ControlPartType.cpp: Removed.
* Source/WebCore/platform/graphics/controls/InnerSpinButtonPart.h:
* Source/WebCore/platform/graphics/controls/MenuListButtonPart.h:
* Source/WebCore/platform/graphics/controls/MenuListPart.h:
* Source/WebCore/platform/graphics/controls/MeterPart.cpp:
(WebCore::MeterPart::MeterPart):
* Source/WebCore/platform/graphics/controls/ProgressBarPart.cpp:
(WebCore::ProgressBarPart::ProgressBarPart):
* Source/WebCore/platform/graphics/controls/SearchFieldCancelButtonPart.h:
* Source/WebCore/platform/graphics/controls/SearchFieldPart.h:
* Source/WebCore/platform/graphics/controls/SliderThumbPart.h:
* Source/WebCore/platform/graphics/controls/SliderTrackPart.cpp:
(WebCore::SliderTrackPart::create):
(WebCore::SliderTrackPart::SliderTrackPart):
(WebCore::SliderTrackPart::drawTicks const):
* Source/WebCore/platform/graphics/controls/SliderTrackPart.h:
(isType):
* Source/WebCore/platform/graphics/controls/TextAreaPart.h:
* Source/WebCore/platform/graphics/controls/TextFieldPart.h:
* Source/WebCore/platform/graphics/controls/ToggleButtonPart.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawControlPart::type const):
* Source/WebCore/platform/graphics/mac/controls/ButtonMac.mm:
(WebCore::ButtonMac::ButtonMac):
(WebCore::ButtonMac::bezelStyle const):
* Source/WebCore/platform/graphics/mac/controls/ControlFactoryMac.mm:
(WebCore::ControlFactoryMac::createPlatformButton):
(WebCore::ControlFactoryMac::createPlatformToggleButton):
* Source/WebCore/platform/graphics/mac/controls/SliderThumbMac.mm:
(WebCore::SliderThumbMac::SliderThumbMac):
(WebCore::SliderThumbMac::rectForBounds const):
* Source/WebCore/platform/graphics/mac/controls/SliderTrackMac.mm:
(WebCore::SliderTrackMac::rectForBounds const):
(WebCore::SliderTrackMac::draw):
* Source/WebCore/platform/graphics/mac/controls/TextAreaMac.mm:
(WebCore::TextAreaMac::TextAreaMac):
* Source/WebCore/platform/graphics/mac/controls/ToggleButtonMac.mm:
(WebCore::ToggleButtonMac::ToggleButtonMac):
(WebCore::ToggleButtonMac::cellSize const):
(WebCore::ToggleButtonMac::cellOutsets const):
* Source/WebCore/platform/mac/ThemeMac.h:
* Source/WebCore/platform/mac/ThemeMac.mm:
(WebCore::configureToggleButton):
(WebCore::createToggleButtonCell):
(WebCore::sharedRadioCell):
(WebCore::sharedCheckboxCell):
(WebCore::setUpButtonCell):
(WebCore::button):
(WebCore::ThemeMac::baselinePositionAdjustment const):
(WebCore::ThemeMac::controlFont const):
(WebCore::ThemeMac::controlSize const):
(WebCore::ThemeMac::minimumControlSize const):
(WebCore::ThemeMac::controlBorder const):
(WebCore::ThemeMac::controlPadding const):
(WebCore::ThemeMac::inflateControlPaintRect const):
* Source/WebCore/rendering/RenderAttachment.cpp:
(WebCore::RenderAttachment::shouldDrawBorder const):
* Source/WebCore/rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::updateScrollbarsAfterStyleChange):
(WebCore::RenderLayerScrollableArea::updateScrollbarsAfterLayout):
* Source/WebCore/rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar):
* Source/WebCore/rendering/RenderMenuList.cpp:
(RenderMenuList::menuStyle const):
(RenderMenuList::clientPaddingLeft const):
(RenderMenuList::clientPaddingRight const):
* Source/WebCore/rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustAppearanceForElement const):
(WebCore::isAppearanceAllowedForAllElements):
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::autoAppearanceForElement const):
(WebCore::createSliderTrackPartForRenderer):
(WebCore::RenderTheme::createControlPart const):
(WebCore::RenderTheme::extractControlStyleForRenderer const):
(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::paintBorderOnly):
(WebCore::RenderTheme::paintDecorations):
(WebCore::RenderTheme::isControlContainer const):
(WebCore::RenderTheme::isControlStyled const):
(WebCore::RenderTheme::supportsFocusRing const):
(WebCore::RenderTheme::isDefault const):
(WebCore::RenderTheme::supportsMeter const):
(WebCore::RenderTheme::paintSliderTicks):
* Source/WebCore/rendering/RenderTheme.h:
(WebCore::RenderTheme::scrollbarControlSizeForPart):
(WebCore::RenderTheme::canPaint const):
* Source/WebCore/rendering/RenderThemeAdwaita.cpp:
(WebCore::RenderThemeAdwaita::supportsFocusRing const):
(WebCore::RenderThemeAdwaita::popupInternalPaddingBox const):
(WebCore::RenderThemeAdwaita::paintMenuList):
(WebCore::RenderThemeAdwaita::paintSliderTrack):
(WebCore::RenderThemeAdwaita::adjustSliderThumbSize const):
(WebCore::RenderThemeAdwaita::paintSliderThumb):
* Source/WebCore/rendering/RenderThemeIOS.h:
* Source/WebCore/rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::canPaint const):
(WebCore::RenderThemeIOS::adjustedPaintRect const):
(WebCore::RenderThemeIOS::baselinePosition const):
(WebCore::RenderThemeIOS::isControlStyled const):
(WebCore::RenderThemeIOS::popupInternalPaddingBox const):
(WebCore::canAdjustBorderRadiusForAppearance):
(WebCore::RenderThemeIOS::paintSliderTrack):
(WebCore::RenderThemeIOS::adjustSliderThumbSize const):
(WebCore::RenderThemeIOS::adjustButtonStyle const):
(WebCore::RenderThemeIOS::supportsBoxShadow const):
(WebCore::RenderThemeIOS::supportsMeter const):
(WebCore::RenderThemeIOS::paintSliderTicks):
(WebCore::RenderThemeIOS::paintSliderTrackWithFormControlRefresh):
* Source/WebCore/rendering/RenderThemeMac.h:
* Source/WebCore/rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::canPaint const):
(WebCore::RenderThemeMac::canCreateControlPartForRenderer const):
(WebCore::RenderThemeMac::canCreateControlPartForBorderOnly const):
(WebCore::RenderThemeMac::canCreateControlPartForDecorations const):
(WebCore::RenderThemeMac::isControlStyled const):
(WebCore::RenderThemeMac::adjustRepaintRect):
(WebCore::RenderThemeMac::controlSupportsTints const):
(WebCore::RenderThemeMac::supportsMeter const):
(WebCore::RenderThemeMac::popupInternalPaddingBox const):
(WebCore::RenderThemeMac::adjustSliderThumbSize const):
* Source/WebCore/rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::supportsFocus const):
(WebCore::RenderThemeWin::determineClassicState):
(WebCore::RenderThemeWin::determineState):
(WebCore::RenderThemeWin::getClassicThemeData):
(WebCore::RenderThemeWin::getThemeData):
(WebCore::drawControl):
(WebCore::RenderThemeWin::paintSliderTrack):
(WebCore::RenderThemeWin::adjustSliderThumbSize const):
(WebCore::RenderThemeWin::supportsMeter const):
* Source/WebCore/rendering/RenderThemeWin.h:
* Source/WebCore/rendering/style/RenderStyle.h:
(WebCore::RenderStyle::hasAppearance const):
(WebCore::RenderStyle::hasEffectiveAppearance const):
(WebCore::RenderStyle::appearance const):
(WebCore::RenderStyle::effectiveAppearance const):
(WebCore::RenderStyle::setAppearance):
(WebCore::RenderStyle::setEffectiveAppearance):
(WebCore::RenderStyle::initialAppearance):
* Source/WebCore/style/StyleAppearance.cpp: Added.
(WebCore::operator<<):
* Source/WebCore/style/StyleAppearance.h: Renamed from Source/WebCore/platform/graphics/controls/ControlPartType.h.
* Source/WebKit/Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ControlPart>::encode):
(IPC::ArgumentCoder<ControlPart>::decode):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/258690@main




More information about the webkit-changes mailing list