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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/borders/border-hittest-inlineFlowBox-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/line/InlineFlowBox.cpp
diff --git a/Source/core/layout/line/InlineFlowBox.cpp b/Source/core/layout/line/InlineFlowBox.cpp
index 7429b636a4abc761a9dcf4066584f2b47fb03950..fe468b352690ebf2daad0bcef7b78ccffa532a0f 100644
--- a/Source/core/layout/line/InlineFlowBox.cpp
+++ b/Source/core/layout/line/InlineFlowBox.cpp
@@ -975,6 +975,27 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
if (!locationInContainer.intersects(overflowRect))
return false;
+ if (layoutObject().style()->hasBorderRadius()) {
+ LayoutRect borderRect = logicalFrameRect();
+ borderRect.moveBy(accumulatedOffset);
+ FloatRoundedRect border = layoutObject().style()->getRoundedBorderFor(borderRect, includeLogicalLeftEdge(), includeLogicalRightEdge());
+ if (!locationInContainer.intersects(border)) {
+ // For child whose bounding box is flowing ouside it's parent border.
+ bool hasChildAtPoint = false;
+ for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) {
davve 2015/03/27 12:40:20 Instead of having a loop here and a preliminary hi
Abhijeet Kandalkar Slow 2015/03/27 13:08:26 Done.
+ LayoutRect absoluteRect = curr->logicalFrameRect();
+ absoluteRect.moveBy(accumulatedOffset);
+ if (locationInContainer.intersects(absoluteRect)) {
+ hasChildAtPoint = true;
+ break;
+ }
+ }
+
+ if (!hasChildAtPoint)
+ return false;
+ }
+ }
+
// Check children first.
// 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.
LayoutObject* culledParent = 0;
« no previous file with comments | « LayoutTests/fast/borders/border-hittest-inlineFlowBox-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698