Skip to content

Commit

Permalink
Handle <input type=checkbox switch> disabled styling as part of the p…
Browse files Browse the repository at this point in the history
…ainting 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
  • Loading branch information
annevk committed Feb 19, 2024
1 parent 92cd219 commit 30cda07
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions LayoutTests/platform/ios-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -2395,8 +2395,6 @@ webkit.org/b/269116 imported/w3c/web-platform-tests/css/css-flexbox/negative-ove

webkit.org/b/269321 webgl/1.0.3/conformance/uniforms/out-of-bounds-uniform-array-access.html [ Timeout ]

webkit.org/b/269378 [ Debug ] fast/forms/switch/click-disabled.html [ Skip ]

webkit.org/b/269483 [ Debug ] http/wpt/webcodecs/h264-encoder-default-config.https.any.worker.html [ Skip ]

# webkit.org/b/123266095 (REGRESSION (274957@main) [ iOS Debug ] 2x imported/w3c/web-platform-tests/css/css-view-transitions tests are constant crash)
Expand Down
5 changes: 1 addition & 4 deletions Source/WebCore/rendering/ios/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 30cda07

Please sign in to comment.