Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1003303005: [New Multicolumn] Correct localPoint when hitting an anonymous child block. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase master Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/multicol/vertical-rl/caret-range-anonymous-block-rtl-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 DeprecatedPaintLayer* DeprecatedPaintLayer::hitTestChildren(ChildrenIteration ch ildrentoVisit, DeprecatedPaintLayer* rootLayer, 2087 DeprecatedPaintLayer* DeprecatedPaintLayer::hitTestChildren(ChildrenIteration ch ildrentoVisit, DeprecatedPaintLayer* rootLayer,
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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2963 } 2973 }
2964 } 2974 }
2965 2975
2966 void showLayerTree(const blink::LayoutObject* renderer) 2976 void showLayerTree(const blink::LayoutObject* renderer)
2967 { 2977 {
2968 if (!renderer) 2978 if (!renderer)
2969 return; 2979 return;
2970 showLayerTree(renderer->enclosingLayer()); 2980 showLayerTree(renderer->enclosingLayer());
2971 } 2981 }
2972 #endif 2982 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/vertical-rl/caret-range-anonymous-block-rtl-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698