Title: [129415] branches/chromium/1271
- Revision
- 129415
- Author
- [email protected]
- Date
- 2012-09-24 14:38:27 -0700 (Mon, 24 Sep 2012)
Log Message
Merge 129036 - AX: A few control types are returning the wrong answer for isReadOnly
https://bugs.webkit.org/show_bug.cgi?id=96735
Reviewed by Chris Fleizach.
Source/WebCore:
All input types should be read-only except ones that
are text fields. The previous logic was marking things like
checkboxes as not read-only.
Tests: platform/chromium/accessibility/readonly.html
platform/mac/accessibility/form-control-value-settable.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isReadOnly):
Tools:
Exposing isReadOnly in an AccessibilityObject to DumpRenderTree.
* DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:
(AccessibilityUIElement::AccessibilityUIElement):
(AccessibilityUIElement::isReadOnlyGetterCallback):
* DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h:
(AccessibilityUIElement):
LayoutTests:
Adds a new test to make sure that readonly is exposed correctly on
all elements.
* platform/chromium/accessibility/readonly-expected.txt: Added.
* platform/chromium/accessibility/readonly.html: Added.
* platform/mac/accessibility/form-control-value-settable-expected.txt: Added.
* platform/mac/accessibility/form-control-value-settable.html: Added.
[email protected]
Review URL: https://codereview.chromium.org/10984006
Modified Paths
Diff
Modified: branches/chromium/1271/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (129414 => 129415)
--- branches/chromium/1271/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2012-09-24 21:35:13 UTC (rev 129414)
+++ branches/chromium/1271/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2012-09-24 21:38:27 UTC (rev 129415)
@@ -634,8 +634,11 @@
if (node->hasTagName(textareaTag))
return static_cast<HTMLTextAreaElement*>(node)->readOnly();
- if (node->hasTagName(inputTag))
- return static_cast<HTMLInputElement*>(node)->readOnly();
+ if (node->hasTagName(inputTag)) {
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
+ if (input->isTextField())
+ return input->readOnly();
+ }
return !node->rendererIsEditable();
}
Modified: branches/chromium/1271/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp (129414 => 129415)
--- branches/chromium/1271/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp 2012-09-24 21:35:13 UTC (rev 129414)
+++ branches/chromium/1271/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp 2012-09-24 21:38:27 UTC (rev 129415)
@@ -348,6 +348,7 @@
bindProperty("isCollapsed", &AccessibilityUIElement::isCollapsedGetterCallback);
bindProperty("hasPopup", &AccessibilityUIElement::hasPopupGetterCallback);
bindProperty("isValid", &AccessibilityUIElement::isValidGetterCallback);
+ bindProperty("isReadOnly", &AccessibilityUIElement::isReadOnlyGetterCallback);
bindProperty("orientation", &AccessibilityUIElement::orientationGetterCallback);
//
@@ -584,6 +585,11 @@
result->set(!accessibilityObject().isDetached());
}
+void AccessibilityUIElement::isReadOnlyGetterCallback(CppVariant* result)
+{
+ result->set(accessibilityObject().isReadOnly());
+}
+
void AccessibilityUIElement::orientationGetterCallback(CppVariant* result)
{
result->set(getOrientation(accessibilityObject()));
Modified: branches/chromium/1271/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h (129414 => 129415)
--- branches/chromium/1271/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h 2012-09-24 21:35:13 UTC (rev 129414)
+++ branches/chromium/1271/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h 2012-09-24 21:38:27 UTC (rev 129415)
@@ -90,6 +90,7 @@
void isCollapsedGetterCallback(CppVariant*);
void hasPopupGetterCallback(CppVariant*);
void isValidGetterCallback(CppVariant*);
+ void isReadOnlyGetterCallback(CppVariant*);
void orientationGetterCallback(CppVariant*);
// Bound methods.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes