| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 return accessibilityDescriptionForElements(elements); | 1112 return accessibilityDescriptionForElements(elements); |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 AccessibilityRole AXNodeObject::ariaRoleAttribute() const | 1115 AccessibilityRole AXNodeObject::ariaRoleAttribute() const |
| 1116 { | 1116 { |
| 1117 return m_ariaRole; | 1117 return m_ariaRole; |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 // When building the textUnderElement for an object, determine whether or not | 1120 // When building the textUnderElement for an object, determine whether or not |
| 1121 // we should include the inner text of this given descendant object or skip it. | 1121 // we should include the inner text of this given descendant object or skip it. |
| 1122 static bool shouldUseAccessiblityObjectInnerText(AXObject* obj) | 1122 static bool shouldUseAccessibilityObjectInnerText(AXObject* obj) |
| 1123 { | 1123 { |
| 1124 // Consider this hypothetical example: | 1124 // Consider this hypothetical example: |
| 1125 // <div tabindex=0> | 1125 // <div tabindex=0> |
| 1126 // <h2> | 1126 // <h2> |
| 1127 // Table of contents | 1127 // Table of contents |
| 1128 // </h2> | 1128 // </h2> |
| 1129 // <a href="#start">Jump to start of book</a> | 1129 // <a href="#start">Jump to start of book</a> |
| 1130 // <ul> | 1130 // <ul> |
| 1131 // <li><a href="#1">Chapter 1</a></li> | 1131 // <li><a href="#1">Chapter 1</a></li> |
| 1132 // <li><a href="#1">Chapter 2</a></li> | 1132 // <li><a href="#1">Chapter 2</a></li> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1154 } | 1154 } |
| 1155 | 1155 |
| 1156 String AXNodeObject::textUnderElement() const | 1156 String AXNodeObject::textUnderElement() const |
| 1157 { | 1157 { |
| 1158 Node* node = this->node(); | 1158 Node* node = this->node(); |
| 1159 if (node && node->isTextNode()) | 1159 if (node && node->isTextNode()) |
| 1160 return toText(node)->wholeText(); | 1160 return toText(node)->wholeText(); |
| 1161 | 1161 |
| 1162 StringBuilder builder; | 1162 StringBuilder builder; |
| 1163 for (AXObject* child = firstChild(); child; child = child->nextSibling()) { | 1163 for (AXObject* child = firstChild(); child; child = child->nextSibling()) { |
| 1164 if (!shouldUseAccessiblityObjectInnerText(child)) | 1164 if (!shouldUseAccessibilityObjectInnerText(child)) |
| 1165 continue; | 1165 continue; |
| 1166 | 1166 |
| 1167 if (child->isAXNodeObject()) { | 1167 if (child->isAXNodeObject()) { |
| 1168 Vector<AccessibilityText> textOrder; | 1168 Vector<AccessibilityText> textOrder; |
| 1169 toAXNodeObject(child)->alternativeText(textOrder); | 1169 toAXNodeObject(child)->alternativeText(textOrder); |
| 1170 if (textOrder.size() > 0) { | 1170 if (textOrder.size() > 0) { |
| 1171 builder.append(textOrder[0].text); | 1171 builder.append(textOrder[0].text); |
| 1172 continue; | 1172 continue; |
| 1173 } | 1173 } |
| 1174 } | 1174 } |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 float range = maxValueForRange() - minValueForRange(); | 1772 float range = maxValueForRange() - minValueForRange(); |
| 1773 float value = valueForRange(); | 1773 float value = valueForRange(); |
| 1774 | 1774 |
| 1775 value += range * (percentChange / 100); | 1775 value += range * (percentChange / 100); |
| 1776 setValue(String::number(value)); | 1776 setValue(String::number(value)); |
| 1777 | 1777 |
| 1778 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged,
true); | 1778 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged,
true); |
| 1779 } | 1779 } |
| 1780 | 1780 |
| 1781 } // namespace blink | 1781 } // namespace blink |
| OLD | NEW |