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

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

Issue 2833843005: Handling of different types of empty alt (Closed)
Patch Set: Ready to land Created 3 years, 7 months 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::kWebAXNameFromAttributeExplicitlyEmpty) {
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
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
OLDNEW
« no previous file with comments | « content/renderer/accessibility/blink_ax_enum_conversion.cc ('k') | content/shell/test_runner/web_ax_object_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698