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

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, 10 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
Index: Source/core/layout/line/InlineBox.cpp
diff --git a/Source/core/layout/line/InlineBox.cpp b/Source/core/layout/line/InlineBox.cpp
index b418182aa4138fe85024765ae6b975a0f58c1cc4..02f3a37deaad2b9b33d0e4f4435043be218afff2 100644
--- a/Source/core/layout/line/InlineBox.cpp
+++ b/Source/core/layout/line/InlineBox.cpp
@@ -20,6 +20,8 @@
#include "config.h"
#include "core/layout/line/InlineBox.h"
+#include "core/layout/HitTestLocation.h"
+#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutBlockFlow.h"
#include "core/layout/LayoutObject.h"
#include "core/layout/PaintInfo.h"
@@ -208,6 +210,15 @@ bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
if (parent()->renderer().hasFlippedBlocksWritingMode()) // Faster than calling containingBlock().
childPoint = renderer().containingBlock()->flipForWritingModeForChild(&toLayoutBox(renderer()), childPoint);
+ if (renderer().style()->hasBorderRadius()) {
+ LayoutRect borderRect = logicalFrameRect();
+ LayoutPoint adjustedLocation(accumulatedOffset);
+ borderRect.moveBy(adjustedLocation);
+ FloatRoundedRect border = renderer().style()->getRoundedBorderFor(borderRect);
+ if (!locationInContainer.intersects(border))
+ return false;
+ }
+
return renderer().hitTest(request, result, locationInContainer, childPoint);
}

Powered by Google App Engine
This is Rietveld 408576698