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

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

Issue 444223005: [SVG2] Svg elements that overflow the viewport should also be hitdetected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix nits Created 6 years, 4 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/svg/custom/click-overflowing-element-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/rendering/svg/RenderSVGRoot.cpp
diff --git a/Source/core/rendering/svg/RenderSVGRoot.cpp b/Source/core/rendering/svg/RenderSVGRoot.cpp
index 6d554622faaed5e156de2f4ac828c7b9af446eee..4ab0b148f8964cabeebaa5aa7feb94cb4c292a46 100644
--- a/Source/core/rendering/svg/RenderSVGRoot.cpp
+++ b/Source/core/rendering/svg/RenderSVGRoot.cpp
@@ -422,9 +422,10 @@ bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
LayoutPoint pointInParent = locationInContainer.point() - toLayoutSize(accumulatedOffset);
LayoutPoint pointInBorderBox = pointInParent - toLayoutSize(location());
- // Only test SVG content if the point is in our content box.
+ // Only test SVG content if the point is in our content box, or in case we
+ // don't clip to the viewport, the visual overflow rect.
// FIXME: This should be an intersection when rect-based hit tests are supported by nodeAtFloatPoint.
- if (contentBoxRect().contains(pointInBorderBox)) {
+ if (contentBoxRect().contains(pointInBorderBox) || (!shouldApplyViewportClip() && visualOverflowRect().contains(pointInBorderBox))) {
const AffineTransform& localToParentTransform = this->localToParentTransform();
if (localToParentTransform.isInvertible()) {
FloatPoint localPoint = localToParentTransform.inverse().mapPoint(FloatPoint(pointInParent));
« no previous file with comments | « LayoutTests/svg/custom/click-overflowing-element-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698