| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ runSingly=true AccessibilityTextStitchingEnabled=false ] --> | |
| <html> | |
| <head> | |
| <script src="../resources/js-test.js"></script> | |
| <script src="../resources/accessibility-helper.js"></script> | |
| </head> | |
| <style> | |
| body { | |
| font-family: ahem; | |
| -webkit-font-smoothing: none; | |
| } | |
| </style> | |
| <body id="body"> | |
| <div id="content" aria-label="test"> | |
| <summary>a<span>b<div>c</div>d</span>e</summary> | |
| </div> | |
| <p id="description"></p> | |
| <div id="console"></div> | |
| <script> | |
| var output = "This tests that we only insert valid children when building ax tree.\n\n"; | |
| jsTestIsAsync = true; | |
| function valueOccuranceInElementTree(element, value) { | |
| if (!element) | |
| return 0; | |
| var count = 0; | |
| if (element.stringValue == value) | |
| count++; | |
| var childrenCount = element.childrenCount; | |
| for (var k = 0; k < childrenCount; k++) | |
| count += valueOccuranceInElementTree(element.childAtIndex(k), value); | |
| return count; | |
| } | |
| if ("webkitRequestFullScreen" in Element.prototype) { | |
| var content = accessibilityController.accessibleElementById("content"); | |
| var value; | |
| if (accessibilityController.platformName == "atspi") | |
| value = "AXValue: ab<\\n>c<\\n>de<\\n>"; | |
| else | |
| value = "AXValue: d"; | |
| document.body.offsetTop; | |
| var span = document.getElementsByTagName('span')[0]; | |
| var fullscreenChangeEvent = function(event) { | |
| if (document.webkitIsFullScreen) { | |
| setTimeout(function () { | |
| document.webkitCancelFullScreen(); | |
| }, 0) | |
| } else { | |
| output += expect("valueOccuranceInElementTree(content, value)", "1"); | |
| debug(output); | |
| finishJSTest(); | |
| } | |
| }; | |
| document.addEventListener('webkitfullscreenchange', fullscreenChangeEvent); | |
| document.addEventListener('keydown', function () { | |
| span.webkitRequestFullScreen(); | |
| }); | |
| output += expect("valueOccuranceInElementTree(content, value)", "1"); | |
| if (window.eventSender) | |
| eventSender.keyDown('a'); | |
| } | |
| </script> | |
| </body> | |
| </html> |