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

Side by Side Diff: Source/core/rendering/RenderBlock.cpp

Issue 869813003: Implement elementsFromPoint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup, add a better test for tables Created 5 years, 10 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
« no previous file with comments | « Source/core/page/TouchDisambiguation.cpp ('k') | Source/core/rendering/RenderBox.cpp » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 overflowBox.moveBy(adjustedLocation); 2175 overflowBox.moveBy(adjustedLocation);
2176 if (!locationInContainer.intersects(overflowBox)) 2176 if (!locationInContainer.intersects(overflowBox))
2177 return false; 2177 return false;
2178 } 2178 }
2179 2179
2180 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChil dBlockBackground) 2180 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChil dBlockBackground)
2181 && visibleToHitTestRequest(request) 2181 && visibleToHitTestRequest(request)
2182 && isPointInOverflowControl(result, locationInContainer.point(), adjuste dLocation)) { 2182 && isPointInOverflowControl(result, locationInContainer.point(), adjuste dLocation)) {
2183 updateHitTestResult(result, locationInContainer.point() - localOffset); 2183 updateHitTestResult(result, locationInContainer.point() - localOffset);
2184 // FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet . 2184 // FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet .
2185 if (!result.addNodeToRectBasedTestResult(nodeForHitTest(), request, loca tionInContainer)) 2185 if (!result.addNodeToListBasedTestResult(nodeForHitTest(), request, loca tionInContainer))
2186 return true; 2186 return true;
2187 } 2187 }
2188 2188
2189 if (style()->clipPath()) { 2189 if (style()->clipPath()) {
2190 switch (style()->clipPath()->type()) { 2190 switch (style()->clipPath()->type()) {
2191 case ClipPathOperation::SHAPE: { 2191 case ClipPathOperation::SHAPE: {
2192 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(style()- >clipPath()); 2192 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(style()- >clipPath());
2193 // FIXME: handle marginBox etc. 2193 // FIXME: handle marginBox etc.
2194 if (!clipPath->path(borderBoxRect()).contains(FloatPoint(locationInC ontainer.point() - localOffset), clipPath->windRule())) 2194 if (!clipPath->path(borderBoxRect()).contains(FloatPoint(locationInC ontainer.point() - localOffset), clipPath->windRule()))
2195 return false; 2195 return false;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2243 FloatRoundedRect border = style()->getRoundedBorderFor(borderRect); 2243 FloatRoundedRect border = style()->getRoundedBorderFor(borderRect);
2244 if (!locationInContainer.intersects(border)) 2244 if (!locationInContainer.intersects(border))
2245 return false; 2245 return false;
2246 } 2246 }
2247 2247
2248 // Now hit test our background 2248 // Now hit test our background
2249 if (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChild BlockBackground) { 2249 if (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChild BlockBackground) {
2250 LayoutRect boundsRect(adjustedLocation, size()); 2250 LayoutRect boundsRect(adjustedLocation, size());
2251 if (visibleToHitTestRequest(request) && locationInContainer.intersects(b oundsRect)) { 2251 if (visibleToHitTestRequest(request) && locationInContainer.intersects(b oundsRect)) {
2252 updateHitTestResult(result, flipForWritingMode(locationInContainer.p oint() - localOffset)); 2252 updateHitTestResult(result, flipForWritingMode(locationInContainer.p oint() - localOffset));
2253 if (!result.addNodeToRectBasedTestResult(nodeForHitTest(), request, locationInContainer, boundsRect)) 2253 if (!result.addNodeToListBasedTestResult(nodeForHitTest(), request, locationInContainer, boundsRect))
2254 return true; 2254 return true;
2255 } 2255 }
2256 } 2256 }
2257 2257
2258 return false; 2258 return false;
2259 } 2259 }
2260 2260
2261 class ColumnRectIterator { 2261 class ColumnRectIterator {
2262 WTF_MAKE_NONCOPYABLE(ColumnRectIterator); 2262 WTF_MAKE_NONCOPYABLE(ColumnRectIterator);
2263 public: 2263 public:
(...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after
3945 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 3945 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
3946 { 3946 {
3947 showLayoutObject(); 3947 showLayoutObject();
3948 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 3948 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
3949 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 3949 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
3950 } 3950 }
3951 3951
3952 #endif 3952 #endif
3953 3953
3954 } // namespace blink 3954 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/TouchDisambiguation.cpp ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698