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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 dst->transform = base::WrapUnique(new gfx::Transform(container_transform)); | 398 dst->transform = base::WrapUnique(new gfx::Transform(container_transform)); |
399 if (!offset_container.IsDetached()) | 399 if (!offset_container.IsDetached()) |
400 dst->offset_container_id = offset_container.AxID(); | 400 dst->offset_container_id = offset_container.AxID(); |
401 | 401 |
402 AXContentNodeDataSparseAttributeAdapter sparse_attribute_adapter(dst); | 402 AXContentNodeDataSparseAttributeAdapter sparse_attribute_adapter(dst); |
403 src.GetSparseAXAttributes(sparse_attribute_adapter); | 403 src.GetSparseAXAttributes(sparse_attribute_adapter); |
404 | 404 |
405 blink::WebAXNameFrom nameFrom; | 405 blink::WebAXNameFrom nameFrom; |
406 blink::WebVector<blink::WebAXObject> nameObjects; | 406 blink::WebVector<blink::WebAXObject> nameObjects; |
407 blink::WebString web_name = src.GetName(nameFrom, nameObjects); | 407 blink::WebString web_name = src.GetName(nameFrom, nameObjects); |
408 if (!web_name.IsEmpty()) { | 408 if ((!web_name.IsEmpty() && !web_name.IsNull()) || |
| 409 nameFrom == blink::kWebAXNameFromExplicitlyEmptyAttribute) { |
409 dst->AddStringAttribute(ui::AX_ATTR_NAME, web_name.Utf8()); | 410 dst->AddStringAttribute(ui::AX_ATTR_NAME, web_name.Utf8()); |
410 dst->AddIntAttribute(ui::AX_ATTR_NAME_FROM, AXNameFromFromBlink(nameFrom)); | 411 dst->AddIntAttribute(ui::AX_ATTR_NAME_FROM, AXNameFromFromBlink(nameFrom)); |
411 AddIntListAttributeFromWebObjects( | 412 AddIntListAttributeFromWebObjects( |
412 ui::AX_ATTR_LABELLEDBY_IDS, nameObjects, dst); | 413 ui::AX_ATTR_LABELLEDBY_IDS, nameObjects, dst); |
413 } | 414 } |
414 | 415 |
415 blink::WebAXDescriptionFrom descriptionFrom; | 416 blink::WebAXDescriptionFrom descriptionFrom; |
416 blink::WebVector<blink::WebAXObject> descriptionObjects; | 417 blink::WebVector<blink::WebAXObject> descriptionObjects; |
417 blink::WebString web_description = | 418 blink::WebString web_description = |
418 src.Description(nameFrom, descriptionFrom, descriptionObjects); | 419 src.Description(nameFrom, descriptionFrom, descriptionObjects); |
(...skipping 470 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 |