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

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: Fix typeo Created 5 years, 11 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
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 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 overflowBox.moveBy(adjustedLocation); 2177 overflowBox.moveBy(adjustedLocation);
2178 if (!locationInContainer.intersects(overflowBox)) 2178 if (!locationInContainer.intersects(overflowBox))
2179 return false; 2179 return false;
2180 } 2180 }
2181 2181
2182 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChil dBlockBackground) 2182 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChil dBlockBackground)
2183 && visibleToHitTestRequest(request) 2183 && visibleToHitTestRequest(request)
2184 && isPointInOverflowControl(result, locationInContainer.point(), adjuste dLocation)) { 2184 && isPointInOverflowControl(result, locationInContainer.point(), adjuste dLocation)) {
2185 updateHitTestResult(result, locationInContainer.point() - localOffset); 2185 updateHitTestResult(result, locationInContainer.point() - localOffset);
2186 // FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet . 2186 // FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet .
2187 if (!result.addNodeToRectBasedTestResult(nodeForHitTest(), request, loca tionInContainer)) 2187 if (!result.addNodeToListBasedTestResult(nodeForHitTest(), request, loca tionInContainer))
2188 return true; 2188 return true;
2189 } 2189 }
2190 2190
2191 if (style()->clipPath()) { 2191 if (style()->clipPath()) {
2192 switch (style()->clipPath()->type()) { 2192 switch (style()->clipPath()->type()) {
2193 case ClipPathOperation::SHAPE: { 2193 case ClipPathOperation::SHAPE: {
2194 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(style()- >clipPath()); 2194 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(style()- >clipPath());
2195 // FIXME: handle marginBox etc. 2195 // FIXME: handle marginBox etc.
2196 if (!clipPath->path(borderBoxRect()).contains(FloatPoint(locationInC ontainer.point() - localOffset), clipPath->windRule())) 2196 if (!clipPath->path(borderBoxRect()).contains(FloatPoint(locationInC ontainer.point() - localOffset), clipPath->windRule()))
2197 return false; 2197 return false;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 FloatRoundedRect border = style()->getRoundedBorderFor(borderRect); 2245 FloatRoundedRect border = style()->getRoundedBorderFor(borderRect);
2246 if (!locationInContainer.intersects(border)) 2246 if (!locationInContainer.intersects(border))
2247 return false; 2247 return false;
2248 } 2248 }
2249 2249
2250 // Now hit test our background 2250 // Now hit test our background
2251 if (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChild BlockBackground) { 2251 if (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChild BlockBackground) {
2252 LayoutRect boundsRect(adjustedLocation, size()); 2252 LayoutRect boundsRect(adjustedLocation, size());
2253 if (visibleToHitTestRequest(request) && locationInContainer.intersects(b oundsRect)) { 2253 if (visibleToHitTestRequest(request) && locationInContainer.intersects(b oundsRect)) {
2254 updateHitTestResult(result, flipForWritingMode(locationInContainer.p oint() - localOffset)); 2254 updateHitTestResult(result, flipForWritingMode(locationInContainer.p oint() - localOffset));
2255 if (!result.addNodeToRectBasedTestResult(nodeForHitTest(), request, locationInContainer, boundsRect)) 2255 if (!result.addNodeToListBasedTestResult(nodeForHitTest(), request, locationInContainer, boundsRect))
2256 return true; 2256 return true;
2257 } 2257 }
2258 } 2258 }
2259 2259
2260 return false; 2260 return false;
2261 } 2261 }
2262 2262
2263 class ColumnRectIterator { 2263 class ColumnRectIterator {
2264 WTF_MAKE_NONCOPYABLE(ColumnRectIterator); 2264 WTF_MAKE_NONCOPYABLE(ColumnRectIterator);
2265 public: 2265 public:
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after
3941 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 3941 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
3942 { 3942 {
3943 showRenderObject(); 3943 showRenderObject();
3944 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 3944 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
3945 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 3945 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
3946 } 3946 }
3947 3947
3948 #endif 3948 #endif
3949 3949
3950 } // namespace blink 3950 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698