[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:15:46 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 8ac8a83cb6b860a34405698698557547ff7fabc8
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 30 02:39:01 2009 +0000

    2009-10-29  Erik Arvidsson  <arv at chromium.org>
    
            Reviewed by Eric Seidel.
    
            Make links mouse focusable only on GTK and QT.
    
            Links are now always mouse focusable on GTK and QT. On other platforms
            the link needs a tabIndex or it needs to be contentEditable.
    
            https://bugs.webkit.org/show_bug.cgi?id=26856
    
            * fast/events/click-focus-anchor-expected.txt:
            * fast/events/click-focus-anchor.html:
            * platform/gtk/fast/events/click-focus-anchor-expected.txt: Added.
            * platform/mac/fast/events/click-focus-anchor-expected.txt: Removed.
            * platform/qt/fast/events/click-focus-anchor-expected.txt: Added.
    2009-10-29  Erik Arvidsson  <arv at chromium.org>
    
            Reviewed by Eric Seidel.
    
            Make links mouse focusable only on GTK and QT.
    
            Links are now always mouse focusable on GTK and QT. On other platforms
            the link needs a tabIndex or it needs to be contentEditable.
    
            https://bugs.webkit.org/show_bug.cgi?id=26856
    
            * html/HTMLAnchorElement.cpp:
            (WebCore::HTMLAnchorElement::isMouseFocusable):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50315 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4d49d6c..3aec027 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-29  Erik Arvidsson  <arv at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Make links mouse focusable only on GTK and QT.
+
+        Links are now always mouse focusable on GTK and QT. On other platforms
+        the link needs a tabIndex or it needs to be contentEditable.
+
+        https://bugs.webkit.org/show_bug.cgi?id=26856
+
+        * fast/events/click-focus-anchor-expected.txt:
+        * fast/events/click-focus-anchor.html:
+        * platform/gtk/fast/events/click-focus-anchor-expected.txt: Added.
+        * platform/mac/fast/events/click-focus-anchor-expected.txt: Removed.
+        * platform/qt/fast/events/click-focus-anchor-expected.txt: Added.
+
 2009-10-29  Jonathan Dixon  <joth at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/events/click-focus-anchor-expected.txt b/LayoutTests/fast/events/click-focus-anchor-expected.txt
index fbd644d..f3c4492 100644
--- a/LayoutTests/fast/events/click-focus-anchor-expected.txt
+++ b/LayoutTests/fast/events/click-focus-anchor-expected.txt
@@ -1,10 +1,10 @@
 This test ensures that we can click to focus an a element. Click on the element below.
 
-Focusable anchor with tab index
-
-Focusable anchor
+The expected result is platform specific. GTK and QT allows all links to be mouse focusable.
 
 Result
 
-PASS
-PASS
+
+a1 received focus (focusable)
+a4 received focus (focusable)
+a5 received focus (focusable)
diff --git a/LayoutTests/fast/events/click-focus-anchor.html b/LayoutTests/fast/events/click-focus-anchor.html
index 6ab64e1..ef8701f 100644
--- a/LayoutTests/fast/events/click-focus-anchor.html
+++ b/LayoutTests/fast/events/click-focus-anchor.html
@@ -7,25 +7,38 @@
 <p>This test ensures that we can click to focus an a element.
 Click on the element below.
 
-<p><a tabindex=0 onfocus="pass('r1')" id=t1>Focusable anchor with tab index</a>
-<p><a onfocus="pass('r2')" id=t2 href="#">Focusable anchor</a>
+<p>The expected result is platform specific. GTK and QT allows all links to be
+mouse focusable.
+
+<div id=test-container>
+<p><a id=a1 tabindex=0 title="focusable">Anchor with tab index</a>
+<p><a id=a2 title="not focusable">Anchor without tab index</a>
+<p><a id=a3 href="#" title="focusable on GTK and QT">Link without tab index</a>
+<p><a id=a4 href="#" tabindex=0 title="focusable">Link with tab index</a>
+<p><a id=a5 href="#" contentEditable title="focusable">Link with contentEditable</a>
+<p contentEditable><a id=a6 href="#" focusable="not focusable">Link inside contentEditable</a>
+</div>
 
 <p>Result
 
-<pre id=r1>FAIL</pre>
-<pre id=r2>FAIL</pre>
+<pre id=out></pre>
 
 <script>
 
-function pass(id)
+function log(s)
 {
-    var el = document.getElementById(id);
-    el.textContent = 'PASS';
+    var el = document.getElementById('out');
+    el.textContent += '\n' + s;
+}
+
+function handleFocus(e)
+{
+    var el = e.target;
+    log(el.id + ' received focus (' + el.title + ')');
 }
 
 if (window.layoutTestController) {
     layoutTestController.dumpAsText();
-    layoutTestController.overridePreference('WebKitTabToLinksPreferenceKey', false);
 }
 
 window.onload = function()
@@ -33,15 +46,16 @@ window.onload = function()
     if (!window.layoutTestController)
         return;
 
-    var aElement = document.getElementById('t1');
-    eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2);
-    eventSender.mouseDown();    
-    eventSender.mouseUp();    
+    for (var i = 1; i <= 6; i++) {
+        var aElement = document.getElementById('a' + i);
+        aElement.onfocus = handleFocus;
+        eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
 
-    aElement = document.getElementById('t2');
-    eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2);
-    eventSender.mouseDown();    
-    eventSender.mouseUp();    
+    var tc = document.getElementById('test-container');
+    tc.parentNode.removeChild(tc);
 };
 
 </script>
