OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/accessibility/blink_ax_tree_source.h" | 5 #include "content/renderer/accessibility/blink_ax_tree_source.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 bool is_iframe = false; | 315 bool is_iframe = false; |
316 std::string live_atomic; | 316 std::string live_atomic; |
317 std::string live_busy; | 317 std::string live_busy; |
318 std::string live_status; | 318 std::string live_status; |
319 std::string live_relevant; | 319 std::string live_relevant; |
320 | 320 |
321 if (!node.isNull() && node.isElementNode()) { | 321 if (!node.isNull() && node.isElementNode()) { |
322 WebElement element = node.to<WebElement>(); | 322 WebElement element = node.to<WebElement>(); |
323 is_iframe = (element.tagName() == ASCIIToUTF16("IFRAME")); | 323 is_iframe = (element.tagName() == ASCIIToUTF16("IFRAME")); |
324 | 324 |
325 if (LowerCaseEqualsASCII(element.getAttribute("aria-expanded"), "true")) | |
326 dst->state |= (1 << ui::AX_STATE_EXPANDED); | |
327 | |
328 // TODO(ctguil): The tagName in WebKit is lower cased but | 325 // TODO(ctguil): The tagName in WebKit is lower cased but |
329 // HTMLElement::nodeName calls localNameUpper. Consider adding | 326 // HTMLElement::nodeName calls localNameUpper. Consider adding |
330 // a WebElement method that returns the original lower cased tagName. | 327 // a WebElement method that returns the original lower cased tagName. |
331 dst->AddStringAttribute( | 328 dst->AddStringAttribute( |
332 ui::AX_ATTR_HTML_TAG, | 329 ui::AX_ATTR_HTML_TAG, |
333 base::StringToLowerASCII(UTF16ToUTF8(element.tagName()))); | 330 base::StringToLowerASCII(UTF16ToUTF8(element.tagName()))); |
334 for (unsigned i = 0; i < element.attributeCount(); ++i) { | 331 for (unsigned i = 0; i < element.attributeCount(); ++i) { |
335 std::string name = base::StringToLowerASCII(UTF16ToUTF8( | 332 std::string name = base::StringToLowerASCII(UTF16ToUTF8( |
336 element.attributeLocalName(i))); | 333 element.attributeLocalName(i))); |
337 std::string value = UTF16ToUTF8(element.attributeValue(i)); | 334 std::string value = UTF16ToUTF8(element.attributeValue(i)); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); | 608 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); |
612 } | 609 } |
613 | 610 |
614 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 611 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
615 if (render_frame_ && render_frame_->GetWebFrame()) | 612 if (render_frame_ && render_frame_->GetWebFrame()) |
616 return render_frame_->GetWebFrame()->document(); | 613 return render_frame_->GetWebFrame()->document(); |
617 return WebDocument(); | 614 return WebDocument(); |
618 } | 615 } |
619 | 616 |
620 } // namespace content | 617 } // namespace content |
OLD | NEW |