diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 3ed899d68055e117e45fb3da2465743d0f87bd1f..39cbb7e93e22da4e297a4464c9684bcd50da599c 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2010-08-13 Chris Fleizach + + AX: isNativeCheckbox does not work as advertised + https://bugs.webkit.org/show_bug.cgi?id=43872 + + Re-adding this patch after it was erroneously rolled out. + + * platform/mac/accessibility/native-vs-nonnative-checkboxes-expected.txt: Added. + * platform/mac/accessibility/native-vs-nonnative-checkboxes.html: Added. + 2010-08-11 Zhenyao Mo Reviewed by Dimitri Glazkov. diff --git a/LayoutTests/platform/mac/accessibility/native-vs-nonnative-checkboxes-expected.txt b/LayoutTests/platform/mac/accessibility/native-vs-nonnative-checkboxes-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..55c57f48349ff0aba702cd5f6ee3116d6c57e0ce --- /dev/null +++ b/LayoutTests/platform/mac/accessibility/native-vs-nonnative-checkboxes-expected.txt @@ -0,0 +1,15 @@ +check1 +check2 +check2 +This tests that input types masquerading as checkboxes will use the aria-checked values for its value. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS accessibilityController.focusedElement.intValue is 1 +PASS accessibilityController.focusedElement.intValue is 0 +PASS accessibilityController.focusedElement.intValue is 2 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/platform/mac/accessibility/native-vs-nonnative-checkboxes.html b/LayoutTests/platform/mac/accessibility/native-vs-nonnative-checkboxes.html new file mode 100644 index 0000000000000000000000000000000000000000..e3b65ea428ba131de6cf48f938a8bc896f6f2a5c --- /dev/null +++ b/LayoutTests/platform/mac/accessibility/native-vs-nonnative-checkboxes.html @@ -0,0 +1,44 @@ + + + + + + + + + +check1
+check2
+check2
+ + +

+
+ + + + + + diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 4f69af639893c8cd8bbd2c2d0b5906b53d563d1f..d2995308ba9a6aa6681bf9712e95f812d06ac738 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2010-08-13 Chris Fleizach + + AX: isNativeCheckbox does not work as advertised + https://bugs.webkit.org/show_bug.cgi?id=43872 + + Re-adding this patch after it was erroneously rolled out. + + Test: platform/mac/accessibility/native-vs-nonnative-checkboxes.html + + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::isInputImage): + (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio): + * dom/InputElement.h: + * html/HTMLInputElement.h: + (WebCore::HTMLInputElement::isCheckbox): + 2010-08-13 Sheriff Bot Unreviewed, rolling out r65331. diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp index c4669cdcb6a7a11b74070b985db5bbe0f9f02f1c..6b90b6370c9183bfa4c2b4a24139a12a5b49b3e0 100644 --- a/WebCore/accessibility/AccessibilityRenderObject.cpp +++ b/WebCore/accessibility/AccessibilityRenderObject.cpp @@ -508,8 +508,9 @@ bool AccessibilityRenderObject::isFileUploadButton() const bool AccessibilityRenderObject::isInputImage() const { - if (m_renderer && m_renderer->node() && m_renderer->node()->hasTagName(inputTag)) { - HTMLInputElement* input = static_cast(m_renderer->node()); + Node* elementNode = node(); + if (roleValue() == ButtonRole && elementNode && elementNode->hasTagName(inputTag)) { + HTMLInputElement* input = static_cast(elementNode); return input->inputType() == HTMLInputElement::IMAGE; } @@ -591,8 +592,11 @@ bool AccessibilityRenderObject::isIndeterminate() const bool AccessibilityRenderObject::isNativeCheckboxOrRadio() const { Node* elementNode = node(); - if (elementNode && elementNode->isElementNode()) - return toInputElement(static_cast(elementNode)); + if (elementNode && elementNode->isElementNode()) { + InputElement* input = toInputElement(static_cast(elementNode)); + if (input) + return input->isCheckbox() || input->isRadioButton(); + } return false; } diff --git a/WebCore/dom/InputElement.h b/WebCore/dom/InputElement.h index 14cfda2215c245143637417c78b0a7b6998bee93..56fc99d33f72eab61c9aaf8fc3325709f028cc75 100644 --- a/WebCore/dom/InputElement.h +++ b/WebCore/dom/InputElement.h @@ -43,6 +43,9 @@ public: virtual bool isPasswordField() const = 0; virtual bool isSearchField() const = 0; virtual bool isTextField() const = 0; + virtual bool isRadioButton() const = 0; + virtual bool isCheckbox() const = 0; + virtual bool supportsMaxLength() const = 0; virtual bool hasSpinButton() const { return false; } #if ENABLE(INPUT_SPEECH) diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h index 72ac5894c06355e5fd72a9a8d56ba9d8ff7a5a74..18cbaa4a616080100d18860c7c9b0d312cd90255 100644 --- a/WebCore/html/HTMLInputElement.h +++ b/WebCore/html/HTMLInputElement.h @@ -101,6 +101,7 @@ public: virtual bool isSearchField() const { return m_type == SEARCH; } virtual bool isInputTypeHidden() const { return m_type == HIDDEN; } virtual bool isPasswordField() const { return m_type == PASSWORD; } + virtual bool isCheckbox() const { return m_type == CHECKBOX; } bool isTelephoneField() const { return m_type == TELEPHONE; } bool isNumberField() const { return m_type == NUMBER; } bool isEmailField() const { return m_type == EMAIL; } diff --git a/WebCore/wml/WMLInputElement.h b/WebCore/wml/WMLInputElement.h index fe1ae894993298c7efffd16315217fc54525f5fd..329d8690f7dad7e1bca9d74414ed1d2ff7b148da 100644 --- a/WebCore/wml/WMLInputElement.h +++ b/WebCore/wml/WMLInputElement.h @@ -47,6 +47,7 @@ public: virtual bool isIndeterminate() const { return false; } virtual bool isTextFormControl() const { return true; } virtual bool isRadioButton() const { return false; } + virtual bool isCheckbox() const { return false; } virtual bool isTextField() const { return true; } virtual bool isSearchField() const { return false; } virtual bool isInputTypeHidden() const { return false; }