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

Unified Diff: Source/core/rendering/svg/RenderSVGContainer.cpp

Issue 45733010: Add pointer-events="bounding-box" for svg content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: make assert more specific Created 7 years 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 | « Source/core/rendering/style/RenderStyleConstants.h ('k') | Source/core/rendering/svg/RenderSVGImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGContainer.cpp
diff --git a/Source/core/rendering/svg/RenderSVGContainer.cpp b/Source/core/rendering/svg/RenderSVGContainer.cpp
index ecb38aeccf839cf787a6cd8c27555e2af417ddc2..04f28cae87257b2b442e7b64b9495cdc46c1b4b6 100644
--- a/Source/core/rendering/svg/RenderSVGContainer.cpp
+++ b/Source/core/rendering/svg/RenderSVGContainer.cpp
@@ -186,7 +186,14 @@ bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest
}
}
- // Spec: Only graphical elements can be targeted by the mouse, period.
+ // pointer-events=boundingBox makes it possible for containers to be direct targets
+ if (style()->pointerEvents() == PE_BOUNDINGBOX) {
+ ASSERT(isObjectBoundingBoxValid());
+ if (objectBoundingBox().contains(localPoint)) {
+ updateHitTestResult(result, roundedLayoutPoint(localPoint));
+ return true;
+ }
+ }
// 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispatched."
return false;
}
« no previous file with comments | « Source/core/rendering/style/RenderStyleConstants.h ('k') | Source/core/rendering/svg/RenderSVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698