Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: third_party/WebKit/LayoutTests/accessibility/css-first-letter-children.html

Issue 2524313002: Fix AXLayoutObject not to add duplicated children for CSS first-letter (Closed)
Patch Set: dmazzoni review Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/accessibility/first-letter-text-transform-causes-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/accessibility/first-letter-text-transform-causes-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698