| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 bool RenderLayer::hitTest(const HitTestRequest& request, const HitTestLocation&
hitTestLocation, HitTestResult& result) | 1572 bool RenderLayer::hitTest(const HitTestRequest& request, const HitTestLocation&
hitTestLocation, HitTestResult& result) |
| 1573 { | 1573 { |
| 1574 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); | 1574 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); |
| 1575 | 1575 |
| 1576 // RenderView should make sure to update layout before entering hit testing | 1576 // RenderView should make sure to update layout before entering hit testing |
| 1577 ASSERT(!renderer()->frame()->view()->layoutPending()); | 1577 ASSERT(!renderer()->frame()->view()->layoutPending()); |
| 1578 ASSERT(!renderer()->document().renderView()->needsLayout()); | 1578 ASSERT(!renderer()->document().renderView()->needsLayout()); |
| 1579 | 1579 |
| 1580 LayoutRect hitTestArea = renderer()->view()->documentRect(); | 1580 // Start with frameVisibleRect to ensure we include the scrollbars. |
| 1581 if (!request.ignoreClipping()) | 1581 LayoutRect hitTestArea = frameVisibleRect(renderer()); |
| 1582 hitTestArea.intersect(frameVisibleRect(renderer())); | 1582 if (request.ignoreClipping()) |
| 1583 hitTestArea.unite(renderer()->view()->documentRect()); |
| 1583 | 1584 |
| 1584 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre
a, hitTestLocation, false); | 1585 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre
a, hitTestLocation, false); |
| 1585 if (!insideLayer) { | 1586 if (!insideLayer) { |
| 1586 // We didn't hit any layer. If we are the root layer and the mouse is --
or just was -- down, | 1587 // We didn't hit any layer. If we are the root layer and the mouse is --
or just was -- down, |
| 1587 // return ourselves. We do this so mouse events continue getting deliver
ed after a drag has | 1588 // return ourselves. We do this so mouse events continue getting deliver
ed after a drag has |
| 1588 // exited the WebView, and so hit testing over a scrollbar hits the cont
ent document. | 1589 // exited the WebView, and so hit testing over a scrollbar hits the cont
ent document. |
| 1589 // In addtion, it is possible for the mouse to stay in the document but
there is no element. | 1590 // In addtion, it is possible for the mouse to stay in the document but
there is no element. |
| 1590 // At that time, the events of the mouse should be fired. | 1591 // At that time, the events of the mouse should be fired. |
| 1591 LayoutPoint hitPoint = hitTestLocation.point(); | 1592 LayoutPoint hitPoint = hitTestLocation.point(); |
| 1592 if (!request.isChildFrameHitTest() && ((request.active() || request.rele
ase()) || (request.move() && hitTestArea.contains(hitPoint.x(), hitPoint.y())))
&& isRootLayer()) { | 1593 if (!request.isChildFrameHitTest() && ((request.active() || request.rele
ase()) || (request.move() && hitTestArea.contains(hitPoint.x(), hitPoint.y())))
&& isRootLayer()) { |
| (...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2870 } | 2871 } |
| 2871 } | 2872 } |
| 2872 | 2873 |
| 2873 void showLayerTree(const blink::RenderObject* renderer) | 2874 void showLayerTree(const blink::RenderObject* renderer) |
| 2874 { | 2875 { |
| 2875 if (!renderer) | 2876 if (!renderer) |
| 2876 return; | 2877 return; |
| 2877 showLayerTree(renderer->enclosingLayer()); | 2878 showLayerTree(renderer->enclosingLayer()); |
| 2878 } | 2879 } |
| 2879 #endif | 2880 #endif |
| OLD | NEW |