Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: content/renderer/accessibility/blink_ax_tree_source.cc

Issue 665843002: Change condition for adding AX_STATE_EXPANDED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove AXExpanded Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/accessibility/blink_ax_enum_conversion.cc ('k') | content/shell/renderer/test_runner/web_ax_object_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698