| Index: third_party/WebKit/LayoutTests/accessibility/css-first-letter-children.html
|
| diff --git a/third_party/WebKit/LayoutTests/accessibility/css-first-letter-children.html b/third_party/WebKit/LayoutTests/accessibility/css-first-letter-children.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7fda0d5ee9eb842617e859cf1e2d61bb3a109679
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/accessibility/css-first-letter-children.html
|
| @@ -0,0 +1,40 @@
|
| +<!DOCTYPE html>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<style>
|
| +p::first-letter {
|
| + font-size: 200%;
|
| +}
|
| +</style>
|
| +<h1 id="heading">Test heading</h1>
|
| +<p id="text">Test text</p>
|
| +<script>
|
| +test(function () {
|
| + if (!window.accessibilityController) {
|
| + assert_unreached("This test requires accessibilityController.");
|
| + return;
|
| + }
|
| +
|
| + // Test an element that gets its own accessible name.
|
| + let element = accessibilityController.accessibleElementById("heading");
|
| + assert_equals(element.name, "Test heading");
|
| +
|
| + function getAccessibilityChildren(element) {
|
| + let children = [];
|
| + let childrenCount = element.childrenCount;
|
| + for (let i = 0; i < childrenCount; i++) {
|
| + let child = element.childAtIndex(i);
|
| + children.push(child);
|
| + child.children = getAccessibilityChildren(child);
|
| + }
|
| + return children;
|
| + }
|
| +
|
| + // Test by concatenating names of all children.
|
| + element = accessibilityController.accessibleElementById("text");
|
| + let children = getAccessibilityChildren(element);
|
| + assert_equals(children.length, 1);
|
| + let name = children.map(e => e.name).join('');
|
| + assert_equals(name, "Test text");
|
| +});
|
| +</script>
|
|
|