-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make <input type=checkbox switch> iOS-zooming compatible with other ports #22968
Make <input type=checkbox switch> iOS-zooming compatible with other ports #22968
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
style.setLogicalWidth({ logicalSwitchWidth * style.effectiveZoom(), LengthType::Fixed }); | ||
style.setLogicalHeight({ logicalSwitchHeight * style.effectiveZoom(), LengthType::Fixed }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little strange. Can you confirm using Web Inspector that the computed width/height are unaffected when using the zoom
property?
I'm also curious why switch is special over regular checkboxes. Do they already have a similar issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed strange to me as well! I have now added a test to demonstrate that.
Checkboxes are almost equal to this, except they use min-width/min-height to set this size. It's not clear to me that is better and in fact it seems more complicated for web developers to deal with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be able to upstream this test at some point given w3c/csswg-drafts#9398.
ae1cd93
to
f5ea72d
Compare
EWS run on current version of this PR (hash f5ea72d) |
β¦orts https://bugs.webkit.org/show_bug.cgi?id=267757 rdar://121248632 Reviewed by Aditya Keerthi. This ensures that on iOS builds that can paint a switch, the following tests pass as expected: - fast/forms/switch/zoom-approximates-transform-rtl.html - fast/forms/switch/zoom-approximates-transform-vertical-lr.html - fast/forms/switch/zoom-approximates-transform-vertical-rl.html - fast/forms/switch/zoom-approximates-transform.html Without this fix there would be some amount of zooming on iOS due to it currently aligning with the font-size, but only for very large zoom values. Also add a new test that demonstrates this does not impact getComputedStyle() across platforms. * LayoutTests/fast/forms/switch/zoom-computed-style-expected.txt: Added. * LayoutTests/fast/forms/switch/zoom-computed-style.html: Added. * Source/WebCore/rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::adjustSwitchStyle const): Canonical link: https://commits.webkit.org/273289@main
f5ea72d
to
7c24c6f
Compare
Committed 273289@main (7c24c6f): https://commits.webkit.org/273289@main Reviewed commits have been landed. Closing PR #22968 and removing active labels. |
7c24c6f
f5ea72d