WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch
patch.txt (text/plain), 13.94 KB, created by
chris fleizach
on 2010-07-12 01:10:34 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
chris fleizach
Created:
2010-07-12 01:10:34 PDT
Size:
13.94 KB
patch
obsolete
>Index: WebCore/ChangeLog >=================================================================== >--- WebCore/ChangeLog (revision 63063) >+++ WebCore/ChangeLog (working copy) >@@ -1,3 +1,33 @@ >+2010-07-12 Chris Fleizach <cfleizach@apple.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ AX: aria-checked not recognized on image map radio buttons >+ https://bugs.webkit.org/show_bug.cgi?id=42055 >+ >+ Reorganize intValue() code used for checkboxes and radio boxes so that >+ non-renderer Accessibility objects (like image map links) can benefit. >+ >+ Test: platform/mac/accessibility/image-map-link-used-as-radiobutton.html >+ >+ * accessibility/AccessibilityImageMapLink.h: >+ (WebCore::AccessibilityImageMapLink::node): >+ * accessibility/AccessibilityObject.cpp: >+ (WebCore::AccessibilityObject::intValue): >+ (WebCore::AccessibilityObject::retrieveIntValue): >+ (WebCore::AccessibilityObject::hasIntValue): >+ * accessibility/AccessibilityObject.h: >+ (WebCore::AccessibilityObject::isCheckbox): >+ (WebCore::AccessibilityObject::isRadioButton): >+ (WebCore::AccessibilityObject::isCheckboxOrRadio): >+ (WebCore::AccessibilityObject::node): >+ (WebCore::AccessibilityObject::headingLevel): >+ * accessibility/AccessibilityRenderObject.cpp: >+ (WebCore::AccessibilityRenderObject::isPasswordField): >+ (WebCore::AccessibilityRenderObject::intValue): >+ * accessibility/AccessibilityRenderObject.h: >+ (WebCore::AccessibilityRenderObject::node): >+ > 2010-07-11 Maciej Stachowiak <mjs@apple.com> > > Reviewed by Dan Bernstein. >Index: WebCore/accessibility/AccessibilityImageMapLink.h >=================================================================== >--- WebCore/accessibility/AccessibilityImageMapLink.h (revision 63041) >+++ WebCore/accessibility/AccessibilityImageMapLink.h (working copy) >@@ -49,6 +49,7 @@ > void setHTMLMapElement(HTMLMapElement* element) { m_mapElement = element; } > HTMLMapElement* mapElement() const { return m_mapElement; } > >+ virtual Node* node() const { return m_areaElement; } > void setParent(AccessibilityObject* parent) { m_parent = parent; } > > virtual AccessibilityRole roleValue() const; >Index: WebCore/accessibility/AccessibilityRenderObject.h >=================================================================== >--- WebCore/accessibility/AccessibilityRenderObject.h (revision 63041) >+++ WebCore/accessibility/AccessibilityRenderObject.h (working copy) >@@ -75,7 +75,6 @@ > virtual bool isTextControl() const; > virtual bool isNativeTextControl() const; > virtual bool isWebArea() const; >- virtual bool isCheckboxOrRadio() const; > virtual bool isFileUploadButton() const; > virtual bool isInputImage() const; > virtual bool isProgressIndicator() const; >@@ -112,8 +111,6 @@ > virtual bool canSetValueAttribute() const; > virtual bool canSetExpandedAttribute() const; > >- virtual bool hasIntValue() const; >- > virtual void setAccessibleName(String&); > > // Provides common logic used by all elements when determining isIgnored. >@@ -169,7 +166,7 @@ > > void setRenderer(RenderObject* renderer) { m_renderer = renderer; } > RenderObject* renderer() const { return m_renderer; } >- Node* node() const >+ virtual Node* node() const > { > return m_renderer ? m_renderer->node() : 0; > }; >Index: WebCore/accessibility/AccessibilityObject.h >=================================================================== >--- WebCore/accessibility/AccessibilityObject.h (revision 63041) >+++ WebCore/accessibility/AccessibilityObject.h (working copy) >@@ -264,7 +264,8 @@ > virtual bool isTextControl() const { return false; } > virtual bool isNativeTextControl() const { return false; } > virtual bool isWebArea() const { return false; } >- virtual bool isCheckboxOrRadio() const { return false; } >+ virtual bool isCheckbox() const { return roleValue() == CheckBoxRole; } >+ virtual bool isRadioButton() const { return roleValue() == RadioButtonRole; } > virtual bool isListBox() const { return roleValue() == ListBoxRole; } > virtual bool isMediaTimeline() const { return false; } > virtual bool isMenuRelated() const { return false; } >@@ -298,6 +299,7 @@ > bool isScrollbar() const { return roleValue() == ScrollBarRole; } > bool isButton() const { return roleValue() == ButtonRole; } > bool isListItem() const { return roleValue() == ListItemRole; } >+ bool isCheckboxOrRadio() const { return isCheckbox() || isRadioButton(); } > > virtual bool isChecked() const { return false; } > virtual bool isEnabled() const { return false; } >@@ -325,16 +327,18 @@ > virtual bool canSetSelectedChildrenAttribute() const { return false; } > virtual bool canSetExpandedAttribute() const { return false; } > >- virtual bool hasIntValue() const { return false; } >- >+ bool hasIntValue() const; >+ void retrieveIntValue(int& result) const; >+ virtual int intValue() const; >+ > // A programmatic way to set a name on an AccessibleObject. > virtual void setAccessibleName(String&) { } > >+ virtual Node* node() const { return 0; } > bool accessibilityShouldUseUniqueId() const { return true; } > virtual bool accessibilityIsIgnored() const { return true; } > > virtual int headingLevel() const { return 0; } >- virtual int intValue() const { return 0; } > virtual String valueDescription() const { return String(); } > virtual float valueForRange() const { return 0.0f; } > virtual float maxValueForRange() const { return 0.0f; } >Index: WebCore/accessibility/AccessibilityObject.cpp >=================================================================== >--- WebCore/accessibility/AccessibilityObject.cpp (revision 63041) >+++ WebCore/accessibility/AccessibilityObject.cpp (working copy) >@@ -980,6 +980,43 @@ > const AtomicString& liveRegion = ariaLiveRegionStatus(); > return equalIgnoringCase(liveRegion, "polite") || equalIgnoringCase(liveRegion, "assertive"); > } >+ >+int AccessibilityObject::intValue() const >+{ >+ int result = 0; >+ retrieveIntValue(result); >+ return result; >+} > >+void AccessibilityObject::retrieveIntValue(int& result) const >+{ >+ if (isPasswordField()) >+ return; > >+ if (isHeading()) { >+ result = headingLevel(); >+ return; >+ } >+ >+ // If this is an ARIA checkbox or radio, check the aria-checked attribute rather than node()->checked() >+ if (isCheckboxOrRadio()) { >+ const AtomicString& checked = getAttribute(node(), aria_checkedAttr); >+ if (equalIgnoringCase(checked, "true")) >+ result = 1; >+ else if (equalIgnoringCase(checked, "false")) >+ result = 0; >+ } >+} >+ >+bool AccessibilityObject::hasIntValue() const >+{ >+ if (isHeading()) >+ return true; >+ >+ if (isCheckboxOrRadio()) >+ return true; >+ >+ return false; >+} >+ > } // namespace WebCore >Index: WebCore/accessibility/AccessibilityRenderObject.cpp >=================================================================== >--- WebCore/accessibility/AccessibilityRenderObject.cpp (revision 63041) >+++ WebCore/accessibility/AccessibilityRenderObject.cpp (working copy) >@@ -476,12 +476,6 @@ > > return inputElement->isPasswordField(); > } >- >-bool AccessibilityRenderObject::isCheckboxOrRadio() const >-{ >- AccessibilityRole role = roleValue(); >- return role == RadioButtonRole || role == CheckBoxRole; >-} > > bool AccessibilityRenderObject::isFileUploadButton() const > { >@@ -1030,38 +1024,19 @@ > return String(); > } > >-bool AccessibilityRenderObject::hasIntValue() const >-{ >- if (isHeading()) >- return true; >- >- if (m_renderer->node() && isCheckboxOrRadio()) >- return true; >- >- return false; >-} >- > int AccessibilityRenderObject::intValue() const > { >- if (!m_renderer || isPasswordField()) >- return 0; >+ int result = -1; >+ AccessibilityObject::retrieveIntValue(result); > >- if (isHeading()) >- return headingLevel(); >+ if (result != -1) >+ return result; > >- Node* node = m_renderer->node(); >- if (!node || !isCheckboxOrRadio()) >- return 0; >- >- // If this is an ARIA checkbox or radio, check the aria-checked attribute rather than node()->checked() >- AccessibilityRole ariaRole = ariaRoleAttribute(); >- if (ariaRole == RadioButtonRole || ariaRole == CheckBoxRole) { >- if (equalIgnoringCase(getAttribute(aria_checkedAttr).string(), "true")) >- return true; >- return false; >- } >+ Node* elementNode = node(); >+ if (elementNode && elementNode->hasTagName(inputTag)) >+ return static_cast<HTMLInputElement*>(elementNode)->checked(); > >- return static_cast<HTMLInputElement*>(node)->checked(); >+ return 0; > } > > String AccessibilityRenderObject::valueDescription() const >Index: LayoutTests/platform/mac/accessibility/image-map-link-used-as-radiobutton-expected.txt >=================================================================== >--- LayoutTests/platform/mac/accessibility/image-map-link-used-as-radiobutton-expected.txt (revision 0) >+++ LayoutTests/platform/mac/accessibility/image-map-link-used-as-radiobutton-expected.txt (revision 0) >@@ -0,0 +1,15 @@ >+Paper Color: >+ >+This tests that an image map link can be made into a radio button with aria and have the right AXValue when aria-checked is used. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS accessibilityController.focusedElement.stringValue is 'AXValue: 1' >+PASS accessibilityController.focusedElement.role is 'AXRole: AXRadioButton' >+PASS accessibilityController.focusedElement.stringValue is 'AXValue: 0' >+PASS accessibilityController.focusedElement.role is 'AXRole: AXRadioButton' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/platform/mac/accessibility/image-map-link-used-as-radiobutton.html >=================================================================== >--- LayoutTests/platform/mac/accessibility/image-map-link-used-as-radiobutton.html (revision 0) >+++ LayoutTests/platform/mac/accessibility/image-map-link-used-as-radiobutton.html (revision 0) >@@ -0,0 +1,46 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css"> >+<script src="../../../fast/js/resources/js-test-pre.js"></script> >+<script> >+var successfullyParsed = false; >+if (window.layoutTestController) >+ layoutTestController.dumpAsText(); >+</script> >+</head> >+<body> >+ >+<div id="papercolor" class="label">Paper Color:</div> >+<img src="resources/cake.png" usemap="#backsidemap" id="backImg" alt="" width="225" height="206"> >+<map name="backsidemap" aria-labelledby="papercolor" role="radiogroup"> >+ <area role="radio" shape="rect" tabindex="0" alt="yellow" href="#" aria-checked="true" coords="19,28,46,52" id="yellow"> >+ <area role="radio" shape="rect" tabindex="0" alt="orange" href="#" aria-checked="false" coords="58,28,85,52" id="orange"> >+</map> >+ >+ >+<p id="description"></p> >+<div id="console"></div> >+ >+<script> >+ >+ description("This tests that an image map link can be made into a radio button with aria and have the right AXValue when aria-checked is used."); >+ >+ if (window.accessibilityController) { >+ document.getElementById("yellow").focus(); >+ shouldBe("accessibilityController.focusedElement.stringValue", "'AXValue: 1'"); >+ shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXRadioButton'"); >+ >+ document.getElementById("orange").focus(); >+ shouldBe("accessibilityController.focusedElement.stringValue", "'AXValue: 0'"); >+ shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXRadioButton'"); >+ } >+ >+ successfullyParsed = true; >+</script> >+ >+<script src="../../../fast/js/resources/js-test-post.js"></script> >+ >+</body> >+</html> >+ >Index: LayoutTests/accessibility/aria-checkbox-checked-expected.txt >=================================================================== >--- LayoutTests/accessibility/aria-checkbox-checked-expected.txt (revision 63041) >+++ LayoutTests/accessibility/aria-checkbox-checked-expected.txt (working copy) >@@ -12,9 +12,9 @@ > PASS checkbox.isChecked is false > PASS checkbox.isChecked is true > PASS checkbox.isChecked is false >-PASS checkbox.isChecked is true > PASS checkbox.isChecked is false > PASS checkbox.isChecked is true >+PASS checkbox.isChecked is true > PASS successfullyParsed is true > > TEST COMPLETE >Index: LayoutTests/accessibility/aria-checkbox-checked.html >=================================================================== >--- LayoutTests/accessibility/aria-checkbox-checked.html (revision 63041) >+++ LayoutTests/accessibility/aria-checkbox-checked.html (working copy) >@@ -34,8 +34,8 @@ > [ "check3", "false" ], > [ "check4", "true" ], > [ "check5", "false" ], >- [ "check6", "true" ], >- [ "check7", "false" ], >+ [ "check6", "false" ], >+ [ "check7", "true" ], > [ "check8", "true" ]]; > > for (var i = 0; i < answers.length; i++) { >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 63063) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2010-07-12 Chris Fleizach <cfleizach@apple.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ AX: aria-checked not recognized on image map radio buttons >+ https://bugs.webkit.org/show_bug.cgi?id=42055 >+ >+ * accessibility/aria-checkbox-checked-expected.txt: >+ * accessibility/aria-checkbox-checked.html: >+ Incorrect assumption in layout test. ARIA values should always override native values. >+ >+ * platform/mac/accessibility/image-map-link-used-as-radiobutton-expected.txt: Added. >+ * platform/mac/accessibility/image-map-link-used-as-radiobutton.html: Added. >+ > 2010-07-10 Darin Adler <darin@apple.com> > > Reviewed by Anders Carlsson.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 42055
:
61195
|
61196
|
61336
|
61479