diff --git a/LayoutTests/platform/gtk/fast/events/click-focus-anchor-expected.txt b/LayoutTests/platform/gtk/fast/events/click-focus-anchor-expected.txt
new file mode 100644
index 0000000..290a7b3
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/events/click-focus-anchor-expected.txt
@@ -0,0 +1,11 @@
+This test ensures that we can click to focus an a element. Click on the element below.
+
+The expected result is platform specific. GTK and QT allows all links to be mouse focusable.
+
+Result
+
+
+a1 received focus (focusable)
+a3 received focus (focusable on GTK and QT)
+a4 received focus (focusable)
+a5 received focus (focusable)
diff --git a/LayoutTests/platform/mac/fast/events/click-focus-anchor-expected.txt b/LayoutTests/platform/mac/fast/events/click-focus-anchor-expected.txt
deleted file mode 100644
index c934629..0000000
--- a/LayoutTests/platform/mac/fast/events/click-focus-anchor-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-This test ensures that we can click to focus an a element. Click on the element below.
-
-Focusable anchor with tab index
-
-Focusable anchor
-
-Result
-
-PASS
-FAIL
diff --git a/LayoutTests/platform/qt/fast/events/click-focus-anchor-expected.txt b/LayoutTests/platform/qt/fast/events/click-focus-anchor-expected.txt
new file mode 100644
index 0000000..290a7b3
--- /dev/null
+++ b/LayoutTests/platform/qt/fast/events/click-focus-anchor-expected.txt
@@ -0,0 +1,11 @@
+This test ensures that we can click to focus an a element. Click on the element below.
+
+The expected result is platform specific. GTK and QT allows all links to be mouse focusable.
+
+Result
+
+
+a1 received focus (focusable)
+a3 received focus (focusable on GTK and QT)
+a4 received focus (focusable)
+a5 received focus (focusable)
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ff910c3..218b662 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2009-10-29  Erik Arvidsson  <arv at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Make links mouse focusable only on GTK and QT.
+
+        Links are now always mouse focusable on GTK and QT. On other platforms
+        the link needs a tabIndex or it needs to be contentEditable.
+
+        https://bugs.webkit.org/show_bug.cgi?id=26856
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::isMouseFocusable):
+
 2009-10-29  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp
index 968f144..d9cc1f7 100644
--- a/WebCore/html/HTMLAnchorElement.cpp
+++ b/WebCore/html/HTMLAnchorElement.cpp
@@ -69,10 +69,12 @@ bool HTMLAnchorElement::supportsFocus() const
 bool HTMLAnchorElement::isMouseFocusable() const
 {
     // Anchor elements should be mouse focusable, https://bugs.webkit.org/show_bug.cgi?id=26856
-#if PLATFORM(MAC)
+#if !PLATFORM(GTK) && !PLATFORM(QT)
     if (isLink())
-        return false;
+        // Only allow links with tabIndex or contentEditable to be mouse focusable.
+        return HTMLElement::supportsFocus();
 #endif
+
     // Allow tab index etc to control focus.
     return HTMLElement::isMouseFocusable();
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list