WebKit Bugzilla
Attachment 343692 Details for
Bug 187076
: AX: [iOS] Remove the ability to set keyboard focus when VoiceOver takes focus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
patch.txt (text/plain), 8.57 KB, created by
Nan Wang
on 2018-06-26 23:08:36 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nan Wang
Created:
2018-06-26 23:08:36 PDT
Size:
8.57 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 233246) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,18 @@ >+2018-06-26 Nan Wang <n_wang@apple.com> >+ >+ AX: [iOS] Remove the ability to set keyboard focus when VoiceOver takes focus >+ https://bugs.webkit.org/show_bug.cgi?id=187076 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We shouldn't set keyboard focus when assistive technology takes focus since >+ this is causing website incompatibility issues by causing focus to be lost. >+ >+ Test: accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html >+ >+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: >+ (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]): >+ > 2018-06-26 Yusuke Suzuki <utatane.tea@gmail.com> > > [JSC] Pass VM& to functions more >Index: Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm >=================================================================== >--- Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (revision 233190) >+++ Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (working copy) >@@ -2063,26 +2063,7 @@ - (void)accessibilityElementDidBecomeFoc > if (![self _prepareAccessibilityCall]) > return; > >- // The focused VoiceOver element might be the text inside a link. >- // In those cases we should focus on the link itself. >- for (AccessibilityObject* object = m_object; object != nil; object = object->parentObject()) { >- if (object->roleValue() == AccessibilityRole::WebArea) >- break; >- >- if (object->canSetFocusAttribute()) { >- // webkit.org/b/162041 Taking focus onto elements inside a details node will cause VO focusing onto random items. >- if ([self detailParentForObject:object]) >- break; >- >- // webkit.org/b/162322 When a dialog is focusable, allowing focusing onto the dialog node will cause VO cursor jumping >- // back and forward while navigating its children. >- if ([object->wrapper() accessibilityIsDialog]) >- break; >- >- object->setFocused(true); >- break; >- } >- } >+ m_object->dispatchAccessibilityEventWithType(AccessibilityEventType::Focus); > } > > - (void)accessibilityModifySelection:(TextGranularity)granularity increase:(BOOL)increase >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 233190) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2018-06-26 Nan Wang <n_wang@apple.com> >+ >+ AX: [iOS] Remove the ability to set keyboard focus when VoiceOver takes focus >+ https://bugs.webkit.org/show_bug.cgi?id=187076 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/ios-simulator/accessibility-focus-do-not-set-focus-expected.txt: Added. >+ * accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html: Added. >+ * accessibility/ios-simulator/dom-focus-fires-on-correct-element-expected.txt: Removed. >+ * accessibility/ios-simulator/dom-focus-fires-on-correct-element.html: Removed. >+ > 2018-06-25 David Fenton <david_fenton@apple.com> > > LayoutTest imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.https.any.worker.html is flaky. >Index: LayoutTests/accessibility/ios-simulator/accessibility-focus-do-not-set-focus-expected.txt >=================================================================== >--- LayoutTests/accessibility/ios-simulator/accessibility-focus-do-not-set-focus-expected.txt (nonexistent) >+++ LayoutTests/accessibility/ios-simulator/accessibility-focus-do-not-set-focus-expected.txt (working copy) >@@ -0,0 +1,12 @@ >+focusable >+This tests that accessibilityElementDidBecomeFocused on elements won't set focus. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+received accessiblefocus event >+PASS link === document.activeElement is false >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html >=================================================================== >--- LayoutTests/accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html (nonexistent) >+++ LayoutTests/accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html (working copy) >@@ -0,0 +1,37 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body id="body"> >+ >+<a id="link" onaccessiblefocus="focusEventCallback()" href="#" tabIndex="0">focusable</a> >+ >+<p id="description"></p> >+<div id="console"></div> >+ >+<script> >+ >+ description("This tests that accessibilityElementDidBecomeFocused on elements won't set focus."); >+ >+ var link = document.getElementById("link"); >+ >+ if (window.accessibilityController) { >+ jsTestIsAsync = true; >+ >+ var linkAX = accessibilityController.accessibleElementById("link"); >+ linkAX.assistiveTechnologySimulatedFocus(); >+ } >+ >+ // Also make sure we dispatch the accessiblefocus event. >+ function focusEventCallback() { >+ debug("received accessiblefocus event"); >+ shouldBeFalse("link === document.activeElement"); >+ finishJSTest(); >+ } >+ >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/accessibility/ios-simulator/dom-focus-fires-on-correct-element-expected.txt >=================================================================== >--- LayoutTests/accessibility/ios-simulator/dom-focus-fires-on-correct-element-expected.txt (revision 233190) >+++ LayoutTests/accessibility/ios-simulator/dom-focus-fires-on-correct-element-expected.txt (nonexistent) >@@ -1,16 +0,0 @@ >-link1 >-heading1 >- >-This tests that accessibilityElementDidBecomeFocused will be propagated to the correct parent and cause DOM focus to fire on the correct elements. >- >-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >- >- >-PASS textInsideLink.description is 'AXLabel: link1' >-PASS accessibilityController.focusedElement.childAtIndex(0).isEqual(textInsideLink) is true >-PASS textInsideHeading.description is 'AXLabel: heading1' >-PASS accessibilityController.focusedElement.childAtIndex(0).isEqual(textInsideHeading) is true >-PASS successfullyParsed is true >- >-TEST COMPLETE >- >Index: LayoutTests/accessibility/ios-simulator/dom-focus-fires-on-correct-element.html >=================================================================== >--- LayoutTests/accessibility/ios-simulator/dom-focus-fires-on-correct-element.html (revision 233190) >+++ LayoutTests/accessibility/ios-simulator/dom-focus-fires-on-correct-element.html (nonexistent) >@@ -1,52 +0,0 @@ >-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >-<html> >-<head> >-<script src="../../resources/js-test-pre.js"></script> >-</head> >-<body id="body"> >- >- >-<a id="link1" href="#">link1</a> >- >-<h1 id="heading1" tabindex=0>heading1</h1> >- >-<p id="description"></p> >-<div id="console"></div> >- >-<script> >- >- description("This tests that accessibilityElementDidBecomeFocused will be propagated to the correct parent and cause DOM focus to fire on the correct elements."); >- >- >- if (window.accessibilityController) { >- >- var body = accessibilityController.rootElement; >- >- // Get access to the text inside the link. >- var textInsideLink = accessibilityController.accessibleElementById("link1").childAtIndex(0); >- shouldBe("textInsideLink.description", "'AXLabel: link1'"); >- >- // Simulate VoiceOver focus onto the element. >- textInsideLink.assistiveTechnologySimulatedFocus(); >- >- // The new focused element should now be the link itself. >- shouldBeTrue("accessibilityController.focusedElement.childAtIndex(0).isEqual(textInsideLink)"); >- >- // Repeat for text inside link inside heading. >- >- // Get access to the text inside the link. >- var textInsideHeading = accessibilityController.accessibleElementById("heading1").childAtIndex(0); >- shouldBe("textInsideHeading.description", "'AXLabel: heading1'"); >- >- // Simulate VoiceOver focus onto the element. >- textInsideHeading.assistiveTechnologySimulatedFocus(); >- >- // The new focused element should now be the link itself. >- shouldBeTrue("accessibilityController.focusedElement.childAtIndex(0).isEqual(textInsideHeading)"); >- } >- >-</script> >- >-<script src="../../resources/js-test-post.js"></script> >-</body> >-</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 187076
:
343670
|
343671
|
343673
| 343692