Commit 8664726f authored by's avatar

Re: [PFR] <rdar://problem/5471973> Some AXLinks are not getting AXTitles though there is title text

git-svn-id: 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a1b6f102
2008-05-13 chris fleizach <>
Reviewed by Beth Dakin
<rdar://problem/5471973> Some AXLinks are not getting AXTitles though there is title text
* page/AccessibilityRenderObject.cpp:
2008-05-13 Alexey Proskuryakov <>
Reviewed by Eric Seidel.
......@@ -611,9 +611,13 @@ static HTMLLabelElement* labelForElement(Element* element)
String AccessibilityRenderObject::title() const
if (!m_renderer || m_areaElement || !m_renderer->element())
if (!m_renderer || m_areaElement)
return String();
Node* node = m_renderer->element();
if (!node)
return String();
String ariaLabel = ariaLabeledByAttribute();
if (!ariaLabel.isEmpty())
return ariaLabel;
......@@ -621,20 +625,29 @@ String AccessibilityRenderObject::title() const
if (roleValue() == ButtonRole)
return textUnderElement();
bool isInputTag = m_renderer->element()->hasTagName(inputTag);
bool isInputTag = node->hasTagName(inputTag);
if (isInputTag) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(m_renderer->element());
HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
if (input->isTextButton())
return input->value();
if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute())) {
HTMLLabelElement* label = labelForElement(static_cast<Element*>(m_renderer->element()));
HTMLLabelElement* label = labelForElement(static_cast<Element*>(node));
if (label)
return label->innerText();
if (isLink() || isHeading())
if (isLink()) {
Element* element = static_cast<Element*>(node);
const AtomicString& title = element->getAttribute(titleAttr);
if (!title.isEmpty())
return title;
return textUnderElement();
if (isHeading())
return textUnderElement();
return String();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment