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

Unified Diff: Source/core/layout/line/InlineBox.cpp

Issue 983693002: Hover not working correctly on image with 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-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/InlineBox.cpp
diff --git a/Source/core/layout/line/InlineBox.cpp b/Source/core/layout/line/InlineBox.cpp
index e8cb90b521ab422e3e205a8632a1f13069ea48b7..8fd6d9bf11d0aa43888852f867b6484a0eae0a0a 100644
--- a/Source/core/layout/line/InlineBox.cpp
+++ b/Source/core/layout/line/InlineBox.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "core/layout/line/InlineBox.h"
+#include "core/layout/HitTestLocation.h"
#include "core/layout/LayoutBlockFlow.h"
#include "core/layout/LayoutObject.h"
#include "core/layout/PaintInfo.h"
@@ -214,6 +215,14 @@ bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
if (parent()->layoutObject().hasFlippedBlocksWritingMode()) // Faster than calling containingBlock().
childPoint = layoutObject().containingBlock()->flipForWritingModeForChild(&toLayoutBox(layoutObject()), childPoint);
+ if (layoutObject().style()->hasBorderRadius()) {
+ LayoutRect borderRect = logicalFrameRect();
+ borderRect.moveBy(accumulatedOffset);
+ FloatRoundedRect border = layoutObject().style()->getRoundedBorderFor(borderRect);
+ if (!locationInContainer.intersects(border))
+ return false;
+ }
+
return layoutObject().hitTest(request, result, locationInContainer, childPoint);
}
« no previous file with comments | « LayoutTests/fast/borders/border-hittest-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698