AX: buttons of number type <input> controls are not fully accessible
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2011 15:38:29 +0000 (15:38 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2011 15:38:29 +0000 (15:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70241

Staged commit part 3. Committing the new spin button classes.

Reviewed by Darin Adler.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilitySpinButton.cpp: Added.
(WebCore::AccessibilitySpinButton::create):
(WebCore::AccessibilitySpinButton::AccessibilitySpinButton):
(WebCore::AccessibilitySpinButton::~AccessibilitySpinButton):
(WebCore::AccessibilitySpinButton::incrementButton):
(WebCore::AccessibilitySpinButton::decrementButton):
(WebCore::AccessibilitySpinButton::elementRect):
(WebCore::AccessibilitySpinButton::addChildren):
(WebCore::AccessibilitySpinButton::step):
(WebCore::AccessibilitySpinButtonPart::AccessibilitySpinButtonPart):
(WebCore::AccessibilitySpinButtonPart::create):
(WebCore::AccessibilitySpinButtonPart::elementRect):
(WebCore::AccessibilitySpinButtonPart::press):
* accessibility/AccessibilitySpinButton.h: Added.
(WebCore::AccessibilitySpinButton::setSpinButtonElement):
(WebCore::AccessibilitySpinButton::roleValue):
(WebCore::AccessibilitySpinButton::accessibilityIsIgnored):
(WebCore::AccessibilitySpinButton::isSpinButton):
(WebCore::AccessibilitySpinButtonPart::~AccessibilitySpinButtonPart):
(WebCore::AccessibilitySpinButtonPart::isIncrementor):
(WebCore::AccessibilitySpinButtonPart::setIsIncrementor):
(WebCore::AccessibilitySpinButtonPart::roleValue):
(WebCore::AccessibilitySpinButtonPart::isSpinButtonPart):
(WebCore::AccessibilitySpinButtonPart::accessibilityIsIgnored):
(WebCore::toAccessibilitySpinButton):
(WebCore::toAccessibilitySpinButtonPart):

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

Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/AccessibilitySpinButton.cpp [new file with mode: 0644]
Source/WebCore/accessibility/AccessibilitySpinButton.h [new file with mode: 0644]

index c5b84f5..ea9f2fb 100644 (file)
@@ -410,6 +410,7 @@ SET(WebCore_SOURCES
     accessibility/AccessibilityRenderObject.cpp
     accessibility/AccessibilityScrollbar.cpp
     accessibility/AccessibilityScrollView.cpp
+    accessibility/AccessibilitySpinButton.cpp
     accessibility/AccessibilitySlider.cpp
     accessibility/AccessibilityTable.cpp
     accessibility/AccessibilityTableCell.cpp
index bf07b36..e76a9a8 100644 (file)
@@ -3,6 +3,48 @@
         AX: buttons of number type <input> controls are not fully accessible
         https://bugs.webkit.org/show_bug.cgi?id=70241
 
+        Staged commit part 3. Committing the new spin button classes.
+
+        Reviewed by Darin Adler.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AccessibilitySpinButton.cpp: Added.
+        (WebCore::AccessibilitySpinButton::create):
+        (WebCore::AccessibilitySpinButton::AccessibilitySpinButton):
+        (WebCore::AccessibilitySpinButton::~AccessibilitySpinButton):
+        (WebCore::AccessibilitySpinButton::incrementButton):
+        (WebCore::AccessibilitySpinButton::decrementButton):
+        (WebCore::AccessibilitySpinButton::elementRect):
+        (WebCore::AccessibilitySpinButton::addChildren):
+        (WebCore::AccessibilitySpinButton::step):
+        (WebCore::AccessibilitySpinButtonPart::AccessibilitySpinButtonPart):
+        (WebCore::AccessibilitySpinButtonPart::create):
+        (WebCore::AccessibilitySpinButtonPart::elementRect):
+        (WebCore::AccessibilitySpinButtonPart::press):
+        * accessibility/AccessibilitySpinButton.h: Added.
+        (WebCore::AccessibilitySpinButton::setSpinButtonElement):
+        (WebCore::AccessibilitySpinButton::roleValue):
+        (WebCore::AccessibilitySpinButton::accessibilityIsIgnored):
+        (WebCore::AccessibilitySpinButton::isSpinButton):
+        (WebCore::AccessibilitySpinButtonPart::~AccessibilitySpinButtonPart):
+        (WebCore::AccessibilitySpinButtonPart::isIncrementor):
+        (WebCore::AccessibilitySpinButtonPart::setIsIncrementor):
+        (WebCore::AccessibilitySpinButtonPart::roleValue):
+        (WebCore::AccessibilitySpinButtonPart::isSpinButtonPart):
+        (WebCore::AccessibilitySpinButtonPart::accessibilityIsIgnored):
+        (WebCore::toAccessibilitySpinButton):
+        (WebCore::toAccessibilitySpinButtonPart):
+
+2011-10-18  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: buttons of number type <input> controls are not fully accessible
+        https://bugs.webkit.org/show_bug.cgi?id=70241
+
         Phase 2 of the staged commit.
 
         Reviewed by Darin Adler.
index 96fdf13..2cf292c 100644 (file)
@@ -635,6 +635,8 @@ webcore_sources += \
        Source/WebCore/accessibility/AccessibilityScrollView.h \
        Source/WebCore/accessibility/AccessibilitySlider.cpp \
        Source/WebCore/accessibility/AccessibilitySlider.h \
+       Source/WebCore/accessibility/AccessibilitySpinButton.cpp \
+       Source/WebCore/accessibility/AccessibilitySpinButton.h \
        Source/WebCore/accessibility/AccessibilityTableCell.cpp \
        Source/WebCore/accessibility/AccessibilityTableCell.h \
        Source/WebCore/accessibility/AccessibilityTableColumn.cpp \
index b190c9a..b9e3d12 100644 (file)
             'accessibility/AccessibilityScrollbar.h',
             'accessibility/AccessibilitySlider.cpp',
             'accessibility/AccessibilitySlider.h',
+            'accessibility/AccessibilitySpinButton.cpp',
+            'accessibility/AccessibilitySpinButton.h',
             'accessibility/AccessibilityTable.cpp',
             'accessibility/AccessibilityTable.h',
             'accessibility/AccessibilityTableCell.cpp',
index bd4dd25..5835fa7 100644 (file)
@@ -43,6 +43,7 @@ SOURCES += \
     accessibility/AccessibilityScrollbar.cpp \
     accessibility/AccessibilityScrollView.cpp \
     accessibility/AccessibilitySlider.cpp \    
+    accessibility/AccessibilitySpinButton.cpp \    
     accessibility/AccessibilityARIAGrid.cpp \    
     accessibility/AccessibilityARIAGridCell.cpp \    
     accessibility/AccessibilityARIAGridRow.cpp \    
@@ -1263,6 +1264,7 @@ HEADERS += \
     accessibility/AccessibilityScrollbar.h \
     accessibility/AccessibilityScrollView.h \
     accessibility/AccessibilitySlider.h \
+    accessibility/AccessibilitySpinButton.h \
     accessibility/AccessibilityTableCell.h \
     accessibility/AccessibilityTableColumn.h \
     accessibility/AccessibilityTable.h \
index b07d11f..7446ed4 100755 (executable)
                                RelativePath="..\accessibility\AccessibilitySlider.h"
                                >
                        </File>
+                        <File
+                                RelativePath="..\accessibility\AccessibilitySpinButton.cpp"
+                                >
+                        </File>
+                        <File
+                                RelativePath="..\accessibility\AccessibilitySpinButton.h"
+                                >
                        <File
                                RelativePath="..\accessibility\AccessibilityTable.cpp"
                                >
index ba3b40c..4433372 100644 (file)
                29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29A812470FBB9CA900510293 /* AXObjectCacheMac.mm */; };
                29ACB212143E7128006BCA5F /* AccessibilityMockObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 29ACB211143E7128006BCA5F /* AccessibilityMockObject.h */; };
                29ACB214143E7498006BCA5F /* AccessibilityMockObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29ACB213143E7498006BCA5F /* AccessibilityMockObject.cpp */; };
+               29D7BCF61444AF580070619C /* AccessibilitySpinButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29D7BCF51444AF580070619C /* AccessibilitySpinButton.cpp */; };
+               29D7BCFA1444AF7D0070619C /* AccessibilitySpinButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 29D7BCF91444AF7D0070619C /* AccessibilitySpinButton.h */; };
                2BE8E2C712A589EC00FAD550 /* HTMLMetaCharsetParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BE8E2C612A589EC00FAD550 /* HTMLMetaCharsetParser.h */; };
                2BE8E2C912A58A0100FAD550 /* HTMLMetaCharsetParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BE8E2C812A58A0100FAD550 /* HTMLMetaCharsetParser.cpp */; };
                2D3A0E3613A7D76100E85AF0 /* SVGParsingError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D3A0E3513A7D76100E85AF0 /* SVGParsingError.h */; settings = {ATTRIBUTES = (Private, ); }; };
                29A812470FBB9CA900510293 /* AXObjectCacheMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AXObjectCacheMac.mm; sourceTree = "<group>"; };
                29ACB211143E7128006BCA5F /* AccessibilityMockObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityMockObject.h; sourceTree = "<group>"; };
                29ACB213143E7498006BCA5F /* AccessibilityMockObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMockObject.cpp; sourceTree = "<group>"; };
+               29D7BCF51444AF580070619C /* AccessibilitySpinButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AccessibilitySpinButton.cpp; path = accessibility/AccessibilitySpinButton.cpp; sourceTree = SOURCE_ROOT; };
+               29D7BCF91444AF7D0070619C /* AccessibilitySpinButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySpinButton.h; sourceTree = "<group>"; };
                2BE8E2C612A589EC00FAD550 /* HTMLMetaCharsetParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLMetaCharsetParser.h; path = parser/HTMLMetaCharsetParser.h; sourceTree = "<group>"; };
                2BE8E2C812A58A0100FAD550 /* HTMLMetaCharsetParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLMetaCharsetParser.cpp; path = parser/HTMLMetaCharsetParser.cpp; sourceTree = "<group>"; };
                2D3A0E3513A7D76100E85AF0 /* SVGParsingError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGParsingError.h; sourceTree = "<group>"; };
                                29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */,
                                2981CAA9131822EC00D12F2A /* AccessibilitySlider.cpp */,
                                0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */,
