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 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 | 1660 |
1661 // LayoutView should make sure to update layout before entering hit testing | 1661 // LayoutView should make sure to update layout before entering hit testing |
1662 ASSERT(!layoutObject()->frame()->view()->layoutPending()); | 1662 ASSERT(!layoutObject()->frame()->view()->layoutPending()); |
1663 ASSERT(!layoutObject()->document().layoutView()->needsLayout()); | 1663 ASSERT(!layoutObject()->document().layoutView()->needsLayout()); |
1664 | 1664 |
1665 // Start with frameVisibleRect to ensure we include the scrollbars. | 1665 // Start with frameVisibleRect to ensure we include the scrollbars. |
1666 LayoutRect hitTestArea = frameVisibleRect(layoutObject()); | 1666 LayoutRect hitTestArea = frameVisibleRect(layoutObject()); |
1667 if (request.ignoreClipping()) | 1667 if (request.ignoreClipping()) |
1668 hitTestArea.unite(LayoutRect(layoutObject()->view()->documentRect())); | 1668 hitTestArea.unite(LayoutRect(layoutObject()->view()->documentRect())); |
1669 | 1669 |
| 1670 // Make sure advance document lifecycle to CompositingClean prior to hit tes
ting. |
| 1671 compositor()->updateIfNeededRecursive(); |
1670 DeprecatedPaintLayer* insideLayer = hitTestLayer(this, 0, result, hitTestAre
a, hitTestLocation, false); | 1672 DeprecatedPaintLayer* insideLayer = hitTestLayer(this, 0, result, hitTestAre
a, hitTestLocation, false); |
1671 if (!insideLayer) { | 1673 if (!insideLayer) { |
1672 // We didn't hit any layer. If we are the root layer and the mouse is --
or just was -- down, | 1674 // We didn't hit any layer. If we are the root layer and the mouse is --
or just was -- down, |
1673 // return ourselves. We do this so mouse events continue getting deliver
ed after a drag has | 1675 // return ourselves. We do this so mouse events continue getting deliver
ed after a drag has |
1674 // exited the WebView, and so hit testing over a scrollbar hits the cont
ent document. | 1676 // exited the WebView, and so hit testing over a scrollbar hits the cont
ent document. |
1675 // In addtion, it is possible for the mouse to stay in the document but
there is no element. | 1677 // In addtion, it is possible for the mouse to stay in the document but
there is no element. |
1676 // At that time, the events of the mouse should be fired. | 1678 // At that time, the events of the mouse should be fired. |
1677 LayoutPoint hitPoint = hitTestLocation.point(); | 1679 LayoutPoint hitPoint = hitTestLocation.point(); |
1678 if (!request.isChildFrameHitTest() && ((request.active() || request.rele
ase()) || (request.move() && hitTestArea.contains(hitPoint.x(), hitPoint.y())))
&& isRootLayer()) { | 1680 if (!request.isChildFrameHitTest() && ((request.active() || request.rele
ase()) || (request.move() && hitTestArea.contains(hitPoint.x(), hitPoint.y())))
&& isRootLayer()) { |
1679 layoutObject()->updateHitTestResult(result, toLayoutView(layoutObjec
t())->flipForWritingMode(hitTestLocation.point())); | 1681 layoutObject()->updateHitTestResult(result, toLayoutView(layoutObjec
t())->flipForWritingMode(hitTestLocation.point())); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 // transformState.m_accumulatedTransform holds the transform from the containing
flattening layer. | 1787 // transformState.m_accumulatedTransform holds the transform from the containing
flattening layer. |
1786 // transformState.m_lastPlanarPoint is the hitTestLocation in the plane of the c
ontaining flattening layer. | 1788 // transformState.m_lastPlanarPoint is the hitTestLocation in the plane of the c
ontaining flattening layer. |
1787 // transformState.m_lastPlanarQuad is the hitTestRect as a quad in the plane of
the containing flattening layer. | 1789 // transformState.m_lastPlanarQuad is the hitTestRect as a quad in the plane of
the containing flattening layer. |
1788 // | 1790 // |
1789 // If zOffset is non-null (which indicates that the caller wants z offset inform
ation), | 1791 // If zOffset is non-null (which indicates that the caller wants z offset inform
ation), |
1790 // *zOffset on return is the z offset of the hit point relative to the containi
ng flattening layer. | 1792 // *zOffset on return is the z offset of the hit point relative to the containi
ng flattening layer. |
1791 DeprecatedPaintLayer* DeprecatedPaintLayer::hitTestLayer(DeprecatedPaintLayer* r
ootLayer, DeprecatedPaintLayer* containerLayer, HitTestResult& result, | 1793 DeprecatedPaintLayer* DeprecatedPaintLayer::hitTestLayer(DeprecatedPaintLayer* r
ootLayer, DeprecatedPaintLayer* containerLayer, HitTestResult& result, |
1792 const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, bool
appliedTransform, | 1794 const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, bool
appliedTransform, |
1793 const HitTestingTransformState* transformState, double* zOffset) | 1795 const HitTestingTransformState* transformState, double* zOffset) |
1794 { | 1796 { |
| 1797 ASSERT(layoutObject()->document().lifecycle().state() >= DocumentLifecycle::
CompositingClean); |
| 1798 |
1795 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 1799 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
1796 return 0; | 1800 return 0; |
1797 | 1801 |
1798 // The natural thing would be to keep HitTestingTransformState on the stack,
but it's big, so we heap-allocate. | 1802 // The natural thing would be to keep HitTestingTransformState on the stack,
but it's big, so we heap-allocate. |
1799 | 1803 |
1800 // Apply a transform if we have one. | 1804 // Apply a transform if we have one. |
1801 if (transform() && !appliedTransform) { | 1805 if (transform() && !appliedTransform) { |
1802 if (enclosingPaginationLayer()) | 1806 if (enclosingPaginationLayer()) |
1803 return hitTestTransformedLayerInFragments(rootLayer, containerLayer,
result, hitTestRect, hitTestLocation, transformState, zOffset); | 1807 return hitTestTransformedLayerInFragments(rootLayer, containerLayer,
result, hitTestRect, hitTestLocation, transformState, zOffset); |
1804 | 1808 |
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 } | 2967 } |
2964 } | 2968 } |
2965 | 2969 |
2966 void showLayerTree(const blink::LayoutObject* renderer) | 2970 void showLayerTree(const blink::LayoutObject* renderer) |
2967 { | 2971 { |
2968 if (!renderer) | 2972 if (!renderer) |
2969 return; | 2973 return; |
2970 showLayerTree(renderer->enclosingLayer()); | 2974 showLayerTree(renderer->enclosingLayer()); |
2971 } | 2975 } |
2972 #endif | 2976 #endif |
OLD | NEW |