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/shell/test_runner/web_ax_object_proxy.h" | 5 #include "content/shell/test_runner/web_ax_object_proxy.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 return accessibility_object_.IsSelectedOptionActive(); | 1013 return accessibility_object_.IsSelectedOptionActive(); |
1014 } | 1014 } |
1015 | 1015 |
1016 bool WebAXObjectProxy::IsExpanded() { | 1016 bool WebAXObjectProxy::IsExpanded() { |
1017 accessibility_object_.UpdateLayoutAndCheckValidity(); | 1017 accessibility_object_.UpdateLayoutAndCheckValidity(); |
1018 return accessibility_object_.IsExpanded() == blink::kWebAXExpandedExpanded; | 1018 return accessibility_object_.IsExpanded() == blink::kWebAXExpandedExpanded; |
1019 } | 1019 } |
1020 | 1020 |
1021 bool WebAXObjectProxy::IsChecked() { | 1021 bool WebAXObjectProxy::IsChecked() { |
1022 accessibility_object_.UpdateLayoutAndCheckValidity(); | 1022 accessibility_object_.UpdateLayoutAndCheckValidity(); |
1023 return accessibility_object_.IsChecked(); | 1023 return accessibility_object_.CheckedState() != blink::WebAXCheckedFalse; |
1024 } | 1024 } |
1025 | 1025 |
1026 bool WebAXObjectProxy::IsCollapsed() { | 1026 bool WebAXObjectProxy::IsCollapsed() { |
1027 accessibility_object_.UpdateLayoutAndCheckValidity(); | 1027 accessibility_object_.UpdateLayoutAndCheckValidity(); |
1028 return accessibility_object_.IsExpanded() == blink::kWebAXExpandedCollapsed; | 1028 return accessibility_object_.IsExpanded() == blink::kWebAXExpandedCollapsed; |
1029 } | 1029 } |
1030 | 1030 |
1031 bool WebAXObjectProxy::IsVisible() { | 1031 bool WebAXObjectProxy::IsVisible() { |
1032 accessibility_object_.UpdateLayoutAndCheckValidity(); | 1032 accessibility_object_.UpdateLayoutAndCheckValidity(); |
1033 return accessibility_object_.IsVisible(); | 1033 return accessibility_object_.IsVisible(); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 return static_cast<int32_t>(headers.size()); | 1226 return static_cast<int32_t>(headers.size()); |
1227 } | 1227 } |
1228 | 1228 |
1229 bool WebAXObjectProxy::IsClickable() { | 1229 bool WebAXObjectProxy::IsClickable() { |
1230 accessibility_object_.UpdateLayoutAndCheckValidity(); | 1230 accessibility_object_.UpdateLayoutAndCheckValidity(); |
1231 return accessibility_object_.IsClickable(); | 1231 return accessibility_object_.IsClickable(); |
1232 } | 1232 } |
1233 | 1233 |
1234 bool WebAXObjectProxy::IsButtonStateMixed() { | 1234 bool WebAXObjectProxy::IsButtonStateMixed() { |
1235 accessibility_object_.UpdateLayoutAndCheckValidity(); | 1235 accessibility_object_.UpdateLayoutAndCheckValidity(); |
1236 return accessibility_object_.IsButtonStateMixed(); | 1236 return accessibility_object_.CheckedState() == blink::WebAXCheckedMixed; |
1237 } | 1237 } |
1238 | 1238 |
1239 v8::Local<v8::Object> WebAXObjectProxy::AriaControlsElementAtIndex( | 1239 v8::Local<v8::Object> WebAXObjectProxy::AriaControlsElementAtIndex( |
1240 unsigned index) { | 1240 unsigned index) { |
1241 accessibility_object_.UpdateLayoutAndCheckValidity(); | 1241 accessibility_object_.UpdateLayoutAndCheckValidity(); |
1242 SparseAttributeAdapter attribute_adapter; | 1242 SparseAttributeAdapter attribute_adapter; |
1243 accessibility_object_.GetSparseAXAttributes(attribute_adapter); | 1243 accessibility_object_.GetSparseAXAttributes(attribute_adapter); |
1244 blink::WebVector<blink::WebAXObject> elements = | 1244 blink::WebVector<blink::WebAXObject> elements = |
1245 attribute_adapter.object_vector_attributes | 1245 attribute_adapter.object_vector_attributes |
1246 [blink::WebAXObjectVectorAttribute::kAriaControls]; | 1246 [blink::WebAXObjectVectorAttribute::kAriaControls]; |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 v8::Local<v8::Value> value_handle = | 1854 v8::Local<v8::Value> value_handle = |
1855 gin::CreateHandle(isolate, new WebAXObjectProxy(object, this)).ToV8(); | 1855 gin::CreateHandle(isolate, new WebAXObjectProxy(object, this)).ToV8(); |
1856 if (value_handle.IsEmpty()) | 1856 if (value_handle.IsEmpty()) |
1857 return v8::Local<v8::Object>(); | 1857 return v8::Local<v8::Object>(); |
1858 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); | 1858 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); |
1859 elements_.Append(handle); | 1859 elements_.Append(handle); |
1860 return handle; | 1860 return handle; |
1861 } | 1861 } |
1862 | 1862 |
1863 } // namespace test_runner | 1863 } // namespace test_runner |
OLD | NEW |