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

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

Issue 2526073003: Re-add the line break attribute (Closed)
Patch Set: Created 4 years 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 for (unsigned i = 0; i < element.attributeCount(); ++i) { 540 for (unsigned i = 0; i < element.attributeCount(); ++i) {
541 std::string name = base::ToLowerASCII( 541 std::string name = base::ToLowerASCII(
542 element.attributeLocalName(i).utf8()); 542 element.attributeLocalName(i).utf8());
543 std::string value = element.attributeValue(i).utf8(); 543 std::string value = element.attributeValue(i).utf8();
544 dst->html_attributes.push_back(std::make_pair(name, value)); 544 dst->html_attributes.push_back(std::make_pair(name, value));
545 } 545 }
546 546
547 if (src.isEditable()) { 547 if (src.isEditable()) {
548 dst->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, src.selectionStart()); 548 dst->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, src.selectionStart());
549 dst->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, src.selectionEnd()); 549 dst->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, src.selectionEnd());
550
551 #if defined(OS_CHROMEOS)
dmazzoni 2016/11/28 17:41:38 Add a comment with a bug link
David Tseng 2016/11/28 19:13:01 Done.
552 WebVector<int> src_line_breaks;
553 src.lineBreaks(src_line_breaks);
554 if (src_line_breaks.size()) {
555 std::vector<int32_t> line_breaks;
556 line_breaks.reserve(src_line_breaks.size());
557 for (size_t i = 0; i < src_line_breaks.size(); ++i)
558 line_breaks.push_back(src_line_breaks[i]);
559 dst->AddIntListAttribute(ui::AX_ATTR_LINE_BREAKS, line_breaks);
560 }
550 } 561 }
dmazzoni 2016/11/28 17:41:38 I think this closing brace belongs outside of the
David Tseng 2016/11/28 19:13:01 Done.
562 #endif // defined OS_CHROMEOS
551 563
552 // ARIA role. 564 // ARIA role.
553 if (element.hasAttribute("role")) { 565 if (element.hasAttribute("role")) {
554 dst->AddStringAttribute( 566 dst->AddStringAttribute(
555 ui::AX_ATTR_ROLE, 567 ui::AX_ATTR_ROLE,
556 element.getAttribute("role").utf8()); 568 element.getAttribute("role").utf8());
557 } else { 569 } else {
558 std::string role = GetEquivalentAriaRoleString(dst->role); 570 std::string role = GetEquivalentAriaRoleString(dst->role);
559 if (!role.empty()) 571 if (!role.empty())
560 dst->AddStringAttribute(ui::AX_ATTR_ROLE, role); 572 dst->AddStringAttribute(ui::AX_ATTR_ROLE, role);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 return WebAXObject(); 751 return WebAXObject();
740 752
741 WebDocument document = render_frame_->GetWebFrame()->document(); 753 WebDocument document = render_frame_->GetWebFrame()->document();
742 if (!document.isNull()) 754 if (!document.isNull())
743 return document.accessibilityObject(); 755 return document.accessibilityObject();
744 756
745 return WebAXObject(); 757 return WebAXObject();
746 } 758 }
747 759
748 } // namespace content 760 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698