+                               29D7BCF51444AF580070619C /* AccessibilitySpinButton.cpp */,
+                               29D7BCF91444AF7D0070619C /* AccessibilitySpinButton.h */,
                                2981CAAA131822EC00D12F2A /* AccessibilityTable.cpp */,
                                29A8120D0FBB9C1D00510293 /* AccessibilityTable.h */,
                                2981CAAB131822EC00D12F2A /* AccessibilityTableCell.cpp */,
                                31060379143281CD00ABF4BA /* DOMWebKitCSSFilterValue.h in Headers */,
                                3106037B143281CD00ABF4BA /* DOMWebKitCSSFilterValueInternal.h in Headers */,
                                29ACB212143E7128006BCA5F /* AccessibilityMockObject.h in Headers */,
+                               29D7BCFA1444AF7D0070619C /* AccessibilitySpinButton.h in Headers */,
                                9B375EDB14478A0100F3CAE5 /* MicroDataItemList.h in Headers */,
                                49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */,
                                71CCB49D144824AC00C676D6 /* ImageBySizeCache.h in Headers */,
                                310603741432819C00ABF4BA /* JSWebKitCSSFilterValue.cpp in Sources */,
                                3106037A143281CD00ABF4BA /* DOMWebKitCSSFilterValue.mm in Sources */,
                                29ACB214143E7498006BCA5F /* AccessibilityMockObject.cpp in Sources */,
+                               29D7BCF61444AF580070619C /* AccessibilitySpinButton.cpp in Sources */,
                                0F09087F1444FDB200028917 /* ScrollbarTheme.cpp in Sources */,
                                9B375EDA14478A0100F3CAE5 /* MicroDataItemList.cpp in Sources */,
                                49AF2D6C14435D210016A784 /* DisplayRefreshMonitorMac.cpp in Sources */,
