WebKit Bugzilla
Attachment 339916 Details for
Bug 176615
: AX: VoiceOver iframe scrolling focus jumping bug
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
patch.txt (text/plain), 9.36 KB, created by
Nan Wang
on 2018-05-08 19:25:04 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nan Wang
Created:
2018-05-08 19:25:04 PDT
Size:
9.36 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 231536) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2018-05-08 Nan Wang <n_wang@apple.com> >+ >+ AX: VoiceOver iframe scrolling focus jumping bug >+ https://bugs.webkit.org/show_bug.cgi?id=176615 >+ <rdar://problem/34333067> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Scrolling to make elements visible is not working correctly for elements inside an >+ offscreen iframe. Fixed it by using RenderLayer::scrollRectToVisible() to handle >+ scrolling more properly. >+ >+ Test: accessibility/scroll-to-make-visible-iframe-offscreen.html >+ >+ * accessibility/AccessibilityObject.cpp: >+ (WebCore::AccessibilityObject::scrollToMakeVisible const): >+ > 2018-05-08 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed, rolling out r231486. >Index: Source/WebCore/accessibility/AccessibilityObject.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityObject.cpp (revision 231385) >+++ Source/WebCore/accessibility/AccessibilityObject.cpp (working copy) >@@ -2981,9 +2981,16 @@ void AccessibilityObject::scrollToMakeVi > { > if (dispatchAccessibilityEventWithType(AccessibilityEventType::ScrollIntoView)) > return; >- IntRect objectRect = snappedIntRect(boundingBoxRect()); >- objectRect.setLocation(IntPoint()); >- scrollToMakeVisibleWithSubFocus(objectRect); >+ >+ auto* renderer = this->renderer(); >+ if (isScrollView() && parentObject()) >+ renderer = parentObject()->renderer(); >+ >+ if (renderer && is<RenderElement>(renderer)) { >+ bool insideFixed; >+ LayoutRect absoluteBounds = downcast<RenderElement>(renderer)->absoluteAnchorRect(&insideFixed); >+ renderer->scrollRectToVisible(SelectionRevealMode::Reveal, absoluteBounds, insideFixed, ScrollAlignment::alignCenterIfNotVisible, ScrollAlignment::alignCenterIfNotVisible); >+ } > } > > void AccessibilityObject::scrollToMakeVisibleWithSubFocus(const IntRect& subfocus) const >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 231385) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2018-05-08 Nan Wang <n_wang@apple.com> >+ >+ AX: VoiceOver iframe scrolling focus jumping bug >+ https://bugs.webkit.org/show_bug.cgi?id=176615 >+ <rdar://problem/34333067> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/resources/iframe.html: Added. >+ * accessibility/scroll-to-make-visible-iframe-offscreen-expected.txt: Added. >+ * accessibility/scroll-to-make-visible-iframe-offscreen.html: Added. >+ * platform/win/TestExpectations: >+ > 2018-05-04 Ryan Haddad <ryanhaddad@apple.com> > > Rebaseline tests for iOS after r231359. >Index: LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen-expected.txt >=================================================================== >--- LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen-expected.txt (nonexistent) >+++ LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen-expected.txt (working copy) >@@ -0,0 +1,23 @@ >+This tests that scrolling to make an element visible works properly when there's an iframe off screen. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+5000-pixel box >+ >+ >+PASS window.pageYOffset is 0 >+PASS scrolledYOffset > 0 is true >+PASS frameWindow.pageYOffset >= frameMinYOffset is true >+PASS frameWindow.pageYOffset <= frameMaxYOffset is true >+PASS window.pageYOffset == scrolledYOffset is true >+PASS frameWindow.pageYOffset >= frameMinYOffset is true >+PASS frameWindow.pageYOffset <= frameMaxYOffset is true >+PASS window.pageYOffset is 0 >+PASS window.pageYOffset > 0 is true >+PASS frameWindow.pageYOffset >= frameMinYOffset is true >+PASS frameWindow.pageYOffset <= frameMaxYOffset is true >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen.html >=================================================================== >--- LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen.html (nonexistent) >+++ LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen.html (working copy) >@@ -0,0 +1,98 @@ >+<!DOCTYPE html> >+<head> >+<script src="../resources/js-test.js"></script> >+</head> >+<body> >+ >+<p id="description"></p> >+ >+<div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div> >+ >+<iframe id="frame" src="data:text/html,<body><button id='upper_target'>Upper Target</button><div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div><button id='lower_target'>Lower Target</button></body>"></iframe> >+ >+<br> >+<iframe id="frame2" src="./resources/iframe.html"></iframe> >+ >+<div id="console"></div> >+ >+<script> >+description("This tests that scrolling to make an element visible works properly when there's an iframe off screen."); >+ >+window.jsTestIsAsync = true; >+ >+function runTest() { >+ >+ window.frame = document.getElementById("frame"); >+ window.frameWindow = frame.contentWindow; >+ window.frameDoc = frameWindow.document; >+ >+ var upperTarget = frameDoc.getElementById("upper_target"); >+ var lowerTarget = frameDoc.getElementById("lower_target"); >+ >+ var lowerTargetAccessibleObject; >+ var upperTargetAccessibleObject; >+ if (frameWindow.accessibilityController) { >+ lowerTargetAccessibleObject = frameWindow.accessibilityController.accessibleElementById("lower_target"); >+ upperTargetAccessibleObject = frameWindow.accessibilityController.accessibleElementById("upper_target"); >+ } >+ >+ // Initial state >+ window.scrollTo(0, 0); >+ shouldBeZero("window.pageYOffset"); >+ >+ // Scroll to make lower target visible and check. >+ if (frameWindow.accessibilityController) >+ lowerTargetAccessibleObject.scrollToMakeVisible(); >+ // The iframe should be scrolled into view. >+ window.scrolledYOffset = window.pageYOffset; >+ shouldBeTrue("scrolledYOffset > 0"); >+ // The content inside the iframe should be scrolled into view too >+ window.frameMinYOffset = lowerTarget.offsetTop + lowerTarget.offsetHeight - frameWindow.innerHeight; >+ window.frameMaxYOffset = lowerTarget.offsetTop; >+ shouldBeTrue("frameWindow.pageYOffset >= frameMinYOffset"); >+ shouldBeTrue("frameWindow.pageYOffset <= frameMaxYOffset"); >+ >+ // Scroll to make upper target visible and check. >+ if (frameWindow.accessibilityController) >+ upperTargetAccessibleObject.scrollToMakeVisible(); >+ // The iframe should be visible already >+ shouldBeTrue("window.pageYOffset == scrolledYOffset"); >+ // The content inside the iframe should be scrolled into view too >+ window.frameMinYOffset = upperTarget.offsetTop + upperTarget.offsetHeight - frameWindow.innerHeight; >+ window.frameMaxYOffset = upperTarget.offsetTop; >+ shouldBeTrue("frameWindow.pageYOffset >= frameMinYOffset"); >+ shouldBeTrue("frameWindow.pageYOffset <= frameMaxYOffset"); >+ >+ >+ // Reset and test iframe inside iframe >+ window.scrollTo(0, 0); >+ shouldBeZero("window.pageYOffset"); >+ >+ window.frame = document.getElementById("frame2").contentWindow.document.getElementById("iframe"); >+ window.frameWindow = frame.contentWindow; >+ window.frameDoc = frameWindow.document; >+ var button = frameDoc.getElementById("button"); >+ var buttonAccessibleObject; >+ if (frameWindow.accessibilityController) { >+ buttonAccessibleObject = frameWindow.accessibilityController.accessibleElementById("button"); >+ buttonAccessibleObject.scrollToMakeVisible(); >+ } >+ // The inner iframe should be scrolled into view. >+ shouldBeTrue("window.pageYOffset > 0"); >+ // The content inside the inner iframe should be scrolled into view too >+ window.frameMinYOffset = button.offsetTop + button.offsetHeight - frameWindow.innerHeight; >+ window.frameMaxYOffset = button.offsetTop; >+ shouldBeTrue("frameWindow.pageYOffset >= frameMinYOffset"); >+ shouldBeTrue("frameWindow.pageYOffset <= frameMaxYOffset"); >+ >+ finishJSTest(); >+} >+ >+window.addEventListener("load", function() { >+ setTimeout(runTest, 0); >+}, false); >+ >+</script> >+ >+</body> >+</html> >Index: LayoutTests/accessibility/resources/iframe.html >=================================================================== >--- LayoutTests/accessibility/resources/iframe.html (nonexistent) >+++ LayoutTests/accessibility/resources/iframe.html (working copy) >@@ -0,0 +1,6 @@ >+<html> >+<body> >+<div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div> >+<iframe id="iframe" src="data:text/html,<body><button id='button'>Test Button</button></button></body>"></iframe> >+</body> >+</html> >Index: LayoutTests/platform/win/TestExpectations >=================================================================== >--- LayoutTests/platform/win/TestExpectations (revision 231385) >+++ LayoutTests/platform/win/TestExpectations (working copy) >@@ -1574,6 +1574,7 @@ accessibility/scroll-to-make-visible-ifr > accessibility/scroll-to-make-visible-nested-2.html [ Skip ] > accessibility/scroll-to-make-visible-nested.html [ Skip ] > accessibility/scroll-to-make-visible-with-subfocus.html [ Skip ] >+accessibility/scroll-to-make-visible-iframe-offscreen.html [ Skip ] > > # Apparently missing support for roleDescription on Windows. > accessibility/aria-roledescription.html [ Failure ]
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
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 176615
:
320276
|
339895
|
339911
|
339916
|
339925
|
340008