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 to test against other bots
patch.txt (text/plain), 22.87 KB, created by
chris fleizach
on 2010-07-14 01:14:03 PDT
(
hide
)
Description:
patch to test against other bots
Filename:
MIME Type:
Creator:
chris fleizach
Created:
2010-07-14 01:14:03 PDT
Size:
22.87 KB
patch
obsolete
>Index: WebCore/ChangeLog >=================================================================== >--- WebCore/ChangeLog (revision 63287) >+++ WebCore/ChangeLog (working copy) >@@ -1,3 +1,56 @@ >+2010-07-14 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 >+ >+ Moves some code from AccessibilityRenderObject to AccessibilityObject so that >+ elements that do not have render objects, but do have Nodes (like image map links >+ and list box options) can still make use of certain aria attributes. >+ >+ Test: platform/mac/accessibility/image-map-link-used-as-radiobutton.html >+ >+ * accessibility/AccessibilityImageMapLink.cpp: >+ (WebCore::AccessibilityImageMapLink::roleValue): >+ (WebCore::AccessibilityImageMapLink::accessibilityDescription): >+ (WebCore::AccessibilityImageMapLink::title): >+ Make imageMap use standard AccessibilityObject methods for getAttribute() >+ * accessibility/AccessibilityImageMapLink.h: >+ (WebCore::AccessibilityImageMapLink::node): >+ * accessibility/AccessibilityListBoxOption.cpp: >+ (WebCore::AccessibilityListBoxOption::accessibilityIsIgnored): >+ (WebCore::AccessibilityListBoxOption::stringValue): >+ * accessibility/AccessibilityListBoxOption.h: >+ (WebCore::AccessibilityListBoxOption::node): >+ * accessibility/AccessibilityObject.cpp: >+ (WebCore::AccessibilityObject::language): >+ Language method doesn't need a node() anymore, it can use the node from AccessibilityObject. >+ (WebCore::renderListItemContainerForNode): >+ (WebCore::AccessibilityObject::getAttribute): >+ (WebCore::AccessibilityObject::intValue): >+ Move intValue into AccessibilityObject. >+ (WebCore::AccessibilityObject::hasIntValue): >+ * accessibility/AccessibilityObject.h: >+ (WebCore::AccessibilityObject::isCheckbox): >+ (WebCore::AccessibilityObject::isRadioButton): >+ (WebCore::AccessibilityObject::isCheckboxOrRadio): >+ Consolidate what defines a checkbox and radio button into AccessibilityObject. >+ (WebCore::AccessibilityObject::node): >+ (WebCore::AccessibilityObject::headingLevel): >+ (WebCore::AccessibilityObject::isDetached): >+ * accessibility/AccessibilityRenderObject.cpp: >+ (WebCore::AccessibilityRenderObject::isPasswordField): >+ (WebCore::AccessibilityRenderObject::headingLevel): >+ (WebCore::AccessibilityRenderObject::selectedTabItem): >+ (WebCore::AccessibilityRenderObject::hierarchicalLevel): >+ (WebCore::AccessibilityRenderObject::node): >+ (WebCore::AccessibilityRenderObject::intValue): >+ * accessibility/AccessibilityRenderObject.h: >+ * rendering/RenderMenuList.cpp: >+ (WebCore::RenderMenuList::itemAccessibilityText): >+ Stop using AccessibilityObjects getAttribute (no reason to use it really). >+ > 2010-07-14 Kent Tamura <tkent@chromium.org> > > Reviewed by Darin Fisher. >Index: WebCore/accessibility/AccessibilityImageMapLink.h >=================================================================== >--- WebCore/accessibility/AccessibilityImageMapLink.h (revision 63285) >+++ 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/AccessibilityObject.h >=================================================================== >--- WebCore/accessibility/AccessibilityObject.h (revision 63285) >+++ 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,17 @@ > virtual bool canSetSelectedChildrenAttribute() const { return false; } > virtual bool canSetExpandedAttribute() const { return false; } > >- virtual bool hasIntValue() const { return false; } >- >+ bool hasIntValue() 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; } >@@ -419,8 +422,7 @@ > virtual Document* document() const { return 0; } > virtual FrameView* topDocumentFrameView() const { return 0; } > virtual FrameView* documentFrameView() const; >- virtual String language() const; >- String language(Node*) const; >+ String language() const; > virtual unsigned hierarchicalLevel() const { return 0; } > > virtual void setFocused(bool) { } >@@ -454,7 +456,8 @@ > virtual void handleAriaExpandedChanged() { } > > static AccessibilityRole ariaRoleToWebCoreRole(const String&); >- static const AtomicString& getAttribute(Node*, const QualifiedName&); >+ const AtomicString& getAttribute(const QualifiedName&) const; >+ const AtomicString& getAttribute(Node*, const QualifiedName&) const; > > virtual VisiblePositionRange visiblePositionRange() const { return VisiblePositionRange(); } > virtual VisiblePositionRange visiblePositionRangeForLine(unsigned) const { return VisiblePositionRange(); } >@@ -564,7 +567,6 @@ > > virtual void clearChildren(); > virtual bool isDetached() const { return true; } >- RenderListItem* renderListItemContainerForNode(Node* node) const; > > #if PLATFORM(MAC) > RetainPtr<AccessibilityObjectWrapper> m_wrapper; >Index: WebCore/accessibility/AccessibilityRenderObject.h >=================================================================== >--- WebCore/accessibility/AccessibilityRenderObject.h (revision 63285) >+++ 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; >@@ -106,14 +105,11 @@ > virtual bool isExpanded() const; > virtual void setIsExpanded(bool); > >- const AtomicString& getAttribute(const QualifiedName&) const; > virtual bool canSetFocusAttribute() const; > virtual bool canSetTextRangeAttributes() const; > 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,10 +165,7 @@ > > void setRenderer(RenderObject* renderer) { m_renderer = renderer; } > RenderObject* renderer() const { return m_renderer; } >- Node* node() const >- { >- return m_renderer ? m_renderer->node() : 0; >- }; >+ virtual Node* node() const; > > RenderView* topRenderer() const; > RenderTextControl* textControl() const; >@@ -283,7 +276,6 @@ > bool isAllowedChildOfTree() const; > bool hasTextAlternative() const; > String positionalDescriptionForMSAA() const; >- virtual String language() const; > > Element* menuElementForMenuButton() const; > Element* menuItemElementForMenu() const; >Index: WebCore/accessibility/AccessibilityListBoxOption.cpp >=================================================================== >--- WebCore/accessibility/AccessibilityListBoxOption.cpp (revision 63285) >+++ WebCore/accessibility/AccessibilityListBoxOption.cpp (working copy) >@@ -110,17 +110,12 @@ > if (!m_optionElement) > return true; > >- if (equalIgnoringCase(getAttribute(m_optionElement, aria_hiddenAttr), "true")) >+ if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true")) > return true; > > return parentObject()->accessibilityIsIgnored(); > } > >-String AccessibilityListBoxOption::language() const >-{ >- return AccessibilityObject::language(m_optionElement); >-} >- > bool AccessibilityListBoxOption::canSetSelectedAttribute() const > { > if (!m_optionElement) >@@ -144,7 +139,7 @@ > if (!m_optionElement) > return String(); > >- const AtomicString& ariaLabel = getAttribute(m_optionElement, aria_labelAttr); >+ const AtomicString& ariaLabel = getAttribute(aria_labelAttr); > if (!ariaLabel.isNull()) > return ariaLabel; > >Index: WebCore/accessibility/AccessibilityImageMapLink.cpp >=================================================================== >--- WebCore/accessibility/AccessibilityImageMapLink.cpp (revision 63285) >+++ WebCore/accessibility/AccessibilityImageMapLink.cpp (working copy) >@@ -73,7 +73,7 @@ > if (!m_areaElement) > return WebCoreLinkRole; > >- const AtomicString& ariaRole = m_areaElement->getAttribute(roleAttr); >+ const AtomicString& ariaRole = getAttribute(roleAttr); > if (!ariaRole.isEmpty()) > return AccessibilityObject::ariaRoleToWebCoreRole(ariaRole); > >@@ -100,13 +100,10 @@ > > String AccessibilityImageMapLink::accessibilityDescription() const > { >- if (!m_areaElement) >- return String(); >- >- const AtomicString& ariaLabel = m_areaElement->getAttribute(aria_labelAttr); >+ const AtomicString& ariaLabel = getAttribute(aria_labelAttr); > if (!ariaLabel.isEmpty()) > return ariaLabel; >- const AtomicString& alt = m_areaElement->getAttribute(altAttr); >+ const AtomicString& alt = getAttribute(altAttr); > if (!alt.isEmpty()) > return alt; > >@@ -115,13 +112,10 @@ > > String AccessibilityImageMapLink::title() const > { >- if (!m_areaElement) >- return String(); >- >- const AtomicString& title = m_areaElement->getAttribute(titleAttr); >+ const AtomicString& title = getAttribute(titleAttr); > if (!title.isEmpty()) > return title; >- const AtomicString& summary = m_areaElement->getAttribute(summaryAttr); >+ const AtomicString& summary = getAttribute(summaryAttr); > if (!summary.isEmpty()) > return summary; > >Index: WebCore/accessibility/AccessibilityObject.cpp >=================================================================== >--- WebCore/accessibility/AccessibilityObject.cpp (revision 63285) >+++ WebCore/accessibility/AccessibilityObject.cpp (working copy) >@@ -148,17 +148,12 @@ > return true; > } > >-String AccessibilityObject::language(Node* node) const >-{ >- const AtomicString& lang = getAttribute(node, langAttr); >- if (lang.isEmpty()) >- return AccessibilityObject::language(); >- >- return lang; >-} >- > String AccessibilityObject::language() const > { >+ const AtomicString& lang = getAttribute(langAttr); >+ if (!lang.isEmpty()) >+ return lang; >+ > AccessibilityObject* parent = parentObject(); > > // as a last resort, fall back to the content language specified in the meta tag >@@ -166,7 +161,7 @@ > Document* doc = document(); > if (doc) > return doc->contentLanguage(); >- return String(); >+ return nullAtom; > } > > return parent->language(); >@@ -403,7 +398,7 @@ > } > > // Finds a RenderListItem parent give a node. >-RenderListItem* AccessibilityObject::renderListItemContainerForNode(Node* node) const >+static RenderListItem* renderListItemContainerForNode(Node* node) > { > for (Node* stringNode = node; stringNode; stringNode = stringNode->parent()) { > RenderObject* renderObject = stringNode->renderer(); >@@ -844,8 +839,13 @@ > } > } > >-const AtomicString& AccessibilityObject::getAttribute(Node* node, const QualifiedName& attribute) >+const AtomicString& AccessibilityObject::getAttribute(const QualifiedName& attribute) const > { >+ return getAttribute(node(), attribute); >+} >+ >+const AtomicString& AccessibilityObject::getAttribute(Node* node, const QualifiedName& attribute) const >+{ > if (!node) > return nullAtom; > >@@ -980,6 +980,32 @@ > const AtomicString& liveRegion = ariaLiveRegionStatus(); > return equalIgnoringCase(liveRegion, "polite") || equalIgnoringCase(liveRegion, "assertive"); > } >+ >+int AccessibilityObject::intValue() const >+{ >+ if (isPasswordField()) >+ return 0; >+ >+ if (isHeading()) >+ return headingLevel(); >+ >+ // If this is a real checkbox or radio button, AccessibilityRenderObject will handle. >+ // If it's an ARIA checkbox or radio, the aria-checked attribute should be used. >+ if (isCheckboxOrRadio()) >+ return equalIgnoringCase(getAttribute(aria_checkedAttr), "true"); >+ >+ return 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 63285) >+++ 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 > { >@@ -660,36 +654,29 @@ > int AccessibilityRenderObject::headingLevel() const > { > // headings can be in block flow and non-block flow >- if (!m_renderer) >+ Node* element = node(); >+ if (!element) > return 0; >- >- Node* node = m_renderer->node(); >- if (!node) >- return 0; > >- if (ariaRoleAttribute() == HeadingRole) { >- if (!node->isElementNode()) >- return 0; >- Element* element = static_cast<Element*>(node); >- return element->getAttribute(aria_levelAttr).toInt(); >- } >+ if (ariaRoleAttribute() == HeadingRole) >+ return getAttribute(aria_levelAttr).toInt(); > >- if (node->hasTagName(h1Tag)) >+ if (element->hasTagName(h1Tag)) > return 1; > >- if (node->hasTagName(h2Tag)) >+ if (element->hasTagName(h2Tag)) > return 2; > >- if (node->hasTagName(h3Tag)) >+ if (element->hasTagName(h3Tag)) > return 3; > >- if (node->hasTagName(h4Tag)) >+ if (element->hasTagName(h4Tag)) > return 4; > >- if (node->hasTagName(h5Tag)) >+ if (element->hasTagName(h5Tag)) > return 5; > >- if (node->hasTagName(h6Tag)) >+ if (element->hasTagName(h6Tag)) > return 6; > > return 0; >@@ -760,11 +747,6 @@ > } > return 0; > } >- >-const AtomicString& AccessibilityRenderObject::getAttribute(const QualifiedName& attribute) const >-{ >- return AccessibilityObject::getAttribute(m_renderer->node(), attribute); >-} > > Element* AccessibilityRenderObject::anchorElement() const > { >@@ -990,14 +972,6 @@ > > return level; > } >- >-String AccessibilityRenderObject::language() const >-{ >- if (!m_renderer) >- return String(); >- >- return AccessibilityObject::language(m_renderer->node()); >-} > > String AccessibilityRenderObject::textUnderElement() const > { >@@ -1030,38 +1004,17 @@ > return String(); > } > >-bool AccessibilityRenderObject::hasIntValue() const >-{ >- if (isHeading()) >- return true; >+Node* AccessibilityRenderObject::node() const >+{ >+ return m_renderer ? m_renderer->node() : 0; >+} > >- if (m_renderer->node() && isCheckboxOrRadio()) >- return true; >- >- return false; >-} >- > int AccessibilityRenderObject::intValue() const > { >- if (!m_renderer || isPasswordField()) >- return 0; >- >- if (isHeading()) >- return headingLevel(); >- >- Node* node = m_renderer->node(); >- if (!node || !isCheckboxOrRadio()) >- return 0; >+ if (isCheckboxOrRadio()) >+ return isChecked() ? 1 : 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), "true")) >- return true; >- return false; >- } >- >- return static_cast<HTMLInputElement*>(node)->checked(); >+ return AccessibilityObject::intValue(); > } > > String AccessibilityRenderObject::valueDescription() const >Index: WebCore/accessibility/AccessibilityListBoxOption.h >=================================================================== >--- WebCore/accessibility/AccessibilityListBoxOption.h (revision 63285) >+++ WebCore/accessibility/AccessibilityListBoxOption.h (working copy) >@@ -56,7 +56,7 @@ > virtual bool isEnabled() const; > virtual String stringValue() const; > virtual Element* actionElement() const; >- >+ virtual Node* node() const { return m_optionElement; } > virtual void setSelected(bool); > virtual bool canSetSelectedAttribute() const; > >@@ -68,7 +68,6 @@ > private: > HTMLElement* m_optionElement; > >- virtual String language() const; > virtual bool canHaveChildren() const { return false; } > HTMLSelectElement* listBoxOptionParentNode() const; > int listBoxOptionIndex() const; >Index: WebCore/rendering/RenderMenuList.cpp >=================================================================== >--- WebCore/rendering/RenderMenuList.cpp (revision 63041) >+++ WebCore/rendering/RenderMenuList.cpp (working copy) >@@ -26,7 +26,6 @@ > #include "RenderMenuList.h" > > #include "AXObjectCache.h" >-#include "AccessibilityObject.h" > #include "CSSStyleSelector.h" > #include "Frame.h" > #include "FrameView.h" >@@ -358,7 +357,7 @@ > if (listIndex >= listItems.size()) > return String(); > >- return AccessibilityObject::getAttribute(listItems[listIndex], aria_labelAttr); >+ return listItems[listIndex]->getAttribute(aria_labelAttr); > } > > String RenderMenuList::itemToolTip(unsigned listIndex) 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/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 63287) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2010-07-14 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 >+ >+ * 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-14 Kent Tamura <tkent@chromium.org> > > Unreviewed, test expectation update.
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