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

Side by Side Diff: Source/core/layout/line/InlineFlowBox.cpp

Issue 1034433003: Hittest for RootInlineBox/InlineFlowBox should take care of border-radius. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 } 968 }
969 969
970 bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re sult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulated Offset, LayoutUnit lineTop, LayoutUnit lineBottom) 970 bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re sult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulated Offset, LayoutUnit lineTop, LayoutUnit lineBottom)
971 { 971 {
972 LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); 972 LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom));
973 flipForWritingMode(overflowRect); 973 flipForWritingMode(overflowRect);
974 overflowRect.moveBy(accumulatedOffset); 974 overflowRect.moveBy(accumulatedOffset);
975 if (!locationInContainer.intersects(overflowRect)) 975 if (!locationInContainer.intersects(overflowRect))
976 return false; 976 return false;
977 977
978 if (layoutObject().style()->hasBorderRadius()) {
979 LayoutRect borderRect = logicalFrameRect();
980 borderRect.moveBy(accumulatedOffset);
981 FloatRoundedRect border = layoutObject().style()->getRoundedBorderFor(bo rderRect, includeLogicalLeftEdge(), includeLogicalRightEdge());
982 if (!locationInContainer.intersects(border))
davve 2015/03/26 10:03:36 We're heading in the right direction but it's stil
Abhijeet Kandalkar Slow 2015/03/27 11:28:59 Added implementation to handle nested inlines and
983 return false;
984 }
985
978 // Check children first. 986 // Check children first.
979 // We need to account for culled inline parents of the hit-tested nodes, so that they may also get included in area-based hit-tests. 987 // We need to account for culled inline parents of the hit-tested nodes, so that they may also get included in area-based hit-tests.
980 LayoutObject* culledParent = 0; 988 LayoutObject* culledParent = 0;
981 for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) { 989 for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) {
982 if (curr->layoutObject().isText() || !curr->boxModelObject()->hasSelfPai ntingLayer()) { 990 if (curr->layoutObject().isText() || !curr->boxModelObject()->hasSelfPai ntingLayer()) {
983 LayoutObject* newParent = 0; 991 LayoutObject* newParent = 0;
984 // Culled parents are only relevant for area-based hit-tests, so ign ore it in point-based ones. 992 // Culled parents are only relevant for area-based hit-tests, so ign ore it in point-based ones.
985 if (locationInContainer.isRectBasedTest()) { 993 if (locationInContainer.isRectBasedTest()) {
986 newParent = curr->layoutObject().parent(); 994 newParent = curr->layoutObject().parent();
987 if (newParent == layoutObject()) 995 if (newParent == layoutObject())
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 ASSERT(child->prevOnLine() == prev); 1307 ASSERT(child->prevOnLine() == prev);
1300 prev = child; 1308 prev = child;
1301 } 1309 }
1302 ASSERT(prev == m_lastChild); 1310 ASSERT(prev == m_lastChild);
1303 #endif 1311 #endif
1304 } 1312 }
1305 1313
1306 #endif 1314 #endif
1307 1315
1308 } // namespace blink 1316 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698