Bug 424304 - "Create Mochitest for bug 417760" [p=marco.zehe@googlemail.com (Marco Zehe) r+sr=mats.palmgren]
authorreed@reedloden.com
Tue, 25 Mar 2008 21:52:30 -0700
changeset 13564 3be7e2ee269f885d3fbd867edff666bb225bdba7
parent 13563 bbf8ba3360eca125397f3bda80c3bdc6753795da
child 13565 6abed41b79718ae57473267fcb1abc9cfc48bd4d
push idunknown
push userunknown
push dateunknown
bugs424304, 417760
milestone1.9b5pre
Bug 424304 - "Create Mochitest for bug 417760" [p=marco.zehe@googlemail.com (Marco Zehe) r+sr=mats.palmgren]
content/html/content/test/Makefile.in
content/html/content/test/file_bug417760.png
content/html/content/test/test_bug417760.html
--- a/content/html/content/test/Makefile.in
+++ b/content/html/content/test/Makefile.in
@@ -102,12 +102,14 @@ include $(topsrcdir)/config/rules.mk
 		test_bug391994.html \
 		test_bug392567.html \
 		bug392567.jar       \
 		bug392567.jar^headers^ \
 		test_bug394700.html \
 		test_bug395107.html \
 		test_bug401160.xhtml \
 		test_bug408231.html \
+		test_bug417760.html \
+		file_bug417760.png \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
new file mode 100644
index 0000000000000000000000000000000000000000..cb0ba06dc10ec2d7adeb38c53b174a66781930f9
GIT binary patch
literal 2220
zc%0={{WsKG7e6y*h8RpzW(eP5ki1V_d8y_*j4l}wNl3;Ji5sGLCYqThl7!HTk(l1p
zt!un1buUxoC5k59qKDQKg<ia*=Tdsk^S#~Q?>}(QTKjy~IeYE>*?X^j_Btp1w*9E7
zuCERN(Dd@;_+uE1iMg5zwwK5{Phzkv(K9$10F4!Y3JyrmQ?W}z4BLkdKy6<7*X>2v
z8Hx1t_W?j)27pKcz#_zO5`aVY08H@!a47*mFQG8JV+#N(z>mAb1G9k;E-fuBE-uc`
z&reTJPfbmYjg5_rj68q-T&Yy5s1Q-qjn9v&uCAG#otv4Neey)v+1W)>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!%#qqY@7`G&=>e~gk<m1z7=1p8wL75nvn
z6T;3KGN!9|@M&&*c$91|o2DHEc(sJ`!m@K!?v;Y>5a~JM)lW!@w7Qz+=PRAX8uDV8
eH|cNQHWm2JXLw0#KLujH1mNYdjZ^K$JNADY@K=NY
new file mode 100644
--- /dev/null
+++ b/content/html/content/test/test_bug417760.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=417760
+-->
+<head>
+  <title>cannot focus() img with tabindex="-1"</title>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+  <style type="text/css">
+    img {
+      border: 5px solid white;
+    }
+    img:focus {
+      border: 5px solid black;
+    }
+  </style>
+
+
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+  <script type="text/javascript">
+    function checkFocus(aExpected, aTabIndex)
+    {
+      elemCurr = document.activeElement.getAttribute("id");
+      is(elemCurr, aExpected, "Element with tabIndex " + aTabIndex 
+         + " did not receive focus!");
+    }
+
+    function doTest()
+    {
+      // First, test img with tabindex = 0
+      document.getElementById("img-tabindex-0").focus();
+      checkFocus("img-tabindex-0", 0);
+
+      // now test the img with tabindex = -1
+      document.getElementById("img-tabindex-minus-1").focus();
+      checkFocus("img-tabindex-minus-1", -1);
+
+      // now test the img without tabindex, should NOT receive focus!
+      document.getElementById("img-no-tabindex").focus();
+      checkFocus("img-tabindex-minus-1", null);
+
+      SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addLoadEvent(doTest);
+  </script>
+</head>
+
+<body>
+
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=417760">Mozilla Bug 417760</a>
+  <p id="display"></p>
+  <div id="content" style="display: none"></div>
+  <pre id="test">
+  </pre>
+  <br>img tabindex="0":
+  <img id="img-tabindex-0"
+    src="file_bug417760.png"
+    alt="MoCo logo" tabindex="0"/>
+  <br>img tabindex="-1":
+  <img id="img-tabindex-minus-1"
+    src="file_bug417760.png"
+    alt="MoCo logo" tabindex="-1"/>
+  <br>img without tabindex:
+  <img id="img-no-tabindex"
+    src="file_bug417760.png"
+    alt="MoCo logo"/>
+</body>
+</html>