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

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

Issue 249133002: hitTest should take care if the location is inside rounded border if border-radius is specified (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 2864 matching lines...) Expand 10 before | Expand all | Expand 10 after
2875 && isPointInOverflowControl(result, locationInContainer.point(), adjuste dLocation)) { 2875 && isPointInOverflowControl(result, locationInContainer.point(), adjuste dLocation)) {
2876 updateHitTestResult(result, locationInContainer.point() - localOffset); 2876 updateHitTestResult(result, locationInContainer.point() - localOffset);
2877 // FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet . 2877 // FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet .
2878 if (!result.addNodeToRectBasedTestResult(nodeForHitTest(), request, loca tionInContainer)) 2878 if (!result.addNodeToRectBasedTestResult(nodeForHitTest(), request, loca tionInContainer))
2879 return true; 2879 return true;
2880 } 2880 }
2881 2881
2882 // If we have clipping, then we can't have any spillout. 2882 // If we have clipping, then we can't have any spillout.
2883 bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer(); 2883 bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer();
2884 bool useClip = (hasControlClip() || useOverflowClip); 2884 bool useClip = (hasControlClip() || useOverflowClip);
2885 bool checkChildren = !useClip || (hasControlClip() ? locationInContainer.int ersects(controlClipRect(adjustedLocation)) : locationInContainer.intersects(over flowClipRect(adjustedLocation, IncludeOverlayScrollbarSize))); 2885 LayoutRect clipRect = overflowClipRect(adjustedLocation, IncludeOverlayScrol lbarSize);
2886 bool checkChildren = !useClip || (hasControlClip() ? locationInContainer.int ersects(controlClipRect(adjustedLocation)) : (!isRenderView() && style()->hasBor derRadius() ? locationInContainer.intersects(style()->getRoundedBorderFor(clipRe ct)) : locationInContainer.intersects(clipRect)));
ojan 2014/04/30 18:37:47 Why the !isRenderView check? I see that the code b
pals 2014/05/06 06:33:41 Done. I have removed the !isRenderView() checks. T
ojan 2014/05/07 03:11:03 Can you look at the history for why this check was
pals 2014/05/07 06:31:53 The check was first added at http://trac.webkit.or
2886 if (checkChildren) { 2887 if (checkChildren) {
2887 // Hit test descendants first. 2888 // Hit test descendants first.
2888 LayoutSize scrolledOffset(localOffset); 2889 LayoutSize scrolledOffset(localOffset);
2889 if (hasOverflowClip()) 2890 if (hasOverflowClip())
2890 scrolledOffset -= scrolledContentOffset(); 2891 scrolledOffset -= scrolledContentOffset();
2891 2892
2892 // Hit test contents if we don't have columns. 2893 // Hit test contents if we don't have columns.
2893 if (!hasColumns()) { 2894 if (!hasColumns()) {
2894 if (hitTestContents(request, result, locationInContainer, toLayoutPo int(scrolledOffset), hitTestAction)) { 2895 if (hitTestContents(request, result, locationInContainer, toLayoutPo int(scrolledOffset), hitTestAction)) {
2895 updateHitTestResult(result, flipForWritingMode(locationInContain er.point() - localOffset)); 2896 updateHitTestResult(result, flipForWritingMode(locationInContain er.point() - localOffset));
(...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after
5021 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5022 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5022 { 5023 {
5023 showRenderObject(); 5024 showRenderObject();
5024 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5025 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5025 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5026 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5026 } 5027 }
5027 5028
5028 #endif 5029 #endif
5029 5030
5030 } // namespace WebCore 5031 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698