| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 dst->role = AXRoleFromBlink(src.Role()); | 382 dst->role = AXRoleFromBlink(src.Role()); |
| 383 dst->state = AXStateFromBlink(src); | 383 dst->state = AXStateFromBlink(src); |
| 384 dst->id = src.AxID(); | 384 dst->id = src.AxID(); |
| 385 | 385 |
| 386 TRACE_EVENT1("accessibility", "BlinkAXTreeSource::SerializeNode", "role", | 386 TRACE_EVENT1("accessibility", "BlinkAXTreeSource::SerializeNode", "role", |
| 387 ui::ToString(dst->role)); | 387 ui::ToString(dst->role)); |
| 388 | 388 |
| 389 WebAXObject offset_container; | 389 WebAXObject offset_container; |
| 390 WebFloatRect bounds_in_container; | 390 WebFloatRect bounds_in_container; |
| 391 SkMatrix44 container_transform; | 391 SkMatrix44 container_transform; |
| 392 bool is_fixed_positioned; |
| 392 src.GetRelativeBounds(offset_container, bounds_in_container, | 393 src.GetRelativeBounds(offset_container, bounds_in_container, |
| 393 container_transform); | 394 container_transform, is_fixed_positioned); |
| 394 dst->location = bounds_in_container; | 395 dst->location = bounds_in_container; |
| 395 if (!container_transform.isIdentity()) | 396 if (!container_transform.isIdentity()) |
| 396 dst->transform = base::WrapUnique(new gfx::Transform(container_transform)); | 397 dst->transform = base::WrapUnique(new gfx::Transform(container_transform)); |
| 397 if (!offset_container.IsDetached()) | 398 if (!offset_container.IsDetached()) |
| 398 dst->offset_container_id = offset_container.AxID(); | 399 dst->offset_container_id = offset_container.AxID(); |
| 400 dst->is_fixed_positioned = is_fixed_positioned; |
| 399 | 401 |
| 400 AXContentNodeDataSparseAttributeAdapter sparse_attribute_adapter(dst); | 402 AXContentNodeDataSparseAttributeAdapter sparse_attribute_adapter(dst); |
| 401 src.GetSparseAXAttributes(sparse_attribute_adapter); | 403 src.GetSparseAXAttributes(sparse_attribute_adapter); |
| 402 | 404 |
| 403 blink::WebAXNameFrom nameFrom; | 405 blink::WebAXNameFrom nameFrom; |
| 404 blink::WebVector<WebAXObject> nameObjects; | 406 blink::WebVector<WebAXObject> nameObjects; |
| 405 blink::WebString web_name = src.GetName(nameFrom, nameObjects); | 407 blink::WebString web_name = src.GetName(nameFrom, nameObjects); |
| 406 if ((!web_name.IsEmpty() && !web_name.IsNull()) || | 408 if ((!web_name.IsEmpty() && !web_name.IsNull()) || |
| 407 nameFrom == blink::kWebAXNameFromAttributeExplicitlyEmpty) { | 409 nameFrom == blink::kWebAXNameFromAttributeExplicitlyEmpty) { |
| 408 dst->AddStringAttribute(ui::AX_ATTR_NAME, web_name.Utf8()); | 410 dst->AddStringAttribute(ui::AX_ATTR_NAME, web_name.Utf8()); |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 return WebAXObject(); | 892 return WebAXObject(); |
| 891 | 893 |
| 892 WebDocument document = render_frame_->GetWebFrame()->GetDocument(); | 894 WebDocument document = render_frame_->GetWebFrame()->GetDocument(); |
| 893 if (!document.IsNull()) | 895 if (!document.IsNull()) |
| 894 return WebAXObject::FromWebDocument(document); | 896 return WebAXObject::FromWebDocument(document); |
| 895 | 897 |
| 896 return WebAXObject(); | 898 return WebAXObject(); |
| 897 } | 899 } |
| 898 | 900 |
| 899 } // namespace content | 901 } // namespace content |
| OLD | NEW |