Permalink
Browse files

Unreviewed, rolling out r126391.

http://trac.webkit.org/changeset/126391
https://bugs.webkit.org/show_bug.cgi?id=94302

Breaks Chromium browser_tests AccessibilityFooter,
AccessibilityListMarkers, AccessibilityUI

Source/WebCore:

* accessibility/AccessibilityNodeObject.cpp:
* accessibility/AccessibilityNodeObject.h:
(AccessibilityNodeObject):
* accessibility/AccessibilityObject.cpp:
* accessibility/AccessibilityObject.h:
(AccessibilityObject):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::title):
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::isDescendantOfElementType):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):

LayoutTests:

* accessibility/editable-webarea-context-menu-point.html:
* accessibility/focusable-div-expected.txt: Removed.
* accessibility/focusable-div.html: Removed.
* accessibility/table-detection.html:
* platform/mac/accessibility/listbox-hit-test.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
1 parent 550d37e commit ccb9898397ce5063cfbb5c830fc404bb1051e41a @dominiccooney dominiccooney committed Aug 23, 2012
View
@@ -1,3 +1,18 @@
+2012-08-23 Dominic Cooney <dominicc@chromium.org>
+
+ Unreviewed, rolling out r126391.
+ http://trac.webkit.org/changeset/126391
+ https://bugs.webkit.org/show_bug.cgi?id=94302
+
+ Breaks Chromium browser_tests AccessibilityFooter,
+ AccessibilityListMarkers, AccessibilityUI
+
+ * accessibility/editable-webarea-context-menu-point.html:
+ * accessibility/focusable-div-expected.txt: Removed.
+ * accessibility/focusable-div.html: Removed.
+ * accessibility/table-detection.html:
+ * platform/mac/accessibility/listbox-hit-test.html:
+
2012-08-23 Hajime Morrita <morrita@chromium.org>
Unreviewed Chromium gardeing.
@@ -19,7 +19,6 @@
var body = document.getElementById("body");
body.focus();
- var axWebArea = accessibilityController.focusedElement.parentElement();
x = body.offsetLeft + 10;
y = body.offsetTop + 10;
@@ -30,7 +29,7 @@
eventSender.mouseDown();
eventSender.mouseUp();
- var clickPointX1 = axWebArea.clickPointX;
+ var clickPointX1 = accessibilityController.focusedElement.clickPointX;
x = body.offsetLeft + 100 + 10;
y = body.offsetTop + 10;
@@ -41,7 +40,7 @@
eventSender.mouseDown();
eventSender.mouseUp();
- var clickPointX2 = axWebArea.clickPointX;
+ var clickPointX2 = accessibilityController.focusedElement.clickPointX;
var succeeded = clickPointX2 != clickPointX1;
shouldBe("succeeded", "true");
@@ -1,20 +0,0 @@
-A
-B
-C
-This test makes sure that a generic focusable div can get accessibility focus.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.activeElement == link is true
-PASS lastChar(axLink.title) is "A"
-PASS document.activeElement == div is true
-PASS lastChar(axDiv.title) is "B"
-PASS document.activeElement == div2 is true
-PASS lastChar(axDiv2.title) is "C"
-PASS document.activeElement == div3 is true
-PASS lastChar(axDiv3.description) is "D"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
@@ -1,51 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body>
-<script src="../fast/js/resources/js-test-pre.js"></script>
-
-<a id="link" href="#">A</a>
-<div id="div" tabindex="0">B</div>
-<div id="div2" tabindex="0"><div></div>C</div>
-<div id="div3" tabindex="0" aria-label="D"></div>
-
-<div id="console"></div>
-<script>
-description("This test makes sure that a generic focusable div can get accessibility focus.");
-
-if (window.testRunner && window.accessibilityController) {
- window.testRunner.dumpAsText();
-
- function lastChar(str) {
- return str.substr(str.length - 1);
- }
-
- var link = document.getElementById('link');
- link.focus();
- shouldBe("document.activeElement == link", "true");
- window.axLink = accessibilityController.focusedElement;
- shouldBe("lastChar(axLink.title)", "\"A\"");
-
- var div = document.getElementById('div');
- div.focus();
- shouldBe("document.activeElement == div", "true");
- window.axDiv = accessibilityController.focusedElement;
- shouldBe("lastChar(axDiv.title)", "\"B\"");
-
- var div2 = document.getElementById('div2');
- div2.focus();
- shouldBe("document.activeElement == div2", "true");
- window.axDiv2 = accessibilityController.focusedElement;
- shouldBe("lastChar(axDiv2.title)", "\"C\"");
-
- var div3 = document.getElementById('div3');
- div3.focus();
- shouldBe("document.activeElement == div3", "true");
- window.axDiv3 = accessibilityController.focusedElement;
- shouldBe("lastChar(axDiv3.description)", "\"D\"");
-}
-
-</script>
-
-<script src="../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
@@ -99,10 +99,11 @@
<table class="nmTB" cellpadding="0" cellspacing="0"><tr><td class="nmIBD" id="nmb" name="nmb" nm_sn="3032552" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nm0" cn="Politics"><a class="nmLBD" href="/id/3032553">Politics</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="18970411" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="Decision '08"><a class="nmLB" href="/id/18970417">Decision '08</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="18296896" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="The debates"><a class="nmLB" href="/id/18296908">The debates</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="21491043" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="The White House"><a class="nmLB" href="/id/21672863">The White House</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="21491571" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="Capitol Hill"><a class="nmLB" href="/id/21672985">Capitol Hill</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="14016004" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="National Journal"><a class="nmLB" href="/id/14016001">National Journal</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="19748467" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="New York Times"><a class="nmLB" href="/id/19747577">New York Times</a></td></tr></table>
// this should be a table because it's editable
-
- <table style='border: 1px solid black' contenteditable>
- <tr><td >asdf</td><td>asdf</td></tr>
- </table>
+ <div contenteditable>
+ <table style='border: 1px solid black'>
+ <tr><td >asdf</td><td>asdf</td></tr>
+ </table>
+ </div>
<div id="result"></div>
@@ -5,7 +5,7 @@
</head>
<body id="body">
-<div tabindex=0 id="region" title="region">
+<div tabindex=0 id="region">
<select size=20>
<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
@@ -1,3 +1,25 @@
+2012-08-23 Dominic Cooney <dominicc@chromium.org>
+
+ Unreviewed, rolling out r126391.
+ http://trac.webkit.org/changeset/126391
+ https://bugs.webkit.org/show_bug.cgi?id=94302
+
+ Breaks Chromium browser_tests AccessibilityFooter,
+ AccessibilityListMarkers, AccessibilityUI
+
+ * accessibility/AccessibilityNodeObject.cpp:
+ * accessibility/AccessibilityNodeObject.h:
+ (AccessibilityNodeObject):
+ * accessibility/AccessibilityObject.cpp:
+ * accessibility/AccessibilityObject.h:
+ (AccessibilityObject):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::title):
+ (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+ (WebCore::AccessibilityRenderObject::isDescendantOfElementType):
+ * accessibility/AccessibilityRenderObject.h:
+ (AccessibilityRenderObject):
+
2012-08-23 Andrey Adaikin <aandrey@chromium.org>
Web Inspector: [WebGL] Allow collecting calls for Resource objects affecting their states
@@ -384,15 +384,4 @@ AccessibilityRole AccessibilityNodeObject::remapAriaRoleDueToParent(Accessibilit
return role;
}
-// If you call node->rendererIsEditable() since that will return true if an ancestor is editable.
-// This only returns true if this is the element that actually has the contentEditable attribute set.
-bool AccessibilityNodeObject::hasContentEditableAttributeSet() const
-{
- if (!hasAttribute(contenteditableAttr))
- return false;
- const AtomicString& contentEditableValue = getAttribute(contenteditableAttr);
- // Both "true" (case-insensitive) and the empty string count as true.
- return contentEditableValue.isEmpty() || equalIgnoringCase(contentEditableValue, "true");
-}
-
} // namespace WebCore
@@ -98,7 +98,6 @@ class AccessibilityNodeObject : public AccessibilityObject {
AccessibilityRole ariaRoleAttribute() const;
AccessibilityRole determineAriaRoleAttribute() const;
AccessibilityRole remapAriaRoleDueToParent(AccessibilityRole) const;
- bool hasContentEditableAttributeSet() const;
private:
Node* m_node;
@@ -1294,19 +1294,6 @@ const AtomicString& AccessibilityObject::invalidStatus() const
return ariaInvalid;
}
-bool AccessibilityObject::hasAttribute(const QualifiedName& attribute) const
-{
- Node* elementNode = node();
- if (!elementNode)
- return false;
-
- if (!elementNode->isElementNode())
- return false;
-
- Element* element = static_cast<Element*>(elementNode);
- return element->fastHasAttribute(attribute);
-}
-
const AtomicString& AccessibilityObject::getAttribute(const QualifiedName& attribute) const
{
Node* elementNode = node();
@@ -584,7 +584,6 @@ class AccessibilityObject : public RefCounted<AccessibilityObject> {
bool isAncestorOfObject(const AccessibilityObject*) const;
static AccessibilityRole ariaRoleToWebCoreRole(const String&);
- bool hasAttribute(const QualifiedName&) const;
const AtomicString& getAttribute(const QualifiedName&) const;
virtual VisiblePositionRange visiblePositionRange() const { return VisiblePositionRange(); }
@@ -1401,12 +1401,7 @@ String AccessibilityRenderObject::title() const
if (isHeading() || isLink())
return textUnderElement();
-
- // If it's focusable but it's not content editable or a known control type, then it will appear to
- // the user as a single atomic object, so we should use its text as the default title.
- if (isGenericFocusableElement())
- return textUnderElement();
-
+
return String();
}
@@ -1943,8 +1938,12 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
// Anything that is content editable should not be ignored.
// However, one cannot just call node->rendererIsEditable() since that will ask if its parents
// are also editable. Only the top level content editable region should be exposed.
- if (hasContentEditableAttributeSet())
- return false;
+ if (node && node->isElementNode()) {
+ Element* element = static_cast<Element*>(node);
+ const AtomicString& contentEditable = element->getAttribute(contenteditableAttr);
+ if (equalIgnoringCase(contentEditable, "true"))
+ return false;
+ }
// List items play an important role in defining the structure of lists. They should not be ignored.
if (roleValue() == ListItemRole)
@@ -1954,7 +1953,7 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
if (supportsARIAAttributes())
return false;
- if (m_renderer->isBlockFlow() && m_renderer->childrenInline() && !canSetFocusAttribute())
+ if (m_renderer->isBlockFlow() && m_renderer->childrenInline())
return !toRenderBlock(m_renderer)->firstLineBox() && !mouseButtonListener();
// ignore images seemingly used as spacers
@@ -3119,29 +3118,6 @@ bool AccessibilityRenderObject::isDescendantOfElementType(const QualifiedName& t
}
return false;
}
-
-bool AccessibilityRenderObject::isGenericFocusableElement() const
-{
- if (!canSetFocusAttribute())
- return false;
-
- // If it's a control, it's not generic.
- if (isControl())
- return false;
-
- // If the content editable attribute is set on this element, that's the reason
- // it's focusable, and existing logic should handle this case already - so it's not a
- // generic focusable element.
- if (hasContentEditableAttributeSet())
- return false;
-
- // The body element is focusable, but existing logic handles it already, we don't need
- // to include it here.
- if (node() && node()->hasTagName(bodyTag))
- return false;
-
- return true;
-}
AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
{
@@ -300,8 +300,6 @@ class AccessibilityRenderObject : public AccessibilityNodeObject {
bool renderObjectIsObservable(RenderObject*) const;
RenderObject* renderParentObject() const;
bool isDescendantOfElementType(const QualifiedName& tagName) const;
- // This returns true if it's focusable but it's not content editable and it's not a control or ARIA control.
- bool isGenericFocusableElement() const;
void addTextFieldChildren();
void addImageMapChildren();

0 comments on commit ccb9898

Please sign in to comment.