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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 if (role != GroupRole && role != UnknownRole) | 1177 if (role != GroupRole && role != UnknownRole) |
1178 break; | 1178 break; |
1179 } | 1179 } |
1180 } | 1180 } |
1181 | 1181 |
1182 return String(); | 1182 return String(); |
1183 } | 1183 } |
1184 | 1184 |
1185 LayoutRect AccessibilityNodeObject::elementRect() const | 1185 LayoutRect AccessibilityNodeObject::elementRect() const |
1186 { | 1186 { |
| 1187 // First check if it has a custom rect, for example if this element is tied
to a canvas path. |
| 1188 if (!m_explicitElementRect.isEmpty()) |
| 1189 return m_explicitElementRect; |
| 1190 |
1187 // AccessibilityNodeObjects have no mechanism yet to return a size or positi
on. | 1191 // AccessibilityNodeObjects have no mechanism yet to return a size or positi
on. |
1188 // For now, let's return the position of the ancestor that does have a posit
ion, | 1192 // For now, let's return the position of the ancestor that does have a posit
ion, |
1189 // and make it the width of that parent, and about the height of a line of t
ext, so that it's clear the object is a child of the parent. | 1193 // and make it the width of that parent, and about the height of a line of t
ext, so that it's clear the object is a child of the parent. |
1190 | 1194 |
1191 LayoutRect boundingBox; | 1195 LayoutRect boundingBox; |
1192 | 1196 |
1193 for (AccessibilityObject* positionProvider = parentObject(); positionProvide
r; positionProvider = positionProvider->parentObject()) { | 1197 for (AccessibilityObject* positionProvider = parentObject(); positionProvide
r; positionProvider = positionProvider->parentObject()) { |
1194 if (positionProvider->isAccessibilityRenderObject()) { | 1198 if (positionProvider->isAccessibilityRenderObject()) { |
1195 LayoutRect parentRect = positionProvider->elementRect(); | 1199 LayoutRect parentRect = positionProvider->elementRect(); |
1196 boundingBox.setSize(LayoutSize(parentRect.width(), LayoutUnit(std::m
in(10.0f, parentRect.height().toFloat())))); | 1200 boundingBox.setSize(LayoutSize(parentRect.width(), LayoutUnit(std::m
in(10.0f, parentRect.height().toFloat())))); |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 useTextUnderElement = true; | 1670 useTextUnderElement = true; |
1667 | 1671 |
1668 if (useTextUnderElement) { | 1672 if (useTextUnderElement) { |
1669 String text = textUnderElement(); | 1673 String text = textUnderElement(); |
1670 if (!text.isEmpty()) | 1674 if (!text.isEmpty()) |
1671 textOrder.append(AccessibilityText(text, ChildrenText)); | 1675 textOrder.append(AccessibilityText(text, ChildrenText)); |
1672 } | 1676 } |
1673 } | 1677 } |
1674 | 1678 |
1675 } // namespace WebCore | 1679 } // namespace WebCore |
OLD | NEW |