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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp

Issue 2234173002: Skip hit testing containers with invalid bounding boxes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments Created 4 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 | « third_party/WebKit/LayoutTests/svg/hittest/empty-container.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp
index 1e62ca9fcd732c047ec41330e5413b32b2ead2ca..81ee3f707812c438943b97c04d141adebd240222 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp
@@ -187,10 +187,10 @@ bool LayoutSVGContainer::nodeAtFloatPoint(HitTestResult& result, const FloatPoin
}
}
- // pointer-events=boundingBox makes it possible for containers to be direct targets
+ // pointer-events: bounding-box makes it possible for containers to be direct targets.
if (style()->pointerEvents() == PE_BOUNDINGBOX) {
- ASSERT(isObjectBoundingBoxValid());
- if (objectBoundingBox().contains(localPoint)) {
+ // Check for a valid bounding box because it will be invalid for empty containers.
+ if (isObjectBoundingBoxValid() && objectBoundingBox().contains(localPoint)) {
const LayoutPoint& localLayoutPoint = roundedLayoutPoint(localPoint);
updateHitTestResult(result, localLayoutPoint);
if (result.addNodeToListBasedTestResult(element(), localLayoutPoint) == StopHitTesting)
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/hittest/empty-container.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698