-2007-05-10 Eric Seidel <eric@webkit.org>
-
- Reviewed by olliej.
-
- Test for http://bugs.webkit.org/show_bug.cgi?id=11931
-
- * svg/custom/hit-test-unclosed-subpaths-expected.checksum: Added.
- * svg/custom/hit-test-unclosed-subpaths-expected.png: Added.
- * svg/custom/hit-test-unclosed-subpaths-expected.txt: Added.
- * svg/custom/hit-test-unclosed-subpaths.svg: Added.
-
-=== Merged the following changes from branches/feature-branch ===
-
2007-10-01 Lars Knoll <lars@trolltech.com>
Remove the separate ChangeLog in Layouttests/platform/qt.
+++ /dev/null
-00c54be0d5d68345dcf67de2b75d4af4
\ No newline at end of file
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
- RenderSVGContainer {svg} at (8.50,10) size 506.50x144
- RenderPath {path} at (8.50,10) size 213x101.50 [stroke={[type=SOLID] [color=#000000] [stroke width=3.00]}] [fill={[type=SOLID] [color=#008000]}] [data="M10.00,10.00L10.00,110.00L110.00,110.00L110.00,10.00M120.00,10.00L120.00,110.00L220.00,110.00L220.00,10.00"]
- RenderSVGText {text} at (10,150) size 800x18
- RenderSVGInlineText {#text} at (0,-14) size 505x18
- text run at (0,-14) width 505: "There should be 2 green squares above this (when run under DumpRenderTree)"
-caret: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg">
-<script>
-function clickHandler(evt)
-{
- evt.target.style.fill = "green";
-}
-
-if (window.layoutTestController)
- layoutTestController.waitUntilDone();
-
-function doClick() {
- if (window.eventSender) {
- eventSender.mouseMoveTo(50, 50);
- eventSender.mouseDown();
- eventSender.mouseUp();
- layoutTestController.notifyDone();
- }
-}
-
-setTimeout("doClick()", 0);
-</script>
-<path onclick="clickHandler(evt)" fill="red" stroke="black" stroke-width="3" d="M 10 10 l 0 100 l 100 0 l 0 -100 M 120 10 l 0 100 l 100 0 l 0 -100"/>
-
-<text x="10" y="150">There should be 2 green squares above this (when run under DumpRenderTree)</text>
-
-</svg>
* page/FrameView.cpp:
(WebCore::FrameView::layout):
-2007-05-10 Eric Seidel <eric@webkit.org>
-
- Reviewed by olliej.
-
- http://bugs.webkit.org/show_bug.cgi?id=11931
- PathCG fails to hit on unclosed sub-paths
-
- Test: svg/custom/hit-test-unclosed-subpaths.svg
-
- * platform/graphics/cg/PathCG.cpp:
- (WebCore::copyClosingSubpathsApplierFunction):
- (WebCore::copyCGPathClosingSubpaths):
- (WebCore::Path::contains): use new copy & close function
-
-=== Merged the following changes from branches/feature-branch ===
-
2007-10-01 Eli Fidler <eli@staikos.net>
Reviewed by George Staikos.
DEAD_CODE_STRIPPING = NO;
GCC_OPTIMIZATION_LEVEL = 0;
STRIP_INSTALLED_PRODUCT = NO;
- WARNING_CFLAGS = (
- "$(WARNING_CFLAGS_$(CURRENT_ARCH))",
- "-Wno-shorten-64-to-32",
- );
};
name = Debug;
};
baseConfigurationReference = 1CDD45E40BA9C84600F90147 /* DebugRelease.xcconfig */;
buildSettings = {
STRIP_INSTALLED_PRODUCT = NO;
- WARNING_CFLAGS = (
- "$(WARNING_CFLAGS_$(CURRENT_ARCH))",
- "-Wno-shorten-64-to-32",
- );
};
name = Release;
};
isa = XCBuildConfiguration;
baseConfigurationReference = 1CDD45E60BA9C84600F90147 /* Base.xcconfig */;
buildSettings = {
- WARNING_CFLAGS = (
- "$(WARNING_CFLAGS_$(CURRENT_ARCH))",
- "-Wno-shorten-64-to-32",
- );
};
name = Production;
};
return *this;
}
-
-static void copyClosingSubpathsApplierFunction(void* info, const CGPathElement* element)
-{
- CGMutablePathRef path = static_cast<CGMutablePathRef>(info);
- CGPoint* points = element->points;
-
- switch (element->type) {
- case kCGPathElementMoveToPoint:
- if (!CGPathIsEmpty(path)) // to silence a warning when trying to close an empty path
- CGPathCloseSubpath(path); // This is the only change from CGPathCreateMutableCopy
- CGPathMoveToPoint(path, 0, points[0].x, points[0].y);
- break;
- case kCGPathElementAddLineToPoint:
- CGPathAddLineToPoint(path, 0, points[0].x, points[0].y);
- break;
- case kCGPathElementAddQuadCurveToPoint:
- CGPathAddQuadCurveToPoint(path, 0, points[0].x, points[0].y, points[1].x, points[1].y);
- break;
- case kCGPathElementAddCurveToPoint:
- CGPathAddCurveToPoint(path, 0, points[0].x, points[0].y, points[1].x, points[1].y, points[2].x, points[2].y);
- break;
- case kCGPathElementCloseSubpath:
- CGPathCloseSubpath(path);
- break;
- }
-}
-
-static CGMutablePathRef copyCGPathClosingSubpaths(CGPathRef originalPath)
-{
- CGMutablePathRef path = CGPathCreateMutable();
- CGPathApply(originalPath, path, copyClosingSubpathsApplierFunction);
- CGPathCloseSubpath(path);
- return path;
-}
-
bool Path::contains(const FloatPoint &point, WindRule rule) const
{
+ // CGPathContainsPoint returns false for non-closed paths, as a work-around, we copy and close the path first. Radar 4758998 asks for a better CG API to use
if (!boundingRect().contains(point))
return false;
- // CGPathContainsPoint returns false for non-closed paths, as a work-around, we copy and close the path first. Radar 4758998 asks for a better CG API to use
- CGMutablePathRef path = copyCGPathClosingSubpaths(m_path);
+ CGMutablePathRef path = CGPathCreateMutableCopy(m_path);
+ CGPathCloseSubpath(path);
bool ret = CGPathContainsPoint(path, 0, point, rule == RULE_EVENODD ? true : false);
CGPathRelease(path);
return ret;