Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 375 return node1.Equals(node2); | 375 return node1.Equals(node2); |
| 376 } | 376 } |
| 377 | 377 |
| 378 blink::WebAXObject BlinkAXTreeSource::GetNull() const { | 378 blink::WebAXObject BlinkAXTreeSource::GetNull() const { |
| 379 return blink::WebAXObject(); | 379 return blink::WebAXObject(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src, | 382 void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src, |
| 383 AXContentNodeData* dst) const { | 383 AXContentNodeData* dst) const { |
| 384 dst->role = AXRoleFromBlink(src.Role()); | 384 dst->role = AXRoleFromBlink(src.Role()); |
| 385 dst->ClearBitfields(); | |
|
tapted
2017/05/05 05:53:36
this one isn't needed I guess, because of the line
Patti Lor
2017/05/08 00:28:08
Reverted! (This will come back in a later patch th
| |
| 385 dst->state = AXStateFromBlink(src); | 386 dst->state = AXStateFromBlink(src); |
| 386 dst->id = src.AxID(); | 387 dst->id = src.AxID(); |
| 387 | 388 |
| 388 TRACE_EVENT1("accessibility", "BlinkAXTreeSource::SerializeNode", "role", | 389 TRACE_EVENT1("accessibility", "BlinkAXTreeSource::SerializeNode", "role", |
| 389 ui::ToString(dst->role)); | 390 ui::ToString(dst->role)); |
| 390 | 391 |
| 391 WebAXObject offset_container; | 392 WebAXObject offset_container; |
| 392 WebFloatRect bounds_in_container; | 393 WebFloatRect bounds_in_container; |
| 393 SkMatrix44 container_transform; | 394 SkMatrix44 container_transform; |
| 394 src.GetRelativeBounds(offset_container, bounds_in_container, | 395 src.GetRelativeBounds(offset_container, bounds_in_container, |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 622 } | 623 } |
| 623 dst->AddIntListAttribute(ui::AX_ATTR_MARKER_TYPES, marker_types); | 624 dst->AddIntListAttribute(ui::AX_ATTR_MARKER_TYPES, marker_types); |
| 624 dst->AddIntListAttribute(ui::AX_ATTR_MARKER_STARTS, marker_starts); | 625 dst->AddIntListAttribute(ui::AX_ATTR_MARKER_STARTS, marker_starts); |
| 625 dst->AddIntListAttribute(ui::AX_ATTR_MARKER_ENDS, marker_ends); | 626 dst->AddIntListAttribute(ui::AX_ATTR_MARKER_ENDS, marker_ends); |
| 626 } | 627 } |
| 627 | 628 |
| 628 if (src.IsInLiveRegion()) { | 629 if (src.IsInLiveRegion()) { |
| 629 dst->AddBoolAttribute(ui::AX_ATTR_LIVE_ATOMIC, src.LiveRegionAtomic()); | 630 dst->AddBoolAttribute(ui::AX_ATTR_LIVE_ATOMIC, src.LiveRegionAtomic()); |
| 630 dst->AddBoolAttribute(ui::AX_ATTR_LIVE_BUSY, src.LiveRegionBusy()); | 631 dst->AddBoolAttribute(ui::AX_ATTR_LIVE_BUSY, src.LiveRegionBusy()); |
| 631 if (src.LiveRegionBusy()) | 632 if (src.LiveRegionBusy()) |
| 632 dst->state |= (1 << ui::AX_STATE_BUSY); | 633 dst->AddState(ui::AX_STATE_BUSY); |
| 633 if (!src.LiveRegionStatus().IsEmpty()) { | 634 if (!src.LiveRegionStatus().IsEmpty()) { |
| 634 dst->AddStringAttribute(ui::AX_ATTR_LIVE_STATUS, | 635 dst->AddStringAttribute(ui::AX_ATTR_LIVE_STATUS, |
| 635 src.LiveRegionStatus().Utf8()); | 636 src.LiveRegionStatus().Utf8()); |
| 636 } | 637 } |
| 637 dst->AddStringAttribute(ui::AX_ATTR_LIVE_RELEVANT, | 638 dst->AddStringAttribute(ui::AX_ATTR_LIVE_RELEVANT, |
| 638 src.LiveRegionRelevant().Utf8()); | 639 src.LiveRegionRelevant().Utf8()); |
| 639 // If we are not at the root of an atomic live region. | 640 // If we are not at the root of an atomic live region. |
| 640 if (src.ContainerLiveRegionAtomic() && | 641 if (src.ContainerLiveRegionAtomic() && |
| 641 !src.LiveRegionRoot().IsDetached() && !src.LiveRegionAtomic()) { | 642 !src.LiveRegionRoot().IsDetached() && !src.LiveRegionAtomic()) { |
| 642 dst->AddIntAttribute(ui::AX_ATTR_MEMBER_OF_ID, | 643 dst->AddIntAttribute(ui::AX_ATTR_MEMBER_OF_ID, |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 889 return WebAXObject(); | 890 return WebAXObject(); |
| 890 | 891 |
| 891 WebDocument document = render_frame_->GetWebFrame()->GetDocument(); | 892 WebDocument document = render_frame_->GetWebFrame()->GetDocument(); |
| 892 if (!document.IsNull()) | 893 if (!document.IsNull()) |
| 893 return document.AccessibilityObject(); | 894 return document.AccessibilityObject(); |
| 894 | 895 |
| 895 return WebAXObject(); | 896 return WebAXObject(); |
| 896 } | 897 } |
| 897 | 898 |
| 898 } // namespace content | 899 } // namespace content |
| OLD | NEW |