Skip to content

Commit

Permalink
Cherry-pick 30cda07. rdar://122956268
Browse files Browse the repository at this point in the history
    Handle <input type=checkbox switch> disabled styling as part of the painting code
    https://bugs.webkit.org/show_bug.cgi?id=269378
    rdar://122956268

    Reviewed by Aditya Keerthi.

    Using opacity creates a stacking context which is not desirable.

    * LayoutTests/platform/ios-wk2/TestExpectations:
    * Source/WebCore/rendering/ios/RenderThemeIOS.mm:
    (WebCore::RenderThemeIOS::adjustSwitchStyle const):

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

Identifier: 272448.652@safari-7618-branch
  • Loading branch information
annevk authored and Dan Robson committed Feb 29, 2024
1 parent 4e48bda commit 84f5b5c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Source/WebCore/rendering/RenderThemeIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ static bool renderThemePaintSwitchTrack(OptionSet<ControlStyle::State>, const Re
}
#endif

void RenderThemeIOS::adjustSwitchStyle(RenderStyle& style, const Element* element) const
void RenderThemeIOS::adjustSwitchStyle(RenderStyle& style, const Element*) const
{
// FIXME: Deduplicate sizing with the generic code somehow.
if (style.width().isAuto() || style.height().isAuto()) {
Expand All @@ -733,9 +733,6 @@ static bool renderThemePaintSwitchTrack(OptionSet<ControlStyle::State>, const Re

if (style.outlineStyleIsAuto() == OutlineIsAuto::On)
style.setOutlineStyle(BorderStyle::None);

if (element->isDisabledFormControl())
style.setOpacity(.4f);
}

bool RenderThemeIOS::paintSwitchThumb(const RenderObject& renderer, const PaintInfo& paintInfo, const FloatRect& rect)
Expand Down

0 comments on commit 84f5b5c

Please sign in to comment.