2011-09-27 17:29:46 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2017-05-19 23:37:59 +00:00
|
|
|
<script src="../resources/js-test.js"></script>
|
2014-07-04 15:31:57 +00:00
|
|
|
<script src="../resources/accessibility-helper.js"></script>
|
|
|
|
<script>
|
2017-05-19 23:37:59 +00:00
|
|
|
jsTestIsAsync = true;
|
2011-09-27 17:29:46 +00:00
|
|
|
|
|
|
|
function runTest()
|
|
|
|
{
|
|
|
|
description("This tests that deleting an iframe doesn't cause the accessibility cache to be destroyed and recreated.");
|
|
|
|
|
|
|
|
if (window.accessibilityController) {
|
|
|
|
window.root = accessibilityController.rootElement;
|
2014-07-04 15:31:57 +00:00
|
|
|
window.stopElement = accessibilityController.accessibleElementById("stopElement");
|
|
|
|
|
2011-09-27 17:29:46 +00:00
|
|
|
window.body = root.childAtIndex(0);
|
[ATK] [WK2] platform/gtk/accessibility/roles-exposed.html is failing
https://bugs.webkit.org/show_bug.cgi?id=125854
Reviewed by Chris Fleizach.
Tools:
Ensure we don't ever create instances of AccessibilityUIElement
wrapping invalid platform-specific accessibility objects in DRT,
both for consistency with what WKTR does (so we avoid situations
where some tests fail in WK2 and not in WK1) and also to avoid
overlooking tests that might not be checking the right thing.
* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::makeJSAccessibilityUIElement): Return a
nullPtr if the platformUIElement() is not a valid one.
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement::platformUIElement): Added const modifier.
LayoutTests:
Updated tests and expectations to keep them passing after the
change done in DRT, without changing their actual purpose.
* platform/gtk/accessibility/roles-exposed.html: Make sure we
print "AXRole: (no element)" when accessibilityElementByID() does
not return a valid object, not to confuse it with cases where the
returned string for the role is an empty string.
* platform/gtk/accessibility/roles-exposed-expected.txt: Update
test expectations to reflect the "AXRole: (no element)" string
that is now being exposed. Also, replace the (wrongly added) PASS
expectations with FAIL for rowgroups, which are currently not
being exposed for ATK either.
* accessibility/deleting-iframe-destroys-axcache.html: Just
consider the first and third sons of the accessibility object for
the body (instead of the grandsons), so the test can run both in
Mac, where sons and grandsons are exposed, and ATK, where only
sons are exposed (no StaticText objects exposed there).
* accessibility/non-data-table-cell-title-ui-element.html: Use
accessibilityElementById() to get the accessibility object for the
"skip" table header instead of navigating with childAtIndex(),
since the hierarchy is not the same for Mac and ATK based ports.
* platform/mac/accessibility/search-predicate.html: Do not rely on
shouldBe() together with the string "AXRole: " when asking for the
role of objects that should no longer be in the accessibility
tree, and use shouldBeUndefined() instead.
* platform/mac/accessibility/search-when-element-starts-in-table.html: Ditto.
* platform/mac/accessibility/search-predicate-expected.txt: Update
expectations according to the usage of shouldBeUndefined().
* platform/mac/accessibility/search-when-element-starts-in-table-expected.txt: Ditto.
* platform/mac/TestExpectations: Add loading-iframe-updates-axtree.html
here, since it seems not to be returning the expected values for
either the scrollarea and the webarea in the iframe (see bug 126066).
* platform/mac-wk2/TestExpectations: Add search-when-element-starts-in-table.html
here, since it does not return an undefined object in WebKit2 when
the search query should return no results (see bug 125996).
Canonical link: https://commits.webkit.org/144032@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-20 14:12:04 +00:00
|
|
|
window.before = body.childAtIndex(0);
|
2011-09-27 17:29:46 +00:00
|
|
|
window.iframe = body.childAtIndex(1).childAtIndex(0);
|
[ATK] [WK2] platform/gtk/accessibility/roles-exposed.html is failing
https://bugs.webkit.org/show_bug.cgi?id=125854
Reviewed by Chris Fleizach.
Tools:
Ensure we don't ever create instances of AccessibilityUIElement
wrapping invalid platform-specific accessibility objects in DRT,
both for consistency with what WKTR does (so we avoid situations
where some tests fail in WK2 and not in WK1) and also to avoid
overlooking tests that might not be checking the right thing.
* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::makeJSAccessibilityUIElement): Return a
nullPtr if the platformUIElement() is not a valid one.
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement::platformUIElement): Added const modifier.
LayoutTests:
Updated tests and expectations to keep them passing after the
change done in DRT, without changing their actual purpose.
* platform/gtk/accessibility/roles-exposed.html: Make sure we
print "AXRole: (no element)" when accessibilityElementByID() does
not return a valid object, not to confuse it with cases where the
returned string for the role is an empty string.
* platform/gtk/accessibility/roles-exposed-expected.txt: Update
test expectations to reflect the "AXRole: (no element)" string
that is now being exposed. Also, replace the (wrongly added) PASS
expectations with FAIL for rowgroups, which are currently not
being exposed for ATK either.
* accessibility/deleting-iframe-destroys-axcache.html: Just
consider the first and third sons of the accessibility object for
the body (instead of the grandsons), so the test can run both in
Mac, where sons and grandsons are exposed, and ATK, where only
sons are exposed (no StaticText objects exposed there).
* accessibility/non-data-table-cell-title-ui-element.html: Use
accessibilityElementById() to get the accessibility object for the
"skip" table header instead of navigating with childAtIndex(),
since the hierarchy is not the same for Mac and ATK based ports.
* platform/mac/accessibility/search-predicate.html: Do not rely on
shouldBe() together with the string "AXRole: " when asking for the
role of objects that should no longer be in the accessibility
tree, and use shouldBeUndefined() instead.
* platform/mac/accessibility/search-when-element-starts-in-table.html: Ditto.
* platform/mac/accessibility/search-predicate-expected.txt: Update
expectations according to the usage of shouldBeUndefined().
* platform/mac/accessibility/search-when-element-starts-in-table-expected.txt: Ditto.
* platform/mac/TestExpectations: Add loading-iframe-updates-axtree.html
here, since it seems not to be returning the expected values for
either the scrollarea and the webarea in the iframe (see bug 126066).
* platform/mac-wk2/TestExpectations: Add search-when-element-starts-in-table.html
here, since it does not return an undefined object in WebKit2 when
the search query should return no results (see bug 125996).
Canonical link: https://commits.webkit.org/144032@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-20 14:12:04 +00:00
|
|
|
window.after = body.childAtIndex(2);
|
2011-09-27 17:29:46 +00:00
|
|
|
|
|
|
|
window.frameBody = window.iframe.childAtIndex(0);
|
|
|
|
window.frameBodyRole = window.frameBody.role;
|
|
|
|
window.frameGroup = window.frameBody.childAtIndex(0);
|
|
|
|
window.frameGroupRole = window.frameGroup.role;
|
|
|
|
window.frameButton = window.frameGroup.childAtIndex(0);
|
|
|
|
window.frameButtonRole = window.frameButton.role;
|
|
|
|
|
2014-07-04 15:31:57 +00:00
|
|
|
document.getElementById("tree").innerText += "\nBefore:\n";
|
|
|
|
dumpAccessibilityTree(root, stopElement, 0, true);
|
2011-09-27 17:29:46 +00:00
|
|
|
|
|
|
|
// Remove the iframe.
|
|
|
|
document.body.removeChild(document.getElementById("iframe"));
|
|
|
|
|
|
|
|
window.newRoot = accessibilityController.rootElement;
|
|
|
|
window.newBody = newRoot.childAtIndex(0);
|
[ATK] [WK2] platform/gtk/accessibility/roles-exposed.html is failing
https://bugs.webkit.org/show_bug.cgi?id=125854
Reviewed by Chris Fleizach.
Tools:
Ensure we don't ever create instances of AccessibilityUIElement
wrapping invalid platform-specific accessibility objects in DRT,
both for consistency with what WKTR does (so we avoid situations
where some tests fail in WK2 and not in WK1) and also to avoid
overlooking tests that might not be checking the right thing.
* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::makeJSAccessibilityUIElement): Return a
nullPtr if the platformUIElement() is not a valid one.
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement::platformUIElement): Added const modifier.
LayoutTests:
Updated tests and expectations to keep them passing after the
change done in DRT, without changing their actual purpose.
* platform/gtk/accessibility/roles-exposed.html: Make sure we
print "AXRole: (no element)" when accessibilityElementByID() does
not return a valid object, not to confuse it with cases where the
returned string for the role is an empty string.
* platform/gtk/accessibility/roles-exposed-expected.txt: Update
test expectations to reflect the "AXRole: (no element)" string
that is now being exposed. Also, replace the (wrongly added) PASS
expectations with FAIL for rowgroups, which are currently not
being exposed for ATK either.
* accessibility/deleting-iframe-destroys-axcache.html: Just
consider the first and third sons of the accessibility object for
the body (instead of the grandsons), so the test can run both in
Mac, where sons and grandsons are exposed, and ATK, where only
sons are exposed (no StaticText objects exposed there).
* accessibility/non-data-table-cell-title-ui-element.html: Use
accessibilityElementById() to get the accessibility object for the
"skip" table header instead of navigating with childAtIndex(),
since the hierarchy is not the same for Mac and ATK based ports.
* platform/mac/accessibility/search-predicate.html: Do not rely on
shouldBe() together with the string "AXRole: " when asking for the
role of objects that should no longer be in the accessibility
tree, and use shouldBeUndefined() instead.
* platform/mac/accessibility/search-when-element-starts-in-table.html: Ditto.
* platform/mac/accessibility/search-predicate-expected.txt: Update
expectations according to the usage of shouldBeUndefined().
* platform/mac/accessibility/search-when-element-starts-in-table-expected.txt: Ditto.
* platform/mac/TestExpectations: Add loading-iframe-updates-axtree.html
here, since it seems not to be returning the expected values for
either the scrollarea and the webarea in the iframe (see bug 126066).
* platform/mac-wk2/TestExpectations: Add search-when-element-starts-in-table.html
here, since it does not return an undefined object in WebKit2 when
the search query should return no results (see bug 125996).
Canonical link: https://commits.webkit.org/144032@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-20 14:12:04 +00:00
|
|
|
window.newBefore = newBody.childAtIndex(0);
|
|
|
|
window.newAfter = newBody.childAtIndex(1);
|
2011-09-27 17:29:46 +00:00
|
|
|
|
2014-07-04 15:31:57 +00:00
|
|
|
document.getElementById("tree").innerText += "\nAfter:\n";
|
|
|
|
dumpAccessibilityTree(newRoot, stopElement, 0, true);
|
|
|
|
document.getElementById("tree").innerText += "\n";
|
2011-09-27 17:29:46 +00:00
|
|
|
|
|
|
|
// Make sure that the accessibility objects from the iframe's nodes
|
|
|
|
// are now invalid by checking that their role is changed - this
|
|
|
|
// is because they've been deleted.
|
|
|
|
shouldBeFalse("frameBodyRole == frameBody.role");
|
|
|
|
shouldBeFalse("frameGroupRole == frameGroup.role");
|
|
|
|
shouldBeFalse("frameButtonRole == frameButton.role");
|
|
|
|
|
|
|
|
// Make sure that the other nodes are unchanged.
|
|
|
|
shouldBeTrue("root.isEqual(newRoot)");
|
|
|
|
shouldBeTrue("body.isEqual(newBody)");
|
|
|
|
shouldBeTrue("before.isEqual(newBefore)");
|
|
|
|
shouldBeTrue("after.isEqual(newAfter)");
|
|
|
|
}
|
|
|
|
|
2017-05-19 23:37:59 +00:00
|
|
|
finishJSTest();
|
2011-09-27 17:29:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener('load', function() {
|
|
|
|
setTimeout(runTest, 10);
|
|
|
|
}, false);
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<p>Before</p>
|
|
|
|
|
|
|
|
<iframe id="iframe" src="data:text/html,<body><button>Click me</button></body>"></iframe>
|
|
|
|
|
|
|
|
<p>After</p>
|
|
|
|
|
2014-07-04 15:31:57 +00:00
|
|
|
<p id="stopElement">End of test</p>
|
2011-09-27 17:29:46 +00:00
|
|
|
|
|
|
|
<p id="description"></p>
|
2014-07-04 15:31:57 +00:00
|
|
|
<pre id="tree"></pre>
|
2011-09-27 17:29:46 +00:00
|
|
|
<div id="console"></div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|