| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 IntPoint AXRenderObject::clickPoint() | 1244 IntPoint AXRenderObject::clickPoint() |
| 1245 { | 1245 { |
| 1246 // Headings are usually much wider than their textual content. If the mid po
int is used, often it can be wrong. | 1246 // Headings are usually much wider than their textual content. If the mid po
int is used, often it can be wrong. |
| 1247 if (isHeading() && children().size() == 1) | 1247 if (isHeading() && children().size() == 1) |
| 1248 return children()[0]->clickPoint(); | 1248 return children()[0]->clickPoint(); |
| 1249 | 1249 |
| 1250 // use the default position unless this is an editable web area, in which ca
se we use the selection bounds. | 1250 // use the default position unless this is an editable web area, in which ca
se we use the selection bounds. |
| 1251 if (!isWebArea() || isReadOnly()) | 1251 if (!isWebArea() || isReadOnly()) |
| 1252 return AXObject::clickPoint(); | 1252 return AXObject::clickPoint(); |
| 1253 | 1253 |
| 1254 LayoutRect bounds = elementRect(); | 1254 IntRect bounds = pixelSnappedIntRect(elementRect()); |
| 1255 return IntPoint(bounds.x() + (bounds.width() / 2), bounds.y() - (bounds.heig
ht() / 2)); | 1255 return IntPoint(bounds.x() + (bounds.width() / 2), bounds.y() - (bounds.heig
ht() / 2)); |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 // | 1258 // |
| 1259 // Hit testing. | 1259 // Hit testing. |
| 1260 // | 1260 // |
| 1261 | 1261 |
| 1262 AXObject* AXRenderObject::accessibilityHitTest(const IntPoint& point) const | 1262 AXObject* AXRenderObject::accessibilityHitTest(const IntPoint& point) const |
| 1263 { | 1263 { |
| 1264 if (!m_renderer || !m_renderer->hasLayer()) | 1264 if (!m_renderer || !m_renderer->hasLayer()) |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2307 if (label && label->renderer()) { | 2307 if (label && label->renderer()) { |
| 2308 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2308 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
| 2309 result.unite(labelRect); | 2309 result.unite(labelRect); |
| 2310 } | 2310 } |
| 2311 } | 2311 } |
| 2312 | 2312 |
| 2313 return result; | 2313 return result; |
| 2314 } | 2314 } |
| 2315 | 2315 |
| 2316 } // namespace WebCore | 2316 } // namespace WebCore |
| OLD | NEW |