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 "components/test_runner/web_ax_object_proxy.h" | 5 #include "components/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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 .SetProperty("isChecked", &WebAXObjectProxy::IsChecked) | 510 .SetProperty("isChecked", &WebAXObjectProxy::IsChecked) |
511 .SetProperty("isVisible", &WebAXObjectProxy::IsVisible) | 511 .SetProperty("isVisible", &WebAXObjectProxy::IsVisible) |
512 .SetProperty("isOffScreen", &WebAXObjectProxy::IsOffScreen) | 512 .SetProperty("isOffScreen", &WebAXObjectProxy::IsOffScreen) |
513 .SetProperty("isCollapsed", &WebAXObjectProxy::IsCollapsed) | 513 .SetProperty("isCollapsed", &WebAXObjectProxy::IsCollapsed) |
514 .SetProperty("hasPopup", &WebAXObjectProxy::HasPopup) | 514 .SetProperty("hasPopup", &WebAXObjectProxy::HasPopup) |
515 .SetProperty("isValid", &WebAXObjectProxy::IsValid) | 515 .SetProperty("isValid", &WebAXObjectProxy::IsValid) |
516 .SetProperty("isReadOnly", &WebAXObjectProxy::IsReadOnly) | 516 .SetProperty("isReadOnly", &WebAXObjectProxy::IsReadOnly) |
517 .SetProperty("backgroundColor", &WebAXObjectProxy::BackgroundColor) | 517 .SetProperty("backgroundColor", &WebAXObjectProxy::BackgroundColor) |
518 .SetProperty("color", &WebAXObjectProxy::Color) | 518 .SetProperty("color", &WebAXObjectProxy::Color) |
519 .SetProperty("colorValue", &WebAXObjectProxy::ColorValue) | 519 .SetProperty("colorValue", &WebAXObjectProxy::ColorValue) |
| 520 .SetProperty("fontFamily", &WebAXObjectProxy::FontFamily) |
520 .SetProperty("fontSize", &WebAXObjectProxy::FontSize) | 521 .SetProperty("fontSize", &WebAXObjectProxy::FontSize) |
521 .SetProperty("orientation", &WebAXObjectProxy::Orientation) | 522 .SetProperty("orientation", &WebAXObjectProxy::Orientation) |
522 .SetProperty("posInSet", &WebAXObjectProxy::PosInSet) | 523 .SetProperty("posInSet", &WebAXObjectProxy::PosInSet) |
523 .SetProperty("setSize", &WebAXObjectProxy::SetSize) | 524 .SetProperty("setSize", &WebAXObjectProxy::SetSize) |
524 .SetProperty("clickPointX", &WebAXObjectProxy::ClickPointX) | 525 .SetProperty("clickPointX", &WebAXObjectProxy::ClickPointX) |
525 .SetProperty("clickPointY", &WebAXObjectProxy::ClickPointY) | 526 .SetProperty("clickPointY", &WebAXObjectProxy::ClickPointY) |
526 .SetProperty("rowCount", &WebAXObjectProxy::RowCount) | 527 .SetProperty("rowCount", &WebAXObjectProxy::RowCount) |
527 .SetProperty("rowHeadersCount", &WebAXObjectProxy::RowHeadersCount) | 528 .SetProperty("rowHeadersCount", &WebAXObjectProxy::RowHeadersCount) |
528 .SetProperty("columnCount", &WebAXObjectProxy::ColumnCount) | 529 .SetProperty("columnCount", &WebAXObjectProxy::ColumnCount) |
529 .SetProperty("columnHeadersCount", &WebAXObjectProxy::ColumnHeadersCount) | 530 .SetProperty("columnHeadersCount", &WebAXObjectProxy::ColumnHeadersCount) |
(...skipping 13 matching lines...) Expand all Loading... |
543 .SetMethod("childAtIndex", &WebAXObjectProxy::ChildAtIndex) | 544 .SetMethod("childAtIndex", &WebAXObjectProxy::ChildAtIndex) |
544 .SetMethod("elementAtPoint", &WebAXObjectProxy::ElementAtPoint) | 545 .SetMethod("elementAtPoint", &WebAXObjectProxy::ElementAtPoint) |
545 .SetMethod("tableHeader", &WebAXObjectProxy::TableHeader) | 546 .SetMethod("tableHeader", &WebAXObjectProxy::TableHeader) |
546 .SetMethod("rowHeaderAtIndex", &WebAXObjectProxy::RowHeaderAtIndex) | 547 .SetMethod("rowHeaderAtIndex", &WebAXObjectProxy::RowHeaderAtIndex) |
547 .SetMethod("columnHeaderAtIndex", &WebAXObjectProxy::ColumnHeaderAtIndex) | 548 .SetMethod("columnHeaderAtIndex", &WebAXObjectProxy::ColumnHeaderAtIndex) |
548 .SetMethod("rowIndexRange", &WebAXObjectProxy::RowIndexRange) | 549 .SetMethod("rowIndexRange", &WebAXObjectProxy::RowIndexRange) |
549 .SetMethod("columnIndexRange", &WebAXObjectProxy::ColumnIndexRange) | 550 .SetMethod("columnIndexRange", &WebAXObjectProxy::ColumnIndexRange) |
550 .SetMethod("cellForColumnAndRow", &WebAXObjectProxy::CellForColumnAndRow) | 551 .SetMethod("cellForColumnAndRow", &WebAXObjectProxy::CellForColumnAndRow) |
551 .SetMethod("setSelectedTextRange", | 552 .SetMethod("setSelectedTextRange", |
552 &WebAXObjectProxy::SetSelectedTextRange) | 553 &WebAXObjectProxy::SetSelectedTextRange) |
553 .SetMethod("setSelection", | 554 .SetMethod("setSelection", &WebAXObjectProxy::SetSelection) |
554 &WebAXObjectProxy::SetSelection) | |
555 .SetMethod("isAttributeSettable", &WebAXObjectProxy::IsAttributeSettable) | 555 .SetMethod("isAttributeSettable", &WebAXObjectProxy::IsAttributeSettable) |
556 .SetMethod("isPressActionSupported", | 556 .SetMethod("isPressActionSupported", |
557 &WebAXObjectProxy::IsPressActionSupported) | 557 &WebAXObjectProxy::IsPressActionSupported) |
558 .SetMethod("isIncrementActionSupported", | 558 .SetMethod("isIncrementActionSupported", |
559 &WebAXObjectProxy::IsIncrementActionSupported) | 559 &WebAXObjectProxy::IsIncrementActionSupported) |
560 .SetMethod("isDecrementActionSupported", | 560 .SetMethod("isDecrementActionSupported", |
561 &WebAXObjectProxy::IsDecrementActionSupported) | 561 &WebAXObjectProxy::IsDecrementActionSupported) |
562 .SetMethod("parentElement", &WebAXObjectProxy::ParentElement) | 562 .SetMethod("parentElement", &WebAXObjectProxy::ParentElement) |
563 .SetMethod("increment", &WebAXObjectProxy::Increment) | 563 .SetMethod("increment", &WebAXObjectProxy::Increment) |
564 .SetMethod("decrement", &WebAXObjectProxy::Decrement) | 564 .SetMethod("decrement", &WebAXObjectProxy::Decrement) |
(...skipping 25 matching lines...) Expand all Loading... |
590 .SetProperty("name", &WebAXObjectProxy::Name) | 590 .SetProperty("name", &WebAXObjectProxy::Name) |
591 .SetProperty("nameFrom", &WebAXObjectProxy::NameFrom) | 591 .SetProperty("nameFrom", &WebAXObjectProxy::NameFrom) |
592 .SetMethod("nameElementCount", &WebAXObjectProxy::NameElementCount) | 592 .SetMethod("nameElementCount", &WebAXObjectProxy::NameElementCount) |
593 .SetMethod("nameElementAtIndex", &WebAXObjectProxy::NameElementAtIndex) | 593 .SetMethod("nameElementAtIndex", &WebAXObjectProxy::NameElementAtIndex) |
594 .SetProperty("description", &WebAXObjectProxy::Description) | 594 .SetProperty("description", &WebAXObjectProxy::Description) |
595 .SetProperty("descriptionFrom", &WebAXObjectProxy::DescriptionFrom) | 595 .SetProperty("descriptionFrom", &WebAXObjectProxy::DescriptionFrom) |
596 .SetMethod("descriptionElementCount", | 596 .SetMethod("descriptionElementCount", |
597 &WebAXObjectProxy::DescriptionElementCount) | 597 &WebAXObjectProxy::DescriptionElementCount) |
598 .SetMethod("descriptionElementAtIndex", | 598 .SetMethod("descriptionElementAtIndex", |
599 &WebAXObjectProxy::DescriptionElementAtIndex); | 599 &WebAXObjectProxy::DescriptionElementAtIndex); |
600 | |
601 } | 600 } |
602 | 601 |
603 v8::Local<v8::Object> WebAXObjectProxy::GetChildAtIndex(unsigned index) { | 602 v8::Local<v8::Object> WebAXObjectProxy::GetChildAtIndex(unsigned index) { |
604 return factory_->GetOrCreate(accessibility_object_.childAt(index)); | 603 return factory_->GetOrCreate(accessibility_object_.childAt(index)); |
605 } | 604 } |
606 | 605 |
607 bool WebAXObjectProxy::IsRoot() const { | 606 bool WebAXObjectProxy::IsRoot() const { |
608 return false; | 607 return false; |
609 } | 608 } |
610 | 609 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 // Remove the alpha because it's always 1 and thus not informative. | 888 // Remove the alpha because it's always 1 and thus not informative. |
890 return color & 0xFFFFFF; | 889 return color & 0xFFFFFF; |
891 } | 890 } |
892 | 891 |
893 // For input elements of type color. | 892 // For input elements of type color. |
894 unsigned int WebAXObjectProxy::ColorValue() { | 893 unsigned int WebAXObjectProxy::ColorValue() { |
895 accessibility_object_.updateLayoutAndCheckValidity(); | 894 accessibility_object_.updateLayoutAndCheckValidity(); |
896 return accessibility_object_.colorValue(); | 895 return accessibility_object_.colorValue(); |
897 } | 896 } |
898 | 897 |
| 898 std::string WebAXObjectProxy::FontFamily() { |
| 899 accessibility_object_.updateLayoutAndCheckValidity(); |
| 900 std::string font_family(accessibility_object_.fontFamily().utf8()); |
| 901 return font_family.insert(0, "AXFontFamily: "); |
| 902 } |
| 903 |
899 float WebAXObjectProxy::FontSize() { | 904 float WebAXObjectProxy::FontSize() { |
900 accessibility_object_.updateLayoutAndCheckValidity(); | 905 accessibility_object_.updateLayoutAndCheckValidity(); |
901 return accessibility_object_.fontSize(); | 906 return accessibility_object_.fontSize(); |
902 } | 907 } |
903 | 908 |
904 std::string WebAXObjectProxy::Orientation() { | 909 std::string WebAXObjectProxy::Orientation() { |
905 accessibility_object_.updateLayoutAndCheckValidity(); | 910 accessibility_object_.updateLayoutAndCheckValidity(); |
906 if (accessibility_object_.orientation() == blink::WebAXOrientationVertical) | 911 if (accessibility_object_.orientation() == blink::WebAXOrientationVertical) |
907 return "AXOrientation: AXVerticalOrientation"; | 912 return "AXOrientation: AXVerticalOrientation"; |
908 else if (accessibility_object_.orientation() | 913 else if (accessibility_object_.orientation() |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 v8::Local<v8::Value> value_handle = gin::CreateHandle( | 1483 v8::Local<v8::Value> value_handle = gin::CreateHandle( |
1479 isolate, new WebAXObjectProxy(object, this)).ToV8(); | 1484 isolate, new WebAXObjectProxy(object, this)).ToV8(); |
1480 if (value_handle.IsEmpty()) | 1485 if (value_handle.IsEmpty()) |
1481 return v8::Local<v8::Object>(); | 1486 return v8::Local<v8::Object>(); |
1482 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); | 1487 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); |
1483 elements_.Append(handle); | 1488 elements_.Append(handle); |
1484 return handle; | 1489 return handle; |
1485 } | 1490 } |
1486 | 1491 |
1487 } // namespace test_runner | 1492 } // namespace test_runner |
OLD | NEW |