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

Unified Diff: LayoutTests/accessibility/name-calc-figure.html

Issue 1301993003: Last few steps of text alternative computation algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rename isSameLayoutBox and fix infinite loop for label wrapped Created 5 years, 4 months 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
Index: LayoutTests/accessibility/name-calc-figure.html
diff --git a/LayoutTests/accessibility/name-calc-figure.html b/LayoutTests/accessibility/name-calc-figure.html
new file mode 100644
index 0000000000000000000000000000000000000000..d43b3a607d352b9d9d618ed21542b22109e23caf
--- /dev/null
+++ b/LayoutTests/accessibility/name-calc-figure.html
@@ -0,0 +1,87 @@
+<!DOCTYPE HTML>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<style>
+.hideAllContainers .container {
+ display: none;
+}
+</style>
+
+<div class="container">
+ <figure id="figure1">
+ <img src="resources/cake.png" alt="cake">
+ </figure>
+</div>
+
+<script>
+test(function(t) {
+ var axFigure1 = accessibilityController.accessibleElementById("figure1");
+ assert_equals(axFigure1.name, "");
+}, "Figure element with no figcaption");
+</script>
+
+<div class="container">
+ <figure id="figure2" title="figure2-title">
+ <img src="resources/cake.png" alt="cake">
+ </figure>
+</div>
+
+<script>
+test(function(t) {
+ var axFigure2 = accessibilityController.accessibleElementById("figure2");
+ assert_equals(axFigure2.name, "figure2-title");
+ assert_equals(axFigure2.nameFrom, "attribute");
+}, "Figure element with no figcaption with title");
+</script>
+
+<div class="container">
+ <figure id="figure3" title="figure3-title">
+ <figcaption>figcaption3</figcaption>
+ <img src="resources/cake.png" alt="cake">
+ </figure>
+</div>
+
+<script>
+test(function(t) {
+ var axFigure3 = accessibilityController.accessibleElementById("figure3");
+ assert_equals(axFigure3.name, "figcaption3");
+ assert_equals(axFigure3.nameFrom, "relatedElement");
+}, "Figure element with figcaption and title");
+</script>
+
+<div class="container">
+ <figure id="figure4" title="figure4-title" aria-label="figure4-aria-label">
+ <figcaption>figcaption4</figcaption>
+ <img src="resources/cake.png" alt="cake">
+ </figure>
+</div>
+
+<script>
+test(function(t) {
+ var axFigure4 = accessibilityController.accessibleElementById("figure4");
+ assert_equals(axFigure4.name, "figure4-aria-label");
+ assert_equals(axFigure4.nameFrom, "attribute");
+}, "Figure element with figcaption, title and aria-label");
+</script>
+
+<div class="container">
+ <figure id="figure5" title="figure5-title" aria-label="figure5-aria-label" aria-labelledby="labelledby5">
+ <figcaption>figcaption5</figcaption>
+ <img src="resources/cake.png" alt="cake">
+ </figure>
+ <span hidden="true" id="labelledby5">figure5-aria-labelledby</span>
+</div>
+
+<script>
+test(function(t) {
+ var axFigure5 = accessibilityController.accessibleElementById("figure5");
+ assert_equals(axFigure5.name, "figure5-aria-labelledby");
+ assert_equals(axFigure5.nameFrom, "relatedElement");
+}, "Figure element with figcaption, title, aria-label and aria-labelledby");
+</script>
+
+<script>
+if (window.testRunner)
+ document.body.className = "hideAllContainers";
+</script>
« no previous file with comments | « no previous file | LayoutTests/accessibility/name-calc-img.html » ('j') | LayoutTests/accessibility/name-calc-img.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698