OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014, Google Inc. All rights reserved. | 2 * Copyright (C) 2014, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 if (targetAXObject && !targetAXObject->children().isEmpty()) | 1067 if (targetAXObject && !targetAXObject->children().isEmpty()) |
1068 targetAXObject = targetAXObject->children()[0].get(); | 1068 targetAXObject = targetAXObject->children()[0].get(); |
1069 postPlatformNotification(targetAXObject, AXScrollPositionChanged); | 1069 postPlatformNotification(targetAXObject, AXScrollPositionChanged); |
1070 } | 1070 } |
1071 | 1071 |
1072 void AXObjectCacheImpl::handleScrollPositionChanged(RenderObject* renderObject) | 1072 void AXObjectCacheImpl::handleScrollPositionChanged(RenderObject* renderObject) |
1073 { | 1073 { |
1074 postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged)
; | 1074 postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged)
; |
1075 } | 1075 } |
1076 | 1076 |
| 1077 const AtomicString& AXObjectCacheImpl::computedRoleForNode(Node* node) |
| 1078 { |
| 1079 AXObject* obj = getOrCreate(node); |
| 1080 if (!obj) |
| 1081 return AXObject::roleName(UnknownRole); |
| 1082 return AXObject::roleName(obj->roleValue()); |
| 1083 } |
| 1084 |
| 1085 String AXObjectCacheImpl::computedNameForNode(Node* node) |
| 1086 { |
| 1087 AXObject* obj = getOrCreate(node); |
| 1088 if (!obj) |
| 1089 return ""; |
| 1090 |
| 1091 String title = obj->title(); |
| 1092 |
| 1093 String titleUIText; |
| 1094 if (title.isEmpty()) { |
| 1095 AXObject* titleUIElement = obj->titleUIElement(); |
| 1096 if (titleUIElement) { |
| 1097 titleUIText = titleUIElement->textUnderElement(); |
| 1098 if (!titleUIText.isEmpty()) |
| 1099 return titleUIText; |
| 1100 } |
| 1101 } |
| 1102 |
| 1103 String description = obj->accessibilityDescription(); |
| 1104 if (!description.isEmpty()) |
| 1105 return description; |
| 1106 |
| 1107 if (!title.isEmpty()) |
| 1108 return title; |
| 1109 |
| 1110 String placeholder; |
| 1111 if (isHTMLInputElement(node)) { |
| 1112 HTMLInputElement* element = toHTMLInputElement(node); |
| 1113 placeholder = element->strippedPlaceholder(); |
| 1114 if (!placeholder.isEmpty()) |
| 1115 return placeholder; |
| 1116 } |
| 1117 |
| 1118 return String(); |
| 1119 } |
| 1120 |
1077 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect
& rect) | 1121 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect
& rect) |
1078 { | 1122 { |
1079 AXObject* obj = getOrCreate(element); | 1123 AXObject* obj = getOrCreate(element); |
1080 if (!obj) | 1124 if (!obj) |
1081 return; | 1125 return; |
1082 | 1126 |
1083 obj->setElementRect(rect); | 1127 obj->setElementRect(rect); |
1084 } | 1128 } |
1085 | 1129 |
1086 } // namespace blink | 1130 } // namespace blink |
OLD | NEW |