diff --git a/Source/WebCore/accessibility/AccessibilitySpinButton.cpp b/Source/WebCore/accessibility/AccessibilitySpinButton.cpp
new file mode 100644 (file)
index 0000000..ff843e9
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "AccessibilitySpinButton.h"
+
+#include "AXObjectCache.h"
+#include "RenderObject.h"
+
+namespace WebCore {
+
+PassRefPtr<AccessibilitySpinButton> AccessibilitySpinButton::create()
+{
+    return adoptRef(new AccessibilitySpinButton);
+}
+    
+AccessibilitySpinButton::AccessibilitySpinButton()
+    : m_spinButtonElement(0)
+{
+}
+
+AccessibilitySpinButton::~AccessibilitySpinButton()
+{
+}
+    
+AccessibilityObject* AccessibilitySpinButton::incrementButton()
+{
+    if (!m_haveChildren)
+        addChildren();
+
+    ASSERT(m_children.size() == 2);
+
+    return m_children[0].get();
+}
+   
+AccessibilityObject* AccessibilitySpinButton::decrementButton()
+{
+    if (!m_haveChildren)
+        addChildren();
+    
+    ASSERT(m_children.size() == 2);
+    
+    return m_children[1].get();    
+}
+    
+LayoutRect AccessibilitySpinButton::elementRect() const
+{
+    ASSERT(m_spinButtonElement);
+    
+    if (!m_spinButtonElement || !m_spinButtonElement->renderer())
+        return LayoutRect();
+    
+    Vector<FloatQuad> quads;
+    m_spinButtonElement->renderer()->absoluteFocusRingQuads(quads);
+
+    return boundingBoxForQuads(m_spinButtonElement->renderer(), quads);
+}
+
+void AccessibilitySpinButton::addChildren()
+{
+    m_haveChildren = true;
+    
+    AccessibilitySpinButtonPart* incrementor = static_cast<AccessibilitySpinButtonPart*>(axObjectCache()->getOrCreate(SpinButtonPartRole));
+    incrementor->setIsIncrementor(true);
+    incrementor->setParent(this);
+    m_children.append(incrementor);
+
+    AccessibilitySpinButtonPart* decrementor = static_cast<AccessibilitySpinButtonPart*>(axObjectCache()->getOrCreate(SpinButtonPartRole));
+    decrementor->setIsIncrementor(false);
+    decrementor->setParent(this);
+    m_children.append(decrementor);
+}
+    
+void AccessibilitySpinButton::step(int amount)
+{
+    ASSERT(m_spinButtonElement);
+    if (!m_spinButtonElement)
+        return;
+    
+    m_spinButtonElement->step(amount);
+}
+
+// AccessibilitySpinButtonPart 
+
+AccessibilitySpinButtonPart::AccessibilitySpinButtonPart()
+{
+}
+    
+PassRefPtr<AccessibilitySpinButtonPart> AccessibilitySpinButtonPart::create()
+{
+    return adoptRef(new AccessibilitySpinButtonPart);
+}
+
+LayoutRect AccessibilitySpinButtonPart::elementRect() const
+{
+    // FIXME: This logic should exist in the render tree or elsewhere, but there is no
+    // relationship that exists that can be queried.
+    
+    LayoutRect parentRect = parentObject()->elementRect();
+    if (m_isIncrementor)
+        parentRect.setHeight(parentRect.height() / 2);
+    else {
+        parentRect.setY(parentRect.y() + parentRect.height() / 2);        
+        parentRect.setHeight(parentRect.height() / 2);        
+    }
+        
+    return parentRect;
+}
+
+bool AccessibilitySpinButtonPart::press() const
+{
+    if (!m_parent || !m_parent->isSpinButton())
+        return false;
+    
+    AccessibilitySpinButton* spinButton = toAccessibilitySpinButton(parentObject());
+    if (m_isIncrementor)
+        spinButton->step(1);
+    else
+        spinButton->step(-1);
+    
+    return true;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/accessibility/AccessibilitySpinButton.h b/Source/WebCore/accessibility/AccessibilitySpinButton.h
new file mode 100644 (file)
index 0000000..544572c
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AccessibilitySpinButton_h
+#define AccessibilitySpinButton_h
+
+#include "AccessibilityMockObject.h"
+
+#include "TextControlInnerElements.h"
+
+namespace WebCore {
+    
+class AccessibilitySpinButton : public AccessibilityMockObject {
+public:
+    static PassRefPtr<AccessibilitySpinButton> create();
+    virtual ~AccessibilitySpinButton();
+    
+    void setSpinButtonElement(SpinButtonElement* spinButton) { m_spinButtonElement = spinButton; }
+    
+    AccessibilityObject* incrementButton();
+    AccessibilityObject* decrementButton();
+
+    void step(int amount);
+    
+private:
+    AccessibilitySpinButton();
+
+    virtual AccessibilityRole roleValue() const { return SpinButtonRole; }
+    virtual bool accessibilityIsIgnored() const { return false; }
+    virtual bool isSpinButton() const { return true; }
+    virtual void addChildren();
+    virtual LayoutRect elementRect() const;
+    
+    SpinButtonElement* m_spinButtonElement;
+}; 
+   
+class AccessibilitySpinButtonPart : public AccessibilityMockObject {
+public:
+    static PassRefPtr<AccessibilitySpinButtonPart> create();
+    virtual ~AccessibilitySpinButtonPart() { }
+    
+    bool isIncrementor() const { return m_isIncrementor; }
+    void setIsIncrementor(bool value) { m_isIncrementor = value; }
+    
+private:
+    AccessibilitySpinButtonPart();
+    bool m_isIncrementor : 1;
+    
+    virtual bool press() const;
+    virtual AccessibilityRole roleValue() const { return ButtonRole; }
+    virtual bool isSpinButtonPart() const { return true; }
+    virtual LayoutRect elementRect() const;
+    virtual bool accessibilityIsIgnored() const { return false; }
+};
+    
+inline AccessibilitySpinButton* toAccessibilitySpinButton(AccessibilityObject* object)
+{
+    ASSERT(!object || object->isSpinButton());
+    return static_cast<AccessibilitySpinButton*>(object);
+}
+    
+inline AccessibilitySpinButtonPart* toAccessibilitySpinButtonPart(AccessibilityObject* object)
+{
+    ASSERT(!object || object->isSpinButtonPart());
+    return static_cast<AccessibilitySpinButtonPart*>(object);
+}
+    
+} // namespace WebCore 
+
+#endif // AccessibilitySpinButton_h