| 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 ScrollableArea* AXRenderObject::getScrollableAreaIfScrollable() const | 241 ScrollableArea* AXRenderObject::getScrollableAreaIfScrollable() const |
| 242 { | 242 { |
| 243 // If the parent is a FrameView, then this object isn't really scrollable; t
he parent should handle the scrolling. | 243 // If the parent is a FrameView, then this object isn't really scrollable; t
he parent should handle the scrolling. |
| 244 if (parentObject() && parentObject()->isAXScrollView()) | 244 if (parentObject() && parentObject()->isAXScrollView()) |
| 245 return 0; | 245 return 0; |
| 246 | 246 |
| 247 if (!m_renderer || !m_renderer->isBox()) | 247 if (!m_renderer || !m_renderer->isBox()) |
| 248 return 0; | 248 return 0; |
| 249 | 249 |
| 250 RenderBox* box = toRenderBox(m_renderer); | 250 LayoutBox* box = toLayoutBox(m_renderer); |
| 251 if (!box->canBeScrolledAndHasScrollableArea()) | 251 if (!box->canBeScrolledAndHasScrollableArea()) |
| 252 return 0; | 252 return 0; |
| 253 | 253 |
| 254 return box->scrollableArea(); | 254 return box->scrollableArea(); |
| 255 } | 255 } |
| 256 | 256 |
| 257 static bool isImageOrAltText(LayoutBoxModelObject* box, Node* node) | 257 static bool isImageOrAltText(LayoutBoxModelObject* box, Node* node) |
| 258 { | 258 { |
| 259 if (box && box->isImage()) | 259 if (box && box->isImage()) |
| 260 return true; | 260 return true; |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 if (m_cachedElementRectDirty) | 1260 if (m_cachedElementRectDirty) |
| 1261 return; | 1261 return; |
| 1262 | 1262 |
| 1263 if (!m_renderer) | 1263 if (!m_renderer) |
| 1264 return; | 1264 return; |
| 1265 | 1265 |
| 1266 if (!m_renderer->isBox()) | 1266 if (!m_renderer->isBox()) |
| 1267 return; | 1267 return; |
| 1268 | 1268 |
| 1269 bool dirty = false; | 1269 bool dirty = false; |
| 1270 RenderBox* box = toRenderBox(m_renderer); | 1270 LayoutBox* box = toLayoutBox(m_renderer); |
| 1271 if (box->frameRect() != m_cachedFrameRect) | 1271 if (box->frameRect() != m_cachedFrameRect) |
| 1272 dirty = true; | 1272 dirty = true; |
| 1273 | 1273 |
| 1274 if (box->canBeScrolledAndHasScrollableArea()) { | 1274 if (box->canBeScrolledAndHasScrollableArea()) { |
| 1275 ScrollableArea* scrollableArea = box->scrollableArea(); | 1275 ScrollableArea* scrollableArea = box->scrollableArea(); |
| 1276 if (scrollableArea && scrollableArea->scrollPosition() != m_cachedScroll
Position) | 1276 if (scrollableArea && scrollableArea->scrollPosition() != m_cachedScroll
Position) |
| 1277 dirty = true; | 1277 dirty = true; |
| 1278 } | 1278 } |
| 1279 | 1279 |
| 1280 if (dirty) | 1280 if (dirty) |
| 1281 markCachedElementRectDirty(); | 1281 markCachedElementRectDirty(); |
| 1282 } | 1282 } |
| 1283 | 1283 |
| 1284 void AXRenderObject::updateCachedElementRect() const | 1284 void AXRenderObject::updateCachedElementRect() const |
| 1285 { | 1285 { |
| 1286 if (!m_cachedElementRectDirty) | 1286 if (!m_cachedElementRectDirty) |
| 1287 return; | 1287 return; |
| 1288 | 1288 |
| 1289 if (!m_renderer) | 1289 if (!m_renderer) |
| 1290 return; | 1290 return; |
| 1291 | 1291 |
| 1292 if (!m_renderer->isBox()) | 1292 if (!m_renderer->isBox()) |
| 1293 return; | 1293 return; |
| 1294 | 1294 |
| 1295 RenderBox* box = toRenderBox(m_renderer); | 1295 LayoutBox* box = toLayoutBox(m_renderer); |
| 1296 m_cachedFrameRect = box->frameRect(); | 1296 m_cachedFrameRect = box->frameRect(); |
| 1297 | 1297 |
| 1298 if (box->canBeScrolledAndHasScrollableArea()) { | 1298 if (box->canBeScrolledAndHasScrollableArea()) { |
| 1299 ScrollableArea* scrollableArea = box->scrollableArea(); | 1299 ScrollableArea* scrollableArea = box->scrollableArea(); |
| 1300 if (scrollableArea) | 1300 if (scrollableArea) |
| 1301 m_cachedScrollPosition = scrollableArea->scrollPosition(); | 1301 m_cachedScrollPosition = scrollableArea->scrollPosition(); |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 m_cachedElementRect = computeElementRect(); | 1304 m_cachedElementRect = computeElementRect(); |
| 1305 m_cachedElementRectDirty = false; | 1305 m_cachedElementRectDirty = false; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1332 | 1332 |
| 1333 // | 1333 // |
| 1334 // Hit testing. | 1334 // Hit testing. |
| 1335 // | 1335 // |
| 1336 | 1336 |
| 1337 AXObject* AXRenderObject::accessibilityHitTest(const IntPoint& point) const | 1337 AXObject* AXRenderObject::accessibilityHitTest(const IntPoint& point) const |
| 1338 { | 1338 { |
| 1339 if (!m_renderer || !m_renderer->hasLayer()) | 1339 if (!m_renderer || !m_renderer->hasLayer()) |
| 1340 return 0; | 1340 return 0; |
| 1341 | 1341 |
| 1342 Layer* layer = toRenderBox(m_renderer)->layer(); | 1342 Layer* layer = toLayoutBox(m_renderer)->layer(); |
| 1343 | 1343 |
| 1344 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); | 1344 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 1345 HitTestResult hitTestResult = HitTestResult(point); | 1345 HitTestResult hitTestResult = HitTestResult(point); |
| 1346 layer->hitTest(request, hitTestResult); | 1346 layer->hitTest(request, hitTestResult); |
| 1347 if (!hitTestResult.innerNode()) | 1347 if (!hitTestResult.innerNode()) |
| 1348 return 0; | 1348 return 0; |
| 1349 | 1349 |
| 1350 Node* node = hitTestResult.innerNode(); | 1350 Node* node = hitTestResult.innerNode(); |
| 1351 | 1351 |
| 1352 // Allow the hit test to return media control buttons. | 1352 // Allow the hit test to return media control buttons. |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1714 else if (renderer->isTextArea() && isHTMLTextAreaElement(*node())) | 1714 else if (renderer->isTextArea() && isHTMLTextAreaElement(*node())) |
| 1715 toHTMLTextAreaElement(*node()).setValue(string); | 1715 toHTMLTextAreaElement(*node()).setValue(string); |
| 1716 } | 1716 } |
| 1717 | 1717 |
| 1718 // FIXME: This function should use an IntSize to avoid the conversion below. | 1718 // FIXME: This function should use an IntSize to avoid the conversion below. |
| 1719 void AXRenderObject::scrollTo(const IntPoint& point) const | 1719 void AXRenderObject::scrollTo(const IntPoint& point) const |
| 1720 { | 1720 { |
| 1721 if (!m_renderer || !m_renderer->isBox()) | 1721 if (!m_renderer || !m_renderer->isBox()) |
| 1722 return; | 1722 return; |
| 1723 | 1723 |
| 1724 RenderBox* box = toRenderBox(m_renderer); | 1724 LayoutBox* box = toLayoutBox(m_renderer); |
| 1725 if (!box->canBeScrolledAndHasScrollableArea()) | 1725 if (!box->canBeScrolledAndHasScrollableArea()) |
| 1726 return; | 1726 return; |
| 1727 | 1727 |
| 1728 box->scrollToOffset(IntSize(point.x(), point.y())); | 1728 box->scrollToOffset(IntSize(point.x(), point.y())); |
| 1729 } | 1729 } |
| 1730 | 1730 |
| 1731 // | 1731 // |
| 1732 // Notifications that this object may have changed. | 1732 // Notifications that this object may have changed. |
| 1733 // | 1733 // |
| 1734 | 1734 |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2411 if (label && label->renderer()) { | 2411 if (label && label->renderer()) { |
| 2412 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2412 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
| 2413 result.unite(labelRect); | 2413 result.unite(labelRect); |
| 2414 } | 2414 } |
| 2415 } | 2415 } |
| 2416 | 2416 |
| 2417 return result; | 2417 return result; |
| 2418 } | 2418 } |
| 2419 | 2419 |
| 2420 } // namespace blink | 2420 } // namespace blink |
| OLD | NEW |