haikuwebkit/LayoutTests/svg/custom/marker-zero-length-linecaps...

9 lines
411 B
XML
Raw Permalink Normal View History

Crash in WebCore::RenderSVGContainer::paint https://bugs.webkit.org/show_bug.cgi?id=86392 Reviewed by Rob Buis. Source/WebCore: Modernize the <marker> code, switch to the same design pattern used for handling zero-length subpaths. Decouple the generation of the marker start/mid/end positions from the actual usage of these information. Only generate those marker positions if the underlying Path changes, and never else. When figuring out the bounds for a shape, access to current set of RenderSVGResourceMarker start/mid/end resources and ask the marker resources for their bounds using the previously figured out marker positions on the Path. Drawing markers is handled in the same way. Remove SVGMarkerLayoutInfo alltogether which stored raw pointers to the RenderSVGResourceMarkers. We assumed that those objects would stay alive from layout() to paint(), but that assumption is wrong. Tests: svg/custom/bug86392.html svg/custom/marker-zero-length-linecaps-expected.svg svg/custom/marker-zero-length-linecaps.svg * CMakeLists.txt: Remove SVGMarkerLayoutInfo.*. * GNUmakefile.list.am: Ditto. * Target.pri: Ditto. * WebCore.gypi: Ditto. * WebCore.order: Ditto. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/svg/RenderSVGAllInOne.cpp: Ditto. * rendering/svg/RenderSVGShape.cpp: Handle markers just like the existing zero leng subpath code, which is superior. (WebCore::RenderSVGShape::createShape): (WebCore::RenderSVGShape::layout): (WebCore::RenderSVGShape::shouldGenerateMarkerPositions): (WebCore::RenderSVGShape::paint): (WebCore::markerForType): (WebCore::RenderSVGShape::markerRect): (WebCore::RenderSVGShape::inflateWithStrokeAndMarkerBounds): (WebCore::RenderSVGShape::drawMarkers): (WebCore::RenderSVGShape::processMarkerPositions): * rendering/svg/RenderSVGShape.h: (RenderSVGShape): * rendering/svg/SVGMarkerData.h: (WebCore::MarkerPosition::MarkerPosition): (MarkerPosition): (WebCore::SVGMarkerData::SVGMarkerData): (WebCore::SVGMarkerData::updateFromPathElement): (WebCore::SVGMarkerData::pathIsDone): (SVGMarkerData): (WebCore::SVGMarkerData::currentAngle): * rendering/svg/SVGMarkerLayoutInfo.cpp: Removed. * rendering/svg/SVGMarkerLayoutInfo.h: Removed. * rendering/svg/SVGResourcesCache.cpp: (WebCore::resourcesCacheFromRenderObject): (WebCore::SVGResourcesCache::cachedResourcesForRenderObject): * rendering/svg/SVGResourcesCache.h: (SVGResourcesCache): LayoutTests: * svg/custom/bug86392-expected.txt: Added. * svg/custom/bug86392.html: Added. * svg/custom/marker-zero-length-linecaps-expected.svg: Added. * svg/custom/marker-zero-length-linecaps.svg: Added. Canonical link: https://commits.webkit.org/104823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-05-22 14:42:10 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path d="m 50 50 l 0 0" stroke="red" stroke-width="25" stroke-linecap="round"/>
<rect x="50" y="50" width="75" height="75" fill="green" opacity="0.5"/>
<path d="m 150 50 l 0 0" stroke="red" stroke-width="25" stroke-linecap="square"/>
<rect x="150" y="50" width="75" height="75" fill="green" opacity="0.5"/>
</svg>