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 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2052 { | 2052 { |
2053 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); | 2053 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); |
2054 | 2054 |
2055 if (!layoutObject()->hitTest(request, result, hitTestLocation, toLayoutPoint
(layerBounds.location() - layoutBoxLocation()), hitTestFilter)) { | 2055 if (!layoutObject()->hitTest(request, result, hitTestLocation, toLayoutPoint
(layerBounds.location() - layoutBoxLocation()), hitTestFilter)) { |
2056 // It's wrong to set innerNode, but then claim that you didn't hit anyth
ing, unless it is | 2056 // It's wrong to set innerNode, but then claim that you didn't hit anyth
ing, unless it is |
2057 // a rect-based test. | 2057 // a rect-based test. |
2058 ASSERT(!result.innerNode() || (request.listBased() && result.listBasedTe
stResult().size())); | 2058 ASSERT(!result.innerNode() || (request.listBased() && result.listBasedTe
stResult().size())); |
2059 return false; | 2059 return false; |
2060 } | 2060 } |
2061 | 2061 |
2062 // For positioned generated content, we might still not have a | |
2063 // node by the time we get to the layer level, since none of | |
2064 // the content in the layer has an element. So just walk up | |
2065 // the tree. | |
2066 if (!result.innerNode() || !result.innerNonSharedNode()) { | 2062 if (!result.innerNode() || !result.innerNonSharedNode()) { |
| 2063 // We hit something anonymous, and we didn't find a DOM node ancestor in
this layer. |
| 2064 |
| 2065 if (layoutObject()->isLayoutFlowThread()) { |
| 2066 // For a flow thread it's safe to just say that we didn't hit anythi
ng. That means that |
| 2067 // we'll continue as normally, and eventually hit a column set sibli
ng instead. Column |
| 2068 // sets are also anonymous, but, unlike flow threads, they don't est
ablish layers, so |
| 2069 // we'll fall back and hit the multicol container parent (which shou
ld have a DOM node). |
| 2070 return false; |
| 2071 } |
| 2072 |
2067 Node* e = enclosingElement(); | 2073 Node* e = enclosingElement(); |
2068 if (!result.innerNode()) | 2074 if (!result.innerNode()) |
2069 result.setInnerNode(e); | 2075 result.setInnerNode(e); |
2070 if (!result.innerNonSharedNode()) | 2076 if (!result.innerNonSharedNode()) |
2071 result.setInnerNonSharedNode(e); | 2077 result.setInnerNonSharedNode(e); |
| 2078 // FIXME: missing call to result.setLocalPoint(). What we would really w
ant to do here is to |
| 2079 // return and look for the nearest non-anonymous ancestor, and ignore au
nts and uncles on |
| 2080 // our way. It's bad to look for it manually like we do here, and give u
p on setting a local |
| 2081 // point in the result, because that has bad implications for text selec
tion and |
| 2082 // caretRangeFromPoint(). See crbug.com/461791 |
2072 } | 2083 } |
2073 | |
2074 return true; | 2084 return true; |
2075 } | 2085 } |
2076 | 2086 |
2077 Layer* Layer::hitTestChildren(ChildrenIteration childrentoVisit, Layer* rootLaye
r, | 2087 Layer* Layer::hitTestChildren(ChildrenIteration childrentoVisit, Layer* rootLaye
r, |
2078 const HitTestRequest& request, HitTestResult& result, | 2088 const HitTestRequest& request, HitTestResult& result, |
2079 const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, | 2089 const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, |
2080 const HitTestingTransformState* transformState, | 2090 const HitTestingTransformState* transformState, |
2081 double* zOffsetForDescendants, double* zOffset, | 2091 double* zOffsetForDescendants, double* zOffset, |
2082 const HitTestingTransformState* unflattenedTransformState, | 2092 const HitTestingTransformState* unflattenedTransformState, |
2083 bool depthSortDescendants) | 2093 bool depthSortDescendants) |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2962 } | 2972 } |
2963 } | 2973 } |
2964 | 2974 |
2965 void showLayerTree(const blink::LayoutObject* renderer) | 2975 void showLayerTree(const blink::LayoutObject* renderer) |
2966 { | 2976 { |
2967 if (!renderer) | 2977 if (!renderer) |
2968 return; | 2978 return; |
2969 showLayerTree(renderer->enclosingLayer()); | 2979 showLayerTree(renderer->enclosingLayer()); |
2970 } | 2980 } |
2971 #endif | 2981 #endif |
OLD | NEW |