<https://webkit.org/b/119914> [iOS] Upstream changes to WebCore/accessibility
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Aug 2013 17:31:14 +0000 (17:31 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Aug 2013 17:31:14 +0000 (17:31 +0000)
Reviewed by Darin Adler and Chris Fleizach.

* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::press):
(WebCore::AccessibilityMenuList::isCollapsed):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::headingElementForNode):
(WebCore::AccessibilityObject::actionVerb):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
(WebCore::AccessibilityRenderObject::actionVerb):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154339 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityMenuList.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityTableColumn.cpp
Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

index a938fc7..0b71447 100644 (file)
@@ -1,3 +1,25 @@
+2013-08-20  Daniel Bates  <dabates@apple.com>
+
+        <https://webkit.org/b/119914> [iOS] Upstream changes to WebCore/accessibility
+
+        Reviewed by Darin Adler and Chris Fleizach.
+
+        * accessibility/AccessibilityMenuList.cpp:
+        (WebCore::AccessibilityMenuList::press):
+        (WebCore::AccessibilityMenuList::isCollapsed):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::headingElementForNode):
+        (WebCore::AccessibilityObject::actionVerb):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
+        (WebCore::AccessibilityRenderObject::actionVerb):
+        * accessibility/AccessibilityTableColumn.cpp:
+        (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
+        * accessibility/AccessibilityTableHeaderContainer.cpp:
+        (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+
 2013-08-20  Bruno de Oliveira Abinader  <bruno.d@partner.samsung.com>
 
         [css3-text] Implement CSS3 text-decoration shorthand
index 994a334..46077f9 100644 (file)
@@ -44,12 +44,16 @@ PassRefPtr<AccessibilityMenuList> AccessibilityMenuList::create(RenderMenuList*
 
 bool AccessibilityMenuList::press() const
 {
+#if !PLATFORM(IOS)
     RenderMenuList* menuList = static_cast<RenderMenuList*>(m_renderer);
     if (menuList->popupIsVisible())
         menuList->hidePopup();
     else
         menuList->showPopup();
     return true;
+#else
+    return false;
+#endif
 }
 
 void AccessibilityMenuList::addChildren()
@@ -84,7 +88,11 @@ void AccessibilityMenuList::childrenChanged()
 
 bool AccessibilityMenuList::isCollapsed() const
 {
+#if !PLATFORM(IOS)
     return !static_cast<RenderMenuList*>(m_renderer)->popupIsVisible();
+#else
+    return true;
+#endif
 }
 
 bool AccessibilityMenuList::canSetFocusAttribute() const
index 111a3e4..97fe7ab 100644 (file)
@@ -1225,7 +1225,22 @@ AccessibilityObject* AccessibilityObject::anchorElementForNode(Node* node)
     
     return anchorRenderer->document()->axObjectCache()->getOrCreate(anchorRenderer);
 }
+
+AccessibilityObject* AccessibilityObject::headingElementForNode(Node* node)
+{
+    if (!node)
+        return 0;
+    
+    RenderObject* renderObject = node->renderer();
+    if (!renderObject)
+        return 0;
     
+    AccessibilityObject* axObject = renderObject->document()->axObjectCache()->getOrCreate(renderObject);
+    for (; axObject && axObject->roleValue() != HeadingRole; axObject = axObject->parentObject()) { }
+    
+    return axObject;
+}
+
 void AccessibilityObject::ariaTreeRows(AccessibilityChildrenVector& result)
 {
     AccessibilityChildrenVector axChildren = children();
@@ -1276,6 +1291,7 @@ void AccessibilityObject::ariaTreeItemDisclosedRows(AccessibilityChildrenVector&
 #if HAVE(ACCESSIBILITY)
 const String& AccessibilityObject::actionVerb() const
 {
+#if !PLATFORM(IOS)
     // FIXME: Need to add verbs for select elements.
     DEFINE_STATIC_LOCAL(const String, buttonAction, (AXButtonActionVerb()));
     DEFINE_STATIC_LOCAL(const String, textFieldAction, (AXTextFieldActionVerb()));
@@ -1311,6 +1327,10 @@ const String& AccessibilityObject::actionVerb() const
     default:
         return noAction;
     }
+#else
+    DEFINE_STATIC_LOCAL(const String, noAction, ());
+    return noAction;
+#endif
 }
 #endif
 
index afa1877..125377b 100644 (file)
@@ -617,6 +617,7 @@ public:
     AXID axObjectID() const { return m_id; }
     
     static AccessibilityObject* anchorElementForNode(Node*);
+    static AccessibilityObject* headingElementForNode(Node*);
     virtual Element* anchorElement() const { return 0; }
     virtual Element* actionElement() const { return 0; }
     virtual LayoutRect boundingBoxRect() const { return LayoutRect(); }
@@ -868,6 +869,10 @@ public:
     AccessibilityObjectInclusion accessibilityPlatformIncludesObject() const { return DefaultBehavior; }
 #endif
 
+#if PLATFORM(IOS)
+    int accessibilityPasswordFieldLength();
+#endif
+    
     // allows for an AccessibilityObject to update its render tree or perform
     // other operations update type operations
     void updateBackingStore();
index 4b67f02..e2d9c19 100644 (file)
@@ -1952,7 +1952,7 @@ IntRect AccessibilityRenderObject::boundsForVisiblePositionRange(const VisiblePo
             ourrect = boundingBox;
     }
     
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !PLATFORM(IOS)
     return m_renderer->document()->view()->contentsToScreen(pixelSnappedIntRect(ourrect));
 #else
     return pixelSnappedIntRect(ourrect);
@@ -3143,6 +3143,7 @@ void AccessibilityRenderObject::tabChildren(AccessibilityChildrenVector& result)
     
 const String& AccessibilityRenderObject::actionVerb() const
 {
+#if !PLATFORM(IOS)
     // FIXME: Need to add verbs for select elements.
     DEFINE_STATIC_LOCAL(const String, buttonAction, (AXButtonActionVerb()));
     DEFINE_STATIC_LOCAL(const String, textFieldAction, (AXTextFieldActionVerb()));
@@ -3169,6 +3170,10 @@ const String& AccessibilityRenderObject::actionVerb() const
     default:
         return noAction;
     }
+#else
+    DEFINE_STATIC_LOCAL(const String, noAction, ());
+    return noAction;
+#endif
 }
     
 void AccessibilityRenderObject::setAccessibleName(const AtomicString& name)
index 4d49482..9402d9b 100644 (file)
@@ -157,7 +157,7 @@ bool AccessibilityTableColumn::computeAccessibilityIsIgnored() const
     if (!m_parent)
         return true;
     
-#if PLATFORM(GTK)
+#if PLATFORM(IOS) || PLATFORM(GTK)
     return true;
 #endif
     
index 3e789de..5450c47 100644 (file)
@@ -60,7 +60,7 @@ bool AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored() const
     if (!m_parent)
         return true;
     
-#if PLATFORM(GTK)
+#if PLATFORM(IOS) || PLATFORM(GTK)
     return true;
 #endif
 
index 04367a7..f30adb2 100644 (file)
@@ -50,7 +50,7 @@
 #import "WAKView.h"
 #import "WAKWindow.h"
 #import "WebCoreThread.h"
-#import "visible_units.h"
+#import "VisibleUnits.h"
 
 #import <GraphicsServices/GraphicsServices.h>