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

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
Index: Source/core/layout/line/InlineBox.cpp
diff --git a/Source/core/layout/line/InlineBox.cpp b/Source/core/layout/line/InlineBox.cpp
index fc22b510276a78170137e85782091048f8d54d46..2ed3867ab002e47f4650e01bf5d9f6820614ae84 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"
davve 2015/03/18 15:20:40 Why do you need to add this include? None of the a
Abhijeet Kandalkar Slow 2015/03/19 13:38:15 locationInContainer is of type HitTestLocation, so
#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()->layoutObject().hasFlippedBlocksWritingMode()) // Faster than calling containingBlock().
childPoint = layoutObject().containingBlock()->flipForWritingModeForChild(&toLayoutBox(layoutObject()), childPoint);
+ if (layoutObject().style()->hasBorderRadius()) {
davve 2015/03/18 15:20:40 While adding this code addresses the test in the b
Abhijeet Kandalkar Slow 2015/03/19 13:38:15 We can raise separate bug for this special use cas
+ LayoutRect borderRect = logicalFrameRect();
+ LayoutPoint adjustedLocation(accumulatedOffset);
davve 2015/03/18 15:20:40 Not sure there is value in the adjustedLocation va
Abhijeet Kandalkar Slow 2015/03/19 13:38:15 Done.
+ borderRect.moveBy(adjustedLocation);
+ FloatRoundedRect border = layoutObject().style()->getRoundedBorderFor(borderRect);
+ if (!locationInContainer.intersects(border))
+ return false;
+ }
+
return layoutObject().hitTest(request, result, locationInContainer, childPoint);
}

Powered by Google App Engine
This is Rietveld 408576698