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

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: add layout test file 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
Index: Source/core/layout/LayoutBlock.cpp
diff --git a/Source/core/layout/LayoutBlock.cpp b/Source/core/layout/LayoutBlock.cpp
index 00fd49ac48a81fc9340041380d47c71dad147a54..387682afdb40a6c23843b55d8fdbedb3eefc92af 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 (element && isSVGClipPathElement(element) && element->layoutObject()) {
fs 2015/08/19 22:04:57 Nit: The pointer-version of is...Element checks fo
Yufeng Shen (Slow to review) 2015/08/20 20:17:21 Done.
+ LayoutSVGResourceClipper* clipper = toLayoutSVGResourceClipper(toLayoutSVGResourceContainer(element->layoutObject()));
+ if (!clipper->hitTestClipContent(borderBoxRect(), FloatPoint(locationInContainer.point() - localOffset)))
+ return false;
+ }
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698