WebKit Bugzilla
Attachment 345859 Details for
Bug 188071
: AX: nothing returned for various previous text marker APIs from one div/p node to another
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
patch.txt (text/plain), 6.98 KB, created by
Nan Wang
on 2018-07-26 12:54:38 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nan Wang
Created:
2018-07-26 12:54:38 PDT
Size:
6.98 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 234267) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2018-07-26 Nan Wang <n_wang@apple.com> >+ >+ AX: nothing returned for various previous text marker APIs from one div/p node to another >+ https://bugs.webkit.org/show_bug.cgi?id=188071 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ TextIterator is emitting an extra '\n' at the end of the <p> node and there's no >+ corresponding text node in the DOM tree, so we are not able to handle that for >+ text markers. Fixed it by ignoring the extra '\n' and anchor the text marker to >+ the previous child text node. >+ >+ Test: accessibility/mac/text-marker-p-tags.html >+ >+ * accessibility/AXObjectCache.cpp: >+ (WebCore::AXObjectCache::traverseToOffsetInRange): >+ > 2018-07-26 Eric Carlson <eric.carlson@apple.com> > > Switching tabs should not close PiP window >Index: Source/WebCore/accessibility/AXObjectCache.cpp >=================================================================== >--- Source/WebCore/accessibility/AXObjectCache.cpp (revision 234112) >+++ Source/WebCore/accessibility/AXObjectCache.cpp (working copy) >@@ -1694,6 +1694,11 @@ CharacterOffset AXObjectCache::traverseT > currentNode = shadowHost; > continue; > } >+ } else if (previousNode && previousNode->isTextNode() && previousNode->isDescendantOf(currentNode) && currentNode->hasTagName(pTag)) { >+ // TextIterator is emitting an extra newline after the <p> element. We should >+ // ignore that since the extra text node is not in the DOM tree. >+ currentNode = previousNode; >+ continue; > } else if (currentNode != previousNode) { > // We should set the start offset and length for the current node in case this is the last iteration. > lastStartOffset = 1; >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 234112) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,14 @@ >+2018-07-26 Nan Wang <n_wang@apple.com> >+ >+ AX: nothing returned for various previous text marker APIs from one div/p node to another >+ https://bugs.webkit.org/show_bug.cgi?id=188071 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/mac/text-marker-p-tags-expected.txt: Added. >+ * accessibility/mac/text-marker-p-tags.html: Added. >+ * accessibility/mac/text-marker-string-for-document-range-expected.txt: >+ > 2018-07-23 Nan Wang <n_wang@apple.com> > > AX: Press tab to highlight items on a webpage is not working with voiceover enabled >Index: LayoutTests/accessibility/mac/text-marker-p-tags-expected.txt >=================================================================== >--- LayoutTests/accessibility/mac/text-marker-p-tags-expected.txt (nonexistent) >+++ LayoutTests/accessibility/mac/text-marker-p-tags-expected.txt (working copy) >@@ -0,0 +1,21 @@ >+This tests that previous sentence/word/paragraph text marker calls work with p tag elements >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS selectedString is 'Where' >+Previous sentence: Test sentence two >+ >+ >+Previous word: two >+ >+ >+Previous paragraph: Test sentence one. Test sentence two >+ >+ >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Test sentence one. Test sentence two >+ >+Where >Index: LayoutTests/accessibility/mac/text-marker-p-tags.html >=================================================================== >--- LayoutTests/accessibility/mac/text-marker-p-tags.html (nonexistent) >+++ LayoutTests/accessibility/mac/text-marker-p-tags.html (working copy) >@@ -0,0 +1,67 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body id="body"> >+ >+<div> >+<p id="p1">Test sentence one. Test sentence two</p> >+</div> >+<div> >+<p id="p2">Where</p> >+</div> >+ >+<script> >+ >+ description("This tests that previous sentence\/word\/paragraph text marker calls work with p tag elements"); >+ >+ if (window.accessibilityController) { >+ >+ // select text >+ selectText('p2'); >+ var p2 = accessibilityController.accessibleElementById("p2"); >+ var selectedRange = p2.selectedTextMarkerRange(); >+ var selectedString = p2.stringForTextMarkerRange(selectedRange); >+ shouldBe("selectedString", "'Where'"); >+ >+ var startTextMarker = p2.startTextMarkerForTextMarkerRange(selectedRange); >+ var preSentenceStart = p2.previousSentenceStartTextMarkerForTextMarker(startTextMarker); >+ var sentenceRange = p2.textMarkerRangeForMarkers(preSentenceStart, startTextMarker); >+ var sentenceString = p2.stringForTextMarkerRange(sentenceRange); >+ debug("Previous sentence: " + sentenceString); >+ >+ var preWordStart = p2.previousWordStartTextMarkerForTextMarker(startTextMarker); >+ var wordRange = p2.textMarkerRangeForMarkers(preWordStart, startTextMarker); >+ var wordString = p2.stringForTextMarkerRange(wordRange); >+ debug("Previous word: " + wordString); >+ >+ var preParagraphStart = p2.previousParagraphStartTextMarkerForTextMarker(startTextMarker); >+ var paragraphRange = p2.textMarkerRangeForMarkers(preParagraphStart, startTextMarker); >+ var paragraphString = p2.stringForTextMarkerRange(paragraphRange); >+ debug("Previous paragraph: " + paragraphString); >+ } >+ >+ function selectText(node) { >+ node = document.getElementById(node); >+ >+ if (document.body.createTextRange) { >+ const range = document.body.createTextRange(); >+ range.moveToElementText(node); >+ range.select(); >+ } else if (window.getSelection) { >+ const selection = window.getSelection(); >+ const range = document.createRange(); >+ range.selectNodeContents(node); >+ selection.removeAllRanges(); >+ selection.addRange(range); >+ } else { >+ console.warn("Could not select text in node: Unsupported browser."); >+ } >+ } >+ >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/accessibility/mac/text-marker-string-for-document-range-expected.txt >=================================================================== >--- LayoutTests/accessibility/mac/text-marker-string-for-document-range-expected.txt (revision 234112) >+++ LayoutTests/accessibility/mac/text-marker-string-for-document-range-expected.txt (working copy) >@@ -9,9 +9,6 @@ text > This tests that we are getting the correct string for document range if the end visible position has after anchor type. > > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >- >- >- > PASS successfullyParsed is true > > TEST COMPLETE
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 188071
: 345859