[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
cfleizach at apple.com
cfleizach at apple.com
Wed Dec 22 14:20:33 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 77be71ceb96264225b8ab5dd76f1183512df2ba3
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 6 22:09:04 2010 +0000
REGRESSION (r53857): AREA tag with tabindex="-1" displays focus ring after multiple mouse clicks.
https://bugs.webkit.org/show_bug.cgi?id=45832
Reviewed by Beth Dakin.
WebCore:
Test: fast/events/mouse-focus-imagemap.html
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::isKeyboardFocusable):
(WebCore::HTMLAreaElement::isMouseFocusable):
(WebCore::HTMLAreaElement::isFocusable):
(WebCore::HTMLAreaElement::updateFocusAppearance):
* html/HTMLAreaElement.h:
LayoutTests:
* fast/events/mouse-focus-imagemap-expected.txt: Added.
* fast/events/mouse-focus-imagemap.html: Added.
* fast/events/resources/tabindex-focus-blur-all.js:
(testProgrammaticFocus):
* fast/events/tabindex-focus-blur-all-expected.txt:
Update test to reflect that AREA with tabindex=-1 should not be focusable.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3fbe309..a0db19b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-06 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Beth Dakin.
+
+ REGRESSION (r53857): AREA tag with tabindex="-1" displays focus ring after multiple mouse clicks.
+ https://bugs.webkit.org/show_bug.cgi?id=45832
+
+ * fast/events/mouse-focus-imagemap-expected.txt: Added.
+ * fast/events/mouse-focus-imagemap.html: Added.
+ * fast/events/resources/tabindex-focus-blur-all.js:
+ (testProgrammaticFocus):
+ * fast/events/tabindex-focus-blur-all-expected.txt:
+ Update test to reflect that AREA with tabindex=-1 should not be focusable.
+
2010-10-06 Albert J. Wong <ajwong at chromium.org>
[chromium] Unreviewed. Rebaseline layout tests.
diff --git a/LayoutTests/fast/events/mouse-focus-imagemap-expected.txt b/LayoutTests/fast/events/mouse-focus-imagemap-expected.txt
new file mode 100644
index 0000000..84d497f
--- /dev/null
+++ b/LayoutTests/fast/events/mouse-focus-imagemap-expected.txt
@@ -0,0 +1,12 @@
+
+This tests that a link in an image map with tabindex < 0 is not mouse focusable.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.activeElement.id is 'focusable-area'
+PASS document.activeElement.id is 'focusable-area'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/mouse-focus-imagemap.html b/LayoutTests/fast/events/mouse-focus-imagemap.html
new file mode 100644
index 0000000..f1fac56
--- /dev/null
+++ b/LayoutTests/fast/events/mouse-focus-imagemap.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../js/resources/js-test-pre.js"></script>
+<body id="body">
+
+<img id="image" usemap="#map" src="data:image/gif;base64,R0lGODlhAQABAIAAAOTm7AAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width="1000" height="1000" alt="" style="border:1px solid black;">
+<map name="map" id="map">
+
+ <area id="focusable-area" tabindex="0" shape="rect" coords="0,0,500,500" href="#" role="img" title="Example 1">
+ <area id="nonfocusable-area" tabindex="-1" shape="rect" coords="500,500,1000,1000" href="#" role="img" title="Example 2">
+</map>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("This tests that a link in an image map with tabindex < 0 is not mouse focusable.");
+
+ // First try to focus on the <area> that is focusable.
+ eventSender.mouseMoveTo(100, 100);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ shouldBe("document.activeElement.id", "'focusable-area'");
+
+ // Try to focus on the <area> that is NOT focusable. Focus should still remain on focusable-area.
+ eventSender.mouseMoveTo(700, 700);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBe("document.activeElement.id", "'focusable-area'");
+
+ successfullyParsed = true;
+</script>
+
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/resources/tabindex-focus-blur-all.js b/LayoutTests/fast/events/resources/tabindex-focus-blur-all.js
index 3355630..1589e35 100644
--- a/LayoutTests/fast/events/resources/tabindex-focus-blur-all.js
+++ b/LayoutTests/fast/events/resources/tabindex-focus-blur-all.js
@@ -52,7 +52,7 @@ function test()
var homeBase = window.frames[1].document.getElementsByClassName('homebase');
homeBase[0].focus();
- var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatched, and should be 337 / 337 ";
+ var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatched, and should be 331 / 331 ";
resultSummary += (focusCount==blurCount) ? "<span style='color:green'>PASSED</span><br>" : "<span style='color:red'>FAILED</span><br>";
resultSummary += "Total of "+failedTestCount+" focus test(s) failed.";
if (failedTestCount)
@@ -110,6 +110,10 @@ function testProgrammaticFocus(elem)
if (document.defaultView.getComputedStyle(elem).display == "none" && !noDisplayTagNamesWithFocus.find(elem.tagName))
elemThatShouldFocus = null;
+ // AREA elements with tabindex = -1 should not be focusable.
+ if (elem.tabIndex == -1 && elem.tagName == "AREA")
+ elemThatShouldFocus = null;
+
if (tagNamesTransferFocused.find(elem.tagName)) {
elemThatShouldFocus = null;
OKtoFocusOtherElement = true;
diff --git a/LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt b/LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt
index 720f6b7..ecf1276 100644
--- a/LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt
+++ b/LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt
@@ -1,2 +1,2 @@
-333 focus / 333 blur events dispatched, and should be 337 / 337 PASSED
+331 focus / 331 blur events dispatched, and should be 331 / 331 PASSED
Total of 0 focus test(s) failed. PASSED
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a99d1c0..de13397 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-10-06 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Beth Dakin.
+
+ REGRESSION (r53857): AREA tag with tabindex="-1" displays focus ring after multiple mouse clicks.
+ https://bugs.webkit.org/show_bug.cgi?id=45832
+
+ Test: fast/events/mouse-focus-imagemap.html
+
+ * html/HTMLAreaElement.cpp:
+ (WebCore::HTMLAreaElement::isKeyboardFocusable):
+ (WebCore::HTMLAreaElement::isMouseFocusable):
+ (WebCore::HTMLAreaElement::isFocusable):
+ (WebCore::HTMLAreaElement::updateFocusAppearance):
+ * html/HTMLAreaElement.h:
+
2010-10-06 David Hyatt <hyatt at apple.com>
Reviewed by Dan Bernstein.
diff --git a/WebCore/html/HTMLAreaElement.cpp b/WebCore/html/HTMLAreaElement.cpp
index 3547cd9..d808fb1 100644
--- a/WebCore/html/HTMLAreaElement.cpp
+++ b/WebCore/html/HTMLAreaElement.cpp
@@ -174,12 +174,17 @@ HTMLImageElement* HTMLAreaElement::imageElement() const
bool HTMLAreaElement::isKeyboardFocusable(KeyboardEvent*) const
{
- return supportsFocus();
+ return isFocusable();
+}
+
+bool HTMLAreaElement::isMouseFocusable() const
+{
+ return isFocusable();
}
bool HTMLAreaElement::isFocusable() const
{
- return supportsFocus();
+ return supportsFocus() && Element::tabIndex() >= 0;
}
void HTMLAreaElement::dispatchBlurEvent()
@@ -192,6 +197,9 @@ void HTMLAreaElement::dispatchBlurEvent()
void HTMLAreaElement::updateFocusAppearance(bool restorePreviousSelection)
{
+ if (!isFocusable())
+ return;
+
Node* parent = parentNode();
if (!parent || !parent->hasTagName(mapTag))
return;
diff --git a/WebCore/html/HTMLAreaElement.h b/WebCore/html/HTMLAreaElement.h
index 10784c3..42d4198 100644
--- a/WebCore/html/HTMLAreaElement.h
+++ b/WebCore/html/HTMLAreaElement.h
@@ -54,6 +54,7 @@ private:
virtual bool supportsFocus() const;
virtual String target() const;
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
+ virtual bool isMouseFocusable() const;
virtual bool isFocusable() const;
virtual void updateFocusAppearance(bool /*restorePreviousSelection*/);
virtual void dispatchBlurEvent();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list