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

Unified Diff: Source/core/layout/LayoutBlock.cpp

Issue 1292333004: Make hit-test support clip-path references using svg clipPath (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline for virutal test suites Created 5 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/fast/events/hit-test-clip-path-reference-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/layout/LayoutBlock.cpp
diff --git a/Source/core/layout/LayoutBlock.cpp b/Source/core/layout/LayoutBlock.cpp
index 116c979367c9b7c7fc0eb820d6eeff761531ee70..071644dcf7896e3e7a66316d5d7dbfa7c23e415a 100644
--- a/Source/core/layout/LayoutBlock.cpp
+++ b/Source/core/layout/LayoutBlock.cpp
@@ -59,6 +59,7 @@
#include "core/layout/line/InlineIterator.h"
#include "core/layout/line/InlineTextBox.h"
#include "core/layout/shapes/ShapeOutsideInfo.h"
+#include "core/layout/svg/LayoutSVGResourceClipper.h"
#include "core/page/Page.h"
#include "core/paint/BlockPainter.h"
#include "core/paint/BoxPainter.h"
@@ -1690,7 +1691,13 @@ bool LayoutBlock::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca
break;
}
case ClipPathOperation::REFERENCE:
- // FIXME: handle REFERENCE
+ ReferenceClipPathOperation* referenceClipPathOperation = toReferenceClipPathOperation(style()->clipPath());
+ Element* element = document().getElementById(referenceClipPathOperation->fragment());
+ if (isSVGClipPathElement(element) && element->layoutObject()) {
+ LayoutSVGResourceClipper* clipper = toLayoutSVGResourceClipper(toLayoutSVGResourceContainer(element->layoutObject()));
+ if (!clipper->hitTestClipContent(borderBoxRect(), FloatPoint(locationInContainer.point() - localOffset)))
+ return false;
+ }
break;
}
}
« no previous file with comments | « LayoutTests/fast/events/hit-test-clip-path-reference-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698