[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 11:11:27 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 58c01333c48008e5e75952fca3cdd5389d5d6883
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 14 21:10:50 2010 +0000

    WebCore: https://bugs.webkit.org/show_bug.cgi?id=41292
    Set right UserGestureIndicator to indicate whether the NPN_Evaluate allows popup window or not.
    
    Patch by Johnny Ding <jnd at chromium.org> on 2010-07-14
    Reviewed by Adam Barth.
    
    Test: plugins/plugin-initiate-popup-window.html
    
    * bindings/v8/NPV8Object.cpp:
    (_NPN_EvaluateHelper):
    
    LayoutTests: Bug 42117 - AX: Data table heuristics: consider assuming data table for 'zebra-striped' rows
    https://bugs.webkit.org/show_bug.cgi?id=42117
    
    Reviewed by Darin Adler.
    
    * platform/mac/accessibility/table-with-zebra-rows-expected.txt: Added.
    * platform/mac/accessibility/table-with-zebra-rows.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63353 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 76cefeb..339d6b9 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-14  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Bug 42117 - AX: Data table heuristics: consider assuming data table for 'zebra-striped' rows
+        https://bugs.webkit.org/show_bug.cgi?id=42117
+
+        * platform/mac/accessibility/table-with-zebra-rows-expected.txt: Added.
+        * platform/mac/accessibility/table-with-zebra-rows.html: Added.
+
 2010-07-14  Johnny Ding  <jnd at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/LayoutTests/platform/mac/accessibility/table-with-zebra-rows-expected.txt b/LayoutTests/platform/mac/accessibility/table-with-zebra-rows-expected.txt
new file mode 100644
index 0000000..abc9e05
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/table-with-zebra-rows-expected.txt
@@ -0,0 +1,16 @@
+'$scr'	scripting additions folder	Property of class: domain	System Events : Disk-Folder-File Suite	1
+'%doc'	music folder	Property of class: user domain object	System Events : Disk-Folder-File Suite	2
+'µdoc'	music folder	Enumeration	Standard Additions : File Commands	3
+'Æ’hlp'	help	Enumeration	Standard Additions : File Commands	4
+'Æ’hlp'	help folder	Enumeration	Standard Additions : File Commands	5
+'Æ’lib'	shared libraries	Enumeration	Standard Additions : File Commands	6
+This tests that tables with zebra striped rows are exposed as AXTables.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS accessibilityController.focusedElement.role is 'AXRole: AXTable'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/table-with-zebra-rows.html b/LayoutTests/platform/mac/accessibility/table-with-zebra-rows.html
new file mode 100644
index 0000000..799e08b
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/table-with-zebra-rows.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<!-- This table should appear as an AXTable because it has zebra striped rows -->
+<table tabindex=0 id="table1">
+<tr bgcolor="#E0E0E0"><td><tt>'$scr'</tt></td><td><tt>scripting additions folder</tt></td><td>Property of class: domain</td><td>System Events : Disk-Folder-File Suite</td><td align="right">1</td></tr>
+<tr><td><tt>'%doc'</tt></td><td><tt>music folder</tt></td><td>Property of class: user domain object</td><td>System Events : Disk-Folder-File Suite</td><td align="right">2</td></tr>
+<tr bgcolor="#E0E0E0"><td><tt>'µdoc'</tt></td><td><tt>music folder</tt></td><td>Enumeration</td><td>Standard Additions : File Commands</td><td align="right">3</td></tr>
+<tr><td><tt>'ƒhlp'</tt></td><td><tt>help</tt></td><td>Enumeration</td><td>Standard Additions : File Commands</td><td align="right">4</td></tr>
+<tr bgcolor="#E0E0E0"><td><tt>'ƒhlp'</tt></td><td><tt>help folder</tt></td><td>Enumeration</td><td>Standard Additions : File Commands</td><td align="right">5</td></tr>
+<tr><td><tt>'ƒlib'</tt></td><td><tt>shared libraries</tt></td><td>Enumeration</td><td>Standard Additions : File Commands</td><td align="right">6</td></tr>
+</table>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that tables with zebra striped rows are exposed as AXTables.");
+
+    if (window.accessibilityController) {
+
+          document.getElementById("table1").focus();
+          shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXTable'");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f84a46d..48f6a9d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -14,6 +14,18 @@
 
         Reviewed by Darin Adler.
 
+        Bug 42117 - AX: Data table heuristics: consider assuming data table for 'zebra-striped' rows
+        https://bugs.webkit.org/show_bug.cgi?id=42117
+
+        Test: platform/mac/accessibility/table-with-zebra-rows.html
+
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
+
+2010-07-14  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Darin Adler.
+
         AX: VoiceOver cannot navigate this page because Safari is taking too long
         https://bugs.webkit.org/show_bug.cgi?id=42219
 
diff --git a/WebCore/accessibility/AccessibilityTable.cpp b/WebCore/accessibility/AccessibilityTable.cpp
index 437ac38..a0bb655 100644
--- a/WebCore/accessibility/AccessibilityTable.cpp
+++ b/WebCore/accessibility/AccessibilityTable.cpp
@@ -137,6 +137,9 @@ bool AccessibilityTable::isTableExposableThroughAccessibility()
     unsigned borderedCellCount = 0;
     unsigned backgroundDifferenceCellCount = 0;
     
+    Color alternatingRowColors[5];
+    int alternatingRowColorCount = 0;
+    
     int headersInFirstColumnCount = 0;
     for (int row = 0; row < numRows; ++row) {
     
@@ -189,6 +192,19 @@ bool AccessibilityTable::isTableExposableThroughAccessibility()
             // if we've found 10 "good" cells, we don't need to keep searching
             if (borderedCellCount >= 10 || backgroundDifferenceCellCount >= 10)
                 return true;
+            
+            // For the first 5 rows, cache the background color so we can check if this table has zebra-striped rows.
+            if (row < 5 && row == alternatingRowColorCount) {
+                RenderObject* renderRow = cell->parent();
+                if (!renderRow || !renderRow->isTableRow())
+                    continue;
+                RenderStyle* rowRenderStyle = renderRow->style();
+                if (!rowRenderStyle)
+                    continue;
+                Color rowColor = rowRenderStyle->visitedDependentColor(CSSPropertyBackgroundColor);
+                alternatingRowColors[alternatingRowColorCount] = rowColor;
+                alternatingRowColorCount++;
+            }
         }
         
         if (!row && headersInFirstRowCount == numCols && numCols > 1)
@@ -211,6 +227,20 @@ bool AccessibilityTable::isTableExposableThroughAccessibility()
     if (backgroundDifferenceCellCount >= neededCellCount)
         return true;
 
+    // Check if there is an alternating row background color indicating a zebra striped style pattern.
+    if (alternatingRowColorCount > 2) {
+        Color firstColor = alternatingRowColors[0];
+        for (int k = 1; k < alternatingRowColorCount; k++) {
+            // If an odd row was the same color as the first row, its not alternating.
+            if (k % 2 == 1 && alternatingRowColors[k] == firstColor)
+                return false;
+            // If an even row is not the same as the first row, its not alternating.
+            if (!(k % 2) && alternatingRowColors[k] != firstColor)
+                return false;
+        }
+        return true;
+    }
+    
     return false;
 }
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list