[webkit-changes] [WebKit/WebKit] fb6f64: Adjust <input type=checkbox switch> iOS animation
Anne van Kesteren
noreply at github.com
Fri May 3 04:27:48 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fb6f64f9959f2873795185a5be1348f9c2d75cbb
https://github.com/WebKit/WebKit/commit/fb6f64f9959f2873795185a5be1348f9c2d75cbb
Author: Anne van Kesteren <annevk at annevk.nl>
Date: 2024-05-03 (Fri, 03 May 2024)
Changed paths:
M Source/WebCore/html/CheckboxInputType.cpp
M Source/WebCore/html/CheckboxInputType.h
M Source/WebCore/html/HTMLInputElement.cpp
M Source/WebCore/html/HTMLInputElement.h
M Source/WebCore/platform/graphics/SpringSolver.h
M Source/WebCore/rendering/RenderTheme.h
M Source/WebCore/rendering/ios/RenderThemeIOS.h
Log Message:
-----------
Adjust <input type=checkbox switch> iOS animation
https://bugs.webkit.org/show_bug.cgi?id=271839
rdar://125563501
Reviewed by Aditya Keerthi.
The pressed animation for the thumb needs a slight delay. This in turn
necessitates introducing additional state to indicate when it is
pressed, as the control generally being active is no longer sufficient
(that changes too early now).
Also make these more general improvements:
- Rename pressed to held to account for the slight change in semantics.
- Abstract finding the relevant Touch of a TouchEvent in a method.
- Call dispatchSimulatedClick with SendNoEvents for its mouse events
argument. They are redundant and could possibly lead to non-touch
code paths being triggered.
* Source/WebCore/html/CheckboxInputType.cpp:
(WebCore::findTouchWithIdentifier):
(WebCore::CheckboxInputType::subsequentTouchEventTouch const):
(WebCore::CheckboxInputType::handleTouchEvent):
(WebCore::CheckboxInputType::startSwitchPointerTracking):
(WebCore::CheckboxInputType::stopSwitchPointerTracking):
(WebCore::CheckboxInputType::disabledStateChanged):
(WebCore::CheckboxInputType::willUpdateCheckedness):
(WebCore::switchAnimationDuration):
(WebCore::CheckboxInputType::switchAnimationStartTime const):
(WebCore::CheckboxInputType::setSwitchAnimationStartTime):
(WebCore::CheckboxInputType::setIsSwitchHeld):
(WebCore::CheckboxInputType::isSwitchVisuallyOn const):
(WebCore::CheckboxInputType::switchAnimationHeldProgress const):
(WebCore::CheckboxInputType::isSwitchHeld const):
(WebCore::CheckboxInputType::switchAnimationTimerFired):
(WebCore::CheckboxInputType::switchAnimationPressedProgress const): Deleted.
* Source/WebCore/html/CheckboxInputType.h:
* Source/WebCore/html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::switchAnimationHeldProgress const):
(WebCore::HTMLInputElement::isSwitchHeld const):
(WebCore::HTMLInputElement::switchAnimationPressedProgress const): Deleted.
* Source/WebCore/html/HTMLInputElement.h:
* Source/WebCore/platform/graphics/SpringSolver.h:
(WebCore::SpringSolver::solve const):
(WebCore::SpringSolver::solve): Deleted.
* Source/WebCore/rendering/RenderTheme.h:
(WebCore::RenderTheme::switchAnimationHeldDuration const):
(WebCore::RenderTheme::switchAnimationPressedDuration const): Deleted.
* Source/WebCore/rendering/ios/RenderThemeIOS.h:
Canonical link: https://commits.webkit.org/278311@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list