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

cfleizach at apple.com cfleizach at apple.com
Thu Apr 8 00:54:52 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 21b13c8e501db65f3cfdc7073e6f2cb2b53a06e2
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 5 20:32:37 2010 +0000

    AX: need a way to get the progress of a webpage load
    https://bugs.webkit.org/show_bug.cgi?id=33221
    
    Reviewed by Eric Seidel.
    
    WebCore:
    
    Test: platform/mac/accessibility/estimated-progress.html
    
    * accessibility/AccessibilityObject.h:
    (WebCore::AccessibilityObject::estimatedLoadingProgress):
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::estimatedLoadingProgress):
    * accessibility/AccessibilityRenderObject.h:
    * accessibility/mac/AccessibilityObjectWrapper.mm:
    (-[AccessibilityObjectWrapper accessibilityAttributeNames]):
    (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
    
    LayoutTests:
    
    * platform/mac/accessibility/document-attributes-expected.txt:
    * platform/mac/accessibility/estimated-progress-expected.txt: Added.
    * platform/mac/accessibility/estimated-progress.html: Added.
    * platform/mac/accessibility/frame-with-title-expected.txt:
    * platform/mac/accessibility/frame-with-title.html:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52819 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 877e31d..7f31539 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-05  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Eric Seidel.
+
+        AX: need a way to get the progress of a webpage load
+        https://bugs.webkit.org/show_bug.cgi?id=33221
+
+        * platform/mac/accessibility/document-attributes-expected.txt:
+        * platform/mac/accessibility/estimated-progress-expected.txt: Added.
+        * platform/mac/accessibility/estimated-progress.html: Added.
+        * platform/mac/accessibility/frame-with-title-expected.txt:
+        * platform/mac/accessibility/frame-with-title.html:
+
 2010-01-05  Gustavo Noronha Silva  <gns at gnome.org>
 
         Skipping three new tests.
diff --git a/LayoutTests/platform/mac/accessibility/document-attributes-expected.txt b/LayoutTests/platform/mac/accessibility/document-attributes-expected.txt
index 0932ba7..9ed0512 100644
--- a/LayoutTests/platform/mac/accessibility/document-attributes-expected.txt
+++ b/LayoutTests/platform/mac/accessibility/document-attributes-expected.txt
@@ -22,6 +22,7 @@ AXTopLevelUIElement: <AXWebArea>
 AXLinkUIElements: <array of size 0>
 AXLoaded: 1
 AXLayoutCount: 2
+AXLoadingProgress: 1
 AXURL: LayoutTests/platform/mac/accessibility/document-attributes.html
 
 
diff --git a/LayoutTests/platform/mac/accessibility/estimated-progress-expected.txt b/LayoutTests/platform/mac/accessibility/estimated-progress-expected.txt
new file mode 100644
index 0000000..4b6ebed
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/estimated-progress-expected.txt
@@ -0,0 +1,12 @@
+
+This test makes sure the loading progress of a webpage can be retrieved.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS obj.role is 'AXRole: AXWebArea'
+PASS obj.isAttributeSupported('AXLoadingProgress') is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/estimated-progress.html b/LayoutTests/platform/mac/accessibility/estimated-progress.html
new file mode 100644
index 0000000..313eae2
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/estimated-progress.html
@@ -0,0 +1,33 @@
+<!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">
+
+<img src="resources/cake.png">
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This test makes sure the loading progress of a webpage can be retrieved.");
+
+    if (window.accessibilityController) {
+
+          var obj = accessibilityController.rootElement.childAtIndex(0);
+          shouldBe("obj.role", "'AXRole: AXWebArea'");
+          shouldBe("obj.isAttributeSupported('AXLoadingProgress')", "true");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/accessibility/frame-with-title-expected.txt b/LayoutTests/platform/mac/accessibility/frame-with-title-expected.txt
index 538cfd8..caacc63 100644
--- a/LayoutTests/platform/mac/accessibility/frame-with-title-expected.txt
+++ b/LayoutTests/platform/mac/accessibility/frame-with-title-expected.txt
@@ -1,55 +1,12 @@
-AXRole: AXWebArea
-AXSubrole: (null)
-AXRoleDescription: HTML content
-AXChildren: <array of size 0>
-AXHelp: 
-AXParent: <AXWebArea>
-AXSize: NSSize: {100, 100}
-AXTitle: 
-AXDescription: All Packages
-AXValue: 
-AXFocused: 0
-AXEnabled: 1
-AXWindow: <AXWebArea>
-AXSelectedTextMarkerRange: (null)
-AXStartTextMarker: (null)
-AXEndTextMarker: (null)
-AXVisited: 0
-AXLinkedUIElements: (null)
-AXSelected: 0
-AXBlockQuoteLevel: 0
-AXTopLevelUIElement: <AXWebArea>
-AXLinkUIElements: <array of size 0>
-AXLoaded: 1
-AXLayoutCount: 4
-AXURL: about:blank
+  
+This test makes sure that a frame with a title will use that value instead of the name.
 
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-AXRole: AXWebArea
-AXSubrole: (null)
-AXRoleDescription: HTML content
-AXChildren: <array of size 0>
-AXHelp: 
-AXParent: <AXWebArea>
-AXSize: NSSize: {100, 100}
-AXTitle: 
-AXDescription: packageListFrame
-AXValue: 
-AXFocused: 0
-AXEnabled: 1
-AXWindow: <AXWebArea>
-AXSelectedTextMarkerRange: (null)
-AXStartTextMarker: (null)
-AXEndTextMarker: (null)
-AXVisited: 0
-AXLinkedUIElements: (null)
-AXSelected: 0
-AXBlockQuoteLevel: 0
-AXTopLevelUIElement: <AXWebArea>
-AXLinkUIElements: <array of size 0>
-AXLoaded: 1
-AXLayoutCount: 5
-AXURL: about:blank
 
+PASS accessibilityController.focusedElement.description is 'AXDescription: All Packages'
+PASS accessibilityController.focusedElement.description is 'AXDescription: packageListFrame'
+PASS successfullyParsed is true
+
+TEST COMPLETE
 
-  
diff --git a/LayoutTests/platform/mac/accessibility/frame-with-title.html b/LayoutTests/platform/mac/accessibility/frame-with-title.html
index da64673..c765af8 100644
--- a/LayoutTests/platform/mac/accessibility/frame-with-title.html
+++ b/LayoutTests/platform/mac/accessibility/frame-with-title.html
@@ -1,30 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
 <script>
-    if (window.layoutTestController)
-        layoutTestController.dumpAsText();
+var successfullyParsed = false;
 </script>
-<body>
-    
-    <div id="result"></div>
-    
-    <iframe id="frame1" src="image-map2.html" width=100 height=100 name="packageListFrame" title="All Packages">
-    </iframe>
-
-    <iframe id="frame2" src="image-map2.html" width=100 height=100 name="packageListFrame" >
-    </iframe>
-
-    <script>
-        if (window.accessibilityController) {
-            var result = document.getElementById("result");
-
-            var labeledItem = document.getElementById("frame1");
-            labeledItem.focus();
-            result.innerText += accessibilityController.focusedElement.allAttributes() + "\n\n"; 
-
-            var labeledItem = document.getElementById("frame2");
-            labeledItem.focus();
-            result.innerText += accessibilityController.focusedElement.allAttributes() + "\n\n"; 
-        }
-    </script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<iframe id="frame1" src="image-map2.html" width=100 height=100 name="packageListFrame" title="All Packages">
+</iframe>
+
+<iframe id="frame2" src="image-map2.html" width=100 height=100 name="packageListFrame" >
+</iframe>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This test makes sure that a frame with a title will use that value instead of the name.");
+
+    if (window.accessibilityController) {
+
+          document.getElementById("frame1").focus();
+          shouldBe("accessibilityController.focusedElement.description", "'AXDescription: All Packages'");
+
+          document.getElementById("frame2").focus();
+          shouldBe("accessibilityController.focusedElement.description", "'AXDescription: packageListFrame'");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
 </body>
 </html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f64621c..8aa6b3a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-01-05  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Eric Seidel.
+
+        AX: need a way to get the progress of a webpage load
+        https://bugs.webkit.org/show_bug.cgi?id=33221
+
+        Test: platform/mac/accessibility/estimated-progress.html
+
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::estimatedLoadingProgress):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::estimatedLoadingProgress):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/mac/AccessibilityObjectWrapper.mm:
+        (-[AccessibilityObjectWrapper accessibilityAttributeNames]):
+        (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
+
 2010-01-05  Yael Aharon  <yael.aharon at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index d6b9c88..d46ec86 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -330,6 +330,7 @@ public:
     virtual AccessibilityObject* selectedRadioButton() { return 0; }
     virtual AccessibilityObject* selectedTabItem() { return 0; }    
     virtual int layoutCount() const { return 0; }
+    virtual double estimatedLoadingProgress() const { return 0; }
     static bool isARIAControl(AccessibilityRole);
     static bool isARIAInput(AccessibilityRole);
     virtual bool supportsARIAOwns() const { return false; }
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index efe56a5..63df802 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -53,6 +53,7 @@
 #include "HitTestResult.h"
 #include "LocalizedStrings.h"
 #include "NodeList.h"
+#include "ProgressTracker.h"
 #include "RenderButton.h"
 #include "RenderFieldset.h"
 #include "RenderFileUploadControl.h"
@@ -1573,6 +1574,21 @@ bool AccessibilityRenderObject::isLoaded() const
     return !m_renderer->document()->tokenizer();
 }
 
+double AccessibilityRenderObject::estimatedLoadingProgress() const
+{
+    if (!m_renderer)
+        return 0;
+    
+    if (isLoaded())
+        return 1.0;
+    
+    Page* page = m_renderer->document()->page();
+    if (!page)
+        return 0;
+    
+    return page->progress()->estimatedProgress();
+}
+    
 int AccessibilityRenderObject::layoutCount() const
 {
     if (!m_renderer->isRenderView())
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index 339e18b..6735076 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -125,6 +125,7 @@ public:
     virtual AccessibilityObject* selectedRadioButton();
     virtual AccessibilityObject* selectedTabItem();
     virtual int layoutCount() const;
+    virtual double estimatedLoadingProgress() const;
     
     virtual AccessibilityObject* doAccessibilityHitTest(const IntPoint&) const;
     virtual AccessibilityObject* focusedUIElement() const;
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index 482fe4f..2a5d118 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -148,6 +148,10 @@ using namespace std;
 #define NSAccessibilityARIABusyAttribute @"AXARIABusy"
 #endif
 
+#ifndef NSAccessibilityLoadingProgressAttribute
+#define NSAccessibilityLoadingProgressAttribute @"AXLoadingProgress"
+#endif
+
 #ifdef BUILDING_ON_TIGER
 typedef unsigned NSUInteger;
 #define NSAccessibilityValueDescriptionAttribute @"AXValueDescription"
@@ -717,6 +721,7 @@ static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(VisiblePositi
         [tempArray addObject:@"AXLinkUIElements"];
         [tempArray addObject:@"AXLoaded"];
         [tempArray addObject:@"AXLayoutCount"];
+        [tempArray addObject:NSAccessibilityLoadingProgressAttribute];
         [tempArray addObject:NSAccessibilityURLAttribute];
         webAreaAttrs = [[NSArray alloc] initWithArray:tempArray];
         [tempArray release];
@@ -1427,15 +1432,17 @@ static NSString* roleValueToNSString(AccessibilityRole value)
     
     
     if (m_object->isWebArea()) {
-        if ([attributeName isEqualToString: @"AXLinkUIElements"]) {
+        if ([attributeName isEqualToString:@"AXLinkUIElements"]) {
             AccessibilityObject::AccessibilityChildrenVector links;
             static_cast<AccessibilityRenderObject*>(m_object)->getDocumentLinks(links);
             return convertToNSArray(links);
         }
-        if ([attributeName isEqualToString: @"AXLoaded"])
-            return [NSNumber numberWithBool: m_object->isLoaded()];
-        if ([attributeName isEqualToString: @"AXLayoutCount"])
-            return [NSNumber numberWithInt: m_object->layoutCount()];
+        if ([attributeName isEqualToString:@"AXLoaded"])
+            return [NSNumber numberWithBool:m_object->isLoaded()];
+        if ([attributeName isEqualToString:@"AXLayoutCount"])
+            return [NSNumber numberWithInt:m_object->layoutCount()];
+        if ([attributeName isEqualToString:NSAccessibilityLoadingProgressAttribute])
+            return [NSNumber numberWithDouble:m_object->estimatedLoadingProgress()];
     }
     
     if (m_object->isTextControl()) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list