-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=268920 rdar://118550285 Reviewed by Tyler Wilcock. This patch adopts a new accessibility API, _AXSPrefersNonBlinkingCursorIndicator, to turns off caret blinking animations when enabled. A new test was also added to verify this behavior. * LayoutTests/accessibility/mac/prefers-non-blinking-cursor-expected.txt: Added. * LayoutTests/accessibility/mac/prefers-non-blinking-cursor.html: Added. * LayoutTests/platform/mac/TestExpectations: * Source/WTF/wtf/PlatformEnable.h: * Source/WebCore/editing/FrameSelection.cpp: (WebCore::FrameSelection::setPrefersNonBlinkingCursor): * Source/WebCore/editing/FrameSelection.h: * Source/WebCore/page/Page.cpp: (WebCore::Page::setPrefersNonBlinkingCursor): * Source/WebCore/page/Page.h: (WebCore::Page::prefersNonBlinkingCursor const): * Source/WebCore/platform/CaretAnimator.cpp: (WebCore::CaretAnimator::isBlinkingSuspended const): * Source/WebCore/platform/CaretAnimator.h: (WebCore::CaretAnimator::setPrefersNonBlinkingCursor): (WebCore::CaretAnimator::prefersNonBlinkingCursor const): (WebCore::CaretAnimator::CaretAnimator): (WebCore::CaretAnimator::isBlinkingSuspended const): Deleted. * Source/WebCore/platform/DictationCaretAnimator.cpp: (WebCore::DictationCaretAnimator::expandedCaretRect const): * Source/WebCore/testing/Internals.cpp: (WebCore::Internals::setPrefersNonBlinkingCursor): (WebCore::Internals::isCaretBlinkingSuspended): * Source/WebCore/testing/Internals.h: * Source/WebCore/testing/Internals.idl: * Source/WebKit/Platform/spi/Cocoa/AccessibilitySupportSPI.h: * Source/WebKit/Shared/AccessibilityPreferences.h: * Source/WebKit/Shared/AccessibilityPreferences.serialization.in: * Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::accessibilityPreferences): (WebKit::WebProcessPool::registerNotificationObservers): * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::m_unifiedTextReplacementController): (WebKit::WebPage::updatePrefersNonBlinkingCursor): * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebProcess.h: (WebKit::WebProcess::prefersNonBlinkingCursor const): * Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::accessibilityPreferencesDidChange): (WebKit::WebProcess::updatePageAccessibilitySettings): Canonical link: https://commits.webkit.org/274792@main
- Loading branch information
1 parent
ef44165
commit 322e588
Showing
22 changed files
with
211 additions
and
7 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
LayoutTests/accessibility/mac/prefers-non-blinking-cursor-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
This tests that the prefers non-blinking cursor setting stops and starts caret blinking as expected. | ||
|
||
PASS: internals.isCaretBlinkingSuspended(document) === false | ||
PASS: internals.isCaretBlinkingSuspended(document) === true | ||
PASS: internals.isCaretBlinkingSuspended(document) === false | ||
PASS: internals.isCaretBlinkingSuspended(iframe.contentDocument) === false | ||
PASS: internals.isCaretBlinkingSuspended(iframe.contentDocument) === true | ||
PASS: internals.isCaretBlinkingSuspended(iframe.contentDocument) === false | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
43 changes: 43 additions & 0 deletions
43
LayoutTests/accessibility/mac/prefers-non-blinking-cursor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
<script src="../../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<input id="textinput" type="text" /> | ||
<iframe id="iframe" onload="startTest()" src="data:text/html,<body><input id='iframe-input' type='text' /></body>"> | ||
</iframe> | ||
|
||
<script> | ||
var output = "This tests that the prefers non-blinking cursor setting stops and starts caret blinking as expected.\n\n"; | ||
const iframe = document.getElementById("iframe"); | ||
window.jsTestIsAsync = true; | ||
|
||
function startTest() { | ||
document.getElementById("textinput").focus(); | ||
output += expect("internals.isCaretBlinkingSuspended(document)", "false"); | ||
|
||
internals.setPrefersNonBlinkingCursor(true); | ||
output += expect("internals.isCaretBlinkingSuspended(document)", "true"); | ||
|
||
internals.setPrefersNonBlinkingCursor(false); | ||
output += expect("internals.isCaretBlinkingSuspended(document)", "false"); | ||
|
||
iframe.contentDocument.getElementById("iframe-input").focus(); | ||
output += expect("internals.isCaretBlinkingSuspended(iframe.contentDocument)", "false"); | ||
|
||
internals.setPrefersNonBlinkingCursor(true); | ||
output += expect("internals.isCaretBlinkingSuspended(iframe.contentDocument)", "true"); | ||
|
||
internals.setPrefersNonBlinkingCursor(false); | ||
output += expect("internals.isCaretBlinkingSuspended(iframe.contentDocument)", "false"); | ||
|
||
debug(output); | ||
finishJSTest(); | ||
} | ||
</script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.