Diff
Modified: branches/safari-537-branch/LayoutTests/ChangeLog (152662 => 152663)
--- branches/safari-537-branch/LayoutTests/ChangeLog 2013-07-15 23:01:06 UTC (rev 152662)
+++ branches/safari-537-branch/LayoutTests/ChangeLog 2013-07-15 23:04:26 UTC (rev 152663)
@@ -1,5 +1,22 @@
2013-07-15 Lucas Forschler <[email protected]>
+ Merge r152388
+
+ 2013-07-03 Chris Fleizach <[email protected]>
+
+ AX: Items the img aria role aren't inserting an object replacement character
+ https://bugs.webkit.org/show_bug.cgi?id=118259
+
+ Reviewed by Reviewed by Tim Horton.
+
+ * accessibility/non-native-image-crash-expected.txt:
+ * platform/mac/accessibility/aria-image-emits-object-replacement-expected.txt: Added.
+ * platform/mac/accessibility/aria-image-emits-object-replacement.html: Added.
+ * platform/mac/accessibility/img-fallsback-to-title-expected.txt:
+ Update expected tests where role="img" now emits replacement character.
+
+2013-07-15 Lucas Forschler <[email protected]>
+
Merge r152330
2013-07-02 Ruth Fong <[email protected]>
Modified: branches/safari-537-branch/LayoutTests/accessibility/non-native-image-crash-expected.txt (152662 => 152663)
--- branches/safari-537-branch/LayoutTests/accessibility/non-native-image-crash-expected.txt 2013-07-15 23:01:06 UTC (rev 152662)
+++ branches/safari-537-branch/LayoutTests/accessibility/non-native-image-crash-expected.txt 2013-07-15 23:04:26 UTC (rev 152663)
@@ -1,3 +1,4 @@
+
======================== ___][_____ * __/ [___]\ ***====___ \ * \___________] I I ------------/
This tests that a non native image (one created through ARIA) does not cause an assert. Test passes if it does not crash in debug builds
Copied: branches/safari-537-branch/LayoutTests/platform/mac/accessibility/aria-image-emits-object-replacement-expected.txt (from rev 152388, trunk/LayoutTests/platform/mac/accessibility/aria-image-emits-object-replacement-expected.txt) (0 => 152663)
--- branches/safari-537-branch/LayoutTests/platform/mac/accessibility/aria-image-emits-object-replacement-expected.txt (rev 0)
+++ branches/safari-537-branch/LayoutTests/platform/mac/accessibility/aria-image-emits-object-replacement-expected.txt 2013-07-15 23:04:26 UTC (rev 152663)
@@ -0,0 +1,14 @@
+
+This tests ensures that if an ARIA image is used it will emit an object replacement character in a range for string operation.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS text1.textMarkerRangeLength(textMarkerRange) is 5
+Object string for range: a  b
+PASS text1.textMarkerRangeLength(textMarkerRange) is 5
+Object string for range: c  d
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: branches/safari-537-branch/LayoutTests/platform/mac/accessibility/aria-image-emits-object-replacement.html (from rev 152388, trunk/LayoutTests/platform/mac/accessibility/aria-image-emits-object-replacement.html) (0 => 152663)
--- branches/safari-537-branch/LayoutTests/platform/mac/accessibility/aria-image-emits-object-replacement.html (rev 0)
+++ branches/safari-537-branch/LayoutTests/platform/mac/accessibility/aria-image-emits-object-replacement.html 2013-07-15 23:04:26 UTC (rev 152663)
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<script src=""
+
+<div id="content" tabindex="0">
+
+<div id="text1">
+a <div role="img" aria-label="blah" style="background-color: #aaaaaa; width: 100px; height: 100px; display:inline-block;"></div> b
+</div>
+
+<br>
+
+<div id="text2">
+c <img src="" aria-label="blah" style="background-color: #aaaaaa; width: 100px; height: 100px;"> d
+</div>
+
+</div>
+
+<div id="console"></div>
+<script>
+
+description("This tests ensures that if an ARIA image is used it will emit an object replacement character in a range for string operation.")
+
+if (window.testRunner && window.accessibilityController) {
+
+ var text1 = accessibilityController.accessibleElementById("text1");
+ var textMarkerRange = text1.textMarkerRangeForElement(text1);
+ shouldBe("text1.textMarkerRangeLength(textMarkerRange)", "5");
+ debug("Object string for range: " + text1.stringForTextMarkerRange(textMarkerRange));
+
+ var text2 = accessibilityController.accessibleElementById("text2");
+ textMarkerRange = text2.textMarkerRangeForElement(text2);
+ shouldBe("text1.textMarkerRangeLength(textMarkerRange)", "5");
+ debug("Object string for range: " + text2.stringForTextMarkerRange(textMarkerRange));
+
+ document.getElementById("content").style.visibility = 'hidden';
+}
+
+</script>
+
+<script src=""
+</body>
+</html>
Modified: branches/safari-537-branch/LayoutTests/platform/mac/accessibility/img-fallsback-to-title-expected.txt (152662 => 152663)
--- branches/safari-537-branch/LayoutTests/platform/mac/accessibility/img-fallsback-to-title-expected.txt 2013-07-15 23:01:06 UTC (rev 152662)
+++ branches/safari-537-branch/LayoutTests/platform/mac/accessibility/img-fallsback-to-title-expected.txt 2013-07-15 23:04:26 UTC (rev 152663)
@@ -1,6 +1,5 @@
-
+ test
test
-test
This tests that images will fallback to using the title attribute if no other descriptive text is present.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Modified: branches/safari-537-branch/Source/WebCore/ChangeLog (152662 => 152663)
--- branches/safari-537-branch/Source/WebCore/ChangeLog 2013-07-15 23:01:06 UTC (rev 152662)
+++ branches/safari-537-branch/Source/WebCore/ChangeLog 2013-07-15 23:04:26 UTC (rev 152663)
@@ -1,5 +1,26 @@
2013-07-15 Lucas Forschler <[email protected]>
+ Merge r152388
+
+ 2013-07-03 Chris Fleizach <[email protected]>
+
+ AX: Items the img aria role aren't inserting an object replacement character
+ https://bugs.webkit.org/show_bug.cgi?id=118259
+
+ Reviewed by Tim Horton.
+
+ VoiceOver relies on object replacement characters being emitted when asking for selected text.
+ This has worked if a real <img> is used, but if role="img" is used on a <div>, for example,
+ no emission is performed, which leads to missed elements in text.
+
+ Test: platform/mac/accessibility/aria-image-emits-object-replacement.html
+
+ * editing/TextIterator.cpp:
+ (WebCore::isRendererReplacedElement):
+ (WebCore::TextIterator::advance):
+
+2013-07-15 Lucas Forschler <[email protected]>
+
Merge r152345
2013-07-03 Radu Stavila <[email protected]>
Modified: branches/safari-537-branch/Source/WebCore/editing/TextIterator.cpp (152662 => 152663)
--- branches/safari-537-branch/Source/WebCore/editing/TextIterator.cpp 2013-07-15 23:01:06 UTC (rev 152662)
+++ branches/safari-537-branch/Source/WebCore/editing/TextIterator.cpp 2013-07-15 23:04:26 UTC (rev 152663)
@@ -244,6 +244,27 @@
ASSERT(stack.size() == 1 + depthCrossingShadowBoundaries(node));
}
+
+static bool isRendererReplacedElement(RenderObject* renderer)
+{
+ if (!renderer)
+ return false;
+
+ if (renderer->isImage() || renderer->isWidget())
+ return true;
+
+ if (renderer->node() && renderer->node()->isElementNode()) {
+ Element* element = toElement(renderer->node());
+ if (element->isFormControlElement() || element->hasTagName(legendTag)
+ || element->hasTagName(meterTag) || element->hasTagName(progressTag))
+ return true;
+
+ if (equalIgnoringCase(element->getAttribute(roleAttr), "img"))
+ return true;
+ }
+
+ return false;
+}
// --------
@@ -384,12 +405,7 @@
if (!m_handledNode) {
if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) // FIXME: What about CDATA_SECTION_NODE?
m_handledNode = handleTextNode();
- else if (renderer && (renderer->isImage() || renderer->isWidget() ||
- (renderer->node() && renderer->node()->isElementNode() &&
- (toElement(renderer->node())->isFormControlElement()
- || toElement(renderer->node())->hasTagName(legendTag)
- || toElement(renderer->node())->hasTagName(meterTag)
- || toElement(renderer->node())->hasTagName(progressTag)))))
+ else if (isRendererReplacedElement(renderer))
m_handledNode = handleReplacedElement();
else
m_handledNode = handleNonTextNode();