Changeset 52866 in webkit


Ignore:
Timestamp:
Jan 6, 2010 1:26:59 PM (14 years ago)
Author:
Nikolas Zimmermann
Message:

2010-01-06 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Dirk Schulze.

Marker code is buggy: referencePoint translation is off
https://bugs.webkit.org/show_bug.cgi?id=33012

Rewrite marker code, as it had many issues:

  • Correct refX/refY handling (covered by new marker-referencePoint.svg test)
  • Calculate marker bounds on layout time, instead of paint time, to deliver correct repaint rects
  • Cleanup RenderPath code, which was cluttered by marker stuff (outlay in SVGMarkerLayoutInfo)
  • Fix SVGResource assuming that there is only one resource per resource type per element. Markers can have three different resources of the same type (three markers, start/mid/end markers)

Filed bug 33115 (PathElementAddQuadCurveToPoint not handled for <marker>), which was just a TODO in the code before.

Fixes all svg/custom/marker*.svg tests, that use dynamic updates (propagation failed before).
Test: svg/custom/marker-referencePoint.svg

svg/custom/marker-opacity.svg
svg/custom/marker-strokeWidth-changes.svg

  • Android.mk: Add SVGMarkerData.h / SVGMarkerLayoutInfo.(cpp,h) to build.
  • GNUmakefile.am: Ditto.
  • WebCore.gypi: Ditto.
  • WebCore.pro: Ditto.
  • WebCore.vcproj/WebCore.vcproj: Ditto.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • page/FrameView.cpp: Notify RenderSVGRoot children about viewport size changes, just like it's handled for <body> in HTML. (WebCore::FrameView::layout): This is important, as marker bounding boxes may depend on the current viewport size through relative coordinates used in <svg>.
  • rendering/RenderPath.cpp: (WebCore::RenderPath::markerBoundingBox): Calculates and caches marker boundaries in the layout() phase. (WebCore::RenderPath::repaintRectInLocalCoordinates): Use the cached marker bounding box during paint() time. (WebCore::RenderPath::setPath): Clear marker boundaries upon path changes. (WebCore::RenderPath::paint): Use SVGMarkerLayoutInfo::drawMarkers() instead of the local drawMarkersIfNeeded() function, which is gone now. (WebCore::RenderPath::calculateMarkerBoundsIfNeeded): Utilized by markerBoundingBox() to request SVGResourceMarker objects and calculate their boundaries.
  • rendering/RenderPath.h: Store SVGMarkerLayoutInfo objects, and rename m_markerBounds to m_cachedLocalMarkerBBox for consistency. (WebCore::RenderPath::path): Inline this accessor.
  • rendering/RenderSVGContainer.h: Make paint() public (to be used from SVGResourceMarker), all other methods protected (to be used from RenderSVGViewportContainer).
  • rendering/RenderSVGViewportContainer.cpp: Remove useless paint() override, as the comment in the code indicated. (WebCore::RenderSVGViewportContainer::markerBoundaries): Maps the marker contents repaintRectInLocalCoordinates() into the final coordinate system (see code). (WebCore::RenderSVGViewportContainer::markerContentTransformation): Add marker-specific helper method, allowing to make viewportTransform() private again.
  • rendering/RenderSVGViewportContainer.h: Marking viewportTransform() private, it's never meant to be used outside this renderer.
  • rendering/SVGMarkerData.h: Added. Refactored from existing RenderPath code, preserving original copyrights. (WebCore::SVGMarkerData::): Helper struct for SVGMarkerLayoutInfo. (WebCore::SVGMarkerData::origin): Holds the final computed destination of a marker. (WebCore::SVGMarkerData::marker): Holds a pointer to the associated SVGResourceMarker object, which we're aiming to layout. (WebCore::SVGMarkerData::currentAngle): Calculates the current angle for a certain marker type (start/mid/end) based upon the computed inslope/outslope values. (WebCore::SVGMarkerData::updateTypeAndMarker): Helper method. (WebCore::SVGMarkerData::updateOutslope): Ditto. (WebCore::SVGMarkerData::updateMarkerDataForPathElement): Does the actual inslope/outslope calculation. (WebCore::SVGMarkerData::updateInslope): Helper method.
  • rendering/SVGMarkerLayoutInfo.cpp: Added. New approach to build marker layout info, this time correct during layout() time instead of paint() time. (WebCore::SVGMarkerLayoutInfo::SVGMarkerLayoutInfo): (WebCore::SVGMarkerLayoutInfo::~SVGMarkerLayoutInfo): (WebCore::processStartAndMidMarkers): Static helper method used to visit each path element in order to calculate inslopes/outslopes (-> orientation angles) (WebCore::SVGMarkerLayoutInfo::calculateBoundaries): Build list of MarkerLayout objects, used to query boundaries, and to paint markers during drawMarkers(). (WebCore::SVGMarkerLayoutInfo::drawMarkers): Cheap method walking existing MarkerLayout vector, drawing the individual RenderSVGViewportContainer of the markers. (WebCore::SVGMarkerLayoutInfo::addLayoutedMarker): Helper method.
  • rendering/SVGMarkerLayoutInfo.h: Added. (WebCore::MarkerLayout::MarkerLayout): Helper struct storing a pair of SVGResourceMarker* and a TranformationMatrix. (WebCore::SVGMarkerLayoutInfo::markerData): Public helper methods returning references to private member variables, used from processStartAndMidMarkers. (WebCore::SVGMarkerLayoutInfo::midMarker): Ditto. (WebCore::SVGMarkerLayoutInfo::elementIndex): Ditto.
  • svg/SVGMarkerElement.cpp: Adopt to name change: setRef() -> setReferencePoint(). setMarker() -> setRenderer() (WebCore::SVGMarkerElement::~SVGMarkerElement): Remove obsolete detach() hack, fixed by SVGUseElement changes. (WebCore::SVGMarkerElement::canvasResource): Add ASSERT(renderer()) to clarify that canvasResource() is only meant to used after renderer creation.
  • svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::~SVGSVGElement): Remove obsolete detach() hack, fixed by SVGUseElement changes.
  • svg/SVGUseElement.cpp: Rework buildPendingResource() to remove SVGSVGElement/SVGMarkerElement detach() hacks (called manually from destructors), see below. (WebCore::SVGUseElement::buildPendingResource): Always detach() the shadow tree root element, before destructing it - this caused the regression with this patch before.
  • svg/graphics/SVGResource.cpp: Instead of maintaining a global hashmap between SVGStyledElements and an array of possible SVGResources, use a HashSet of SVGResources

and directly scan the already existing list of clients for a certain SVGResource. This wrong approach has been introduced over two years
ago, making the assumption that there's only one resource type per element. Though markers can provide three resources of the same type
per element (all SVGResourceMarker objects, but in different rules: start/mid/end marker). That information is only available while painting.

(WebCore::resourceSet): Add global static HashSet<SVGResource*>.
(WebCore::SVGResource::SVGResource): Add us to the resourceSet.
(WebCore::SVGResource::~SVGResource): Remove us from resourceSet.
(WebCore::SVGResource::removeClient): Traverse all SVGResource clients and remove the passed SVGStyledElement from the client list (invoked by SVGStyledElement destructor).
(WebCore::SVGResource::addClient): Remove the offending part of the old approach, making the wrong assumption regarding resource types.

  • svg/graphics/SVGResourceMarker.cpp: (WebCore::SVGResourceMarker::SVGResourceMarker): (WebCore::SVGResourceMarker::markerTransformation): Create TransformationMatrix in the local marker content (RenderSVGViewportContainer) coordinate system, to position a marker. (WebCore::SVGResourceMarker::draw): Simplify marker drawing a lot: used the passing TransformationMatrix (cached in SVGMarkerLayoutInfo) to draw the marker content renderer. (WebCore::SVGResourceMarker::externalRepresentation): Adopt to refX/refY -> referencePoint changes.
  • svg/graphics/SVGResourceMarker.h: Store a FloatPoint m_referecePoint instead of two refX/refY float values. (WebCore::SVGResourceMarker::setRenderer): Renamed from setMarker(). (WebCore::SVGResourceMarker::setReferencePoint): Renamed from setRef(). (WebCore::SVGResourceMarker::referencePoint): New accessor replacing refX() / refY().
Location:
trunk
Files:
15 added
42 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r52865 r52866  
     12010-01-06  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        Marker code is buggy: referencePoint translation is off
     6        https://bugs.webkit.org/show_bug.cgi?id=33012
     7
     8        Update SVG test baseline, after rewriting marker support.
     9
     10        * platform/mac/svg/W3C-SVG-1.1/painting-marker-01-f-expected.txt:
     11        * platform/mac/svg/W3C-SVG-1.1/painting-marker-02-f-expected.txt:
     12        * platform/mac/svg/W3C-SVG-1.1/painting-marker-03-f-expected.txt:
     13        * platform/mac/svg/custom/circular-marker-reference-1-expected.txt:
     14        * platform/mac/svg/custom/circular-marker-reference-2-expected.txt:
     15        * platform/mac/svg/custom/circular-marker-reference-3-expected.txt:
     16        * platform/mac/svg/custom/circular-marker-reference-4-expected.txt:
     17        * platform/mac/svg/custom/js-late-marker-and-object-creation-expected.txt:
     18        * platform/mac/svg/custom/js-late-marker-creation-expected.txt:
     19        * platform/mac/svg/custom/marker-changes-expected.checksum:
     20        * platform/mac/svg/custom/marker-changes-expected.png:
     21        * platform/mac/svg/custom/marker-changes-expected.txt:
     22        * platform/mac/svg/custom/marker-child-changes-expected.checksum:
     23        * platform/mac/svg/custom/marker-child-changes-expected.png:
     24        * platform/mac/svg/custom/marker-child-changes-expected.txt:
     25        * platform/mac/svg/custom/marker-default-width-height-expected.txt:
     26        * platform/mac/svg/custom/marker-opacity-expected.checksum: Added.
     27        * platform/mac/svg/custom/marker-opacity-expected.png: Added.
     28        * platform/mac/svg/custom/marker-opacity-expected.txt: Added.
     29        * platform/mac/svg/custom/marker-referencePoint-expected.checksum: Added.
     30        * platform/mac/svg/custom/marker-referencePoint-expected.png: Added.
     31        * platform/mac/svg/custom/marker-referencePoint-expected.txt: Added.
     32        * platform/mac/svg/custom/marker-strokeWidth-changes-expected.checksum: Added.
     33        * platform/mac/svg/custom/marker-strokeWidth-changes-expected.png: Added.
     34        * platform/mac/svg/custom/marker-strokeWidth-changes-expected.txt: Added.
     35        * platform/mac/svg/custom/marker-viewBox-changes-expected.checksum:
     36        * platform/mac/svg/custom/marker-viewBox-changes-expected.png:
     37        * platform/mac/svg/custom/marker-viewBox-changes-expected.txt:
     38        * platform/mac/svg/custom/non-circular-marker-reference-expected.txt:
     39        * platform/mac/svg/custom/shapes-supporting-markers-expected.txt:
     40        * svg/custom/marker-opacity.svg: Added.
     41        * svg/custom/marker-referencePoint.svg: Added.
     42        * svg/custom/marker-strokeWidth-changes.svg: Added.
     43
    1442010-01-06  Dirk Schulze  <krit@webkit.org>
    245
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/painting-marker-01-f-expected.txt

    r52750 r52866  
    2222        RenderSVGInlineText {#text} at (0,-13) size 90x16
    2323          chunk 1 text run 1 at (170.00,30.00) startOffset 0 endOffset 13 width 90.00: "Basic Markers"
    24       RenderPath {path} at (130,36) size 54x54 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M130.00,40.00 L180.00,40.00 L180.00,90.00"]
     24      RenderPath {path} at (122,32) size 66x66 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M130.00,40.00 L180.00,40.00 L180.00,90.00"]
    2525      RenderSVGContainer {g} at (242,32) size 66x66 [transform={m=((1.00,0.00)(0.00,1.00)) t=(120.00,0.00)}]
    2626        RenderPath {path} at (250,36) size 54x54 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [data="M130.00,40.00 L180.00,40.00 L180.00,90.00"]
     
    3434        RenderSVGInlineText {#text} at (0,-13) size 137x16
    3535          chunk 1 text run 1 at (145.00,125.00) startOffset 0 endOffset 21 width 137.00: "Start, Middle and End"
    36       RenderPath {path} at (130,131) size 54x54 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
     36      RenderPath {path} at (122,127) size 66x66 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
    3737      RenderSVGContainer {g} at (242,127) size 66x66 [transform={m=((1.00,0.00)(0.00,1.00)) t=(120.00,0.00)}]
    3838        RenderPath {path} at (250,131) size 54x54 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
     
    4646        RenderSVGInlineText {#text} at (0,-13) size 137x16
    4747          chunk 1 text run 1 at (145.00,220.00) startOffset 0 endOffset 21 width 137.00: "Automatic Orientation"
    48       RenderPath {path} at (130,226) size 54x54 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=marker2] [middle marker=marker2] [end marker=marker2] [data="M130.00,230.00 L180.00,230.00 L180.00,280.00"]
     48      RenderPath {path} at (122,218.69) size 69.31x69.31 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=marker2] [middle marker=marker2] [end marker=marker2] [data="M130.00,230.00 L180.00,230.00 L180.00,280.00"]
    4949      RenderSVGContainer {g} at (242,218.69) size 69.31x69.31 [transform={m=((1.00,0.00)(0.00,1.00)) t=(120.00,0.00)}]
    5050        RenderPath {path} at (250,226) size 54x54 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [data="M130.00,230.00 L180.00,230.00 L180.00,280.00"]
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/painting-marker-02-f-expected.txt

    r52750 r52866  
    2020          RenderSVGInlineText {#text} at (0,-9) size 54x11
    2121            chunk 1 text run 1 at (100.00,140.00) startOffset 0 endOffset 13 width 54.00: "Fill Property"
    22         RenderPath {path} at (30,60) size 50x50 [fill={[type=SOLID] [color=#000000]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M30.00,60.00 L80.00,60.00 L80.00,110.00 Z"]
     22        RenderPath {path} at (22,52) size 66x66 [fill={[type=SOLID] [color=#000000]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M30.00,60.00 L80.00,60.00 L80.00,110.00 Z"]
    2323        RenderSVGContainer {g} at (142,52) size 66x66 [transform={m=((1.00,0.00)(0.00,1.00)) t=(120.00,0.00)}]
    2424          RenderPath {path} at (150,60) size 50x50 [fill={[type=SOLID] [color=#000000]}] [data="M30.00,60.00 L80.00,60.00 L80.00,110.00 Z"]
     
    4141          RenderSVGInlineText {#text} at (0,-9) size 72x11
    4242            chunk 1 text run 1 at (340.00,140.00) startOffset 0 endOffset 15 width 72.00: "Stroke Property"
    43         RenderPath {path} at (265.17,58) size 56.83x56.83 [stroke={[type=SOLID] [color=#000000] [stroke width=4.00]}] [start marker=marker2] [middle marker=marker2] [end marker=marker2] [data="M270.00,60.00 L320.00,60.00 L320.00,110.00 Z"]
     43        RenderPath {path} at (260.40,50.40) size 69.20x69.20 [stroke={[type=SOLID] [color=#000000] [stroke width=4.00]}] [start marker=marker2] [middle marker=marker2] [end marker=marker2] [data="M270.00,60.00 L320.00,60.00 L320.00,110.00 Z"]
    4444        RenderSVGContainer {g} at (382,52) size 66x66 [transform={m=((1.00,0.00)(0.00,1.00)) t=(120.00,0.00)}]
    4545          RenderPath {path} at (385.17,58) size 56.83x56.83 [stroke={[type=SOLID] [color=#000000] [stroke width=4.00]}] [data="M270.00,60.00 L320.00,60.00 L320.00,110.00 Z"]
     
    6161        RenderSVGViewportContainer {marker} at (-0.80,-0.80) size 5.60x5.60
    6262          RenderPath {rect} at (-0.80,-0.80) size 5.60x5.60 [stroke={[type=SOLID] [color=#0000FF] [stroke width=4.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L10.00,0.00 L10.00,10.00 L0.00,10.00 Z"]
    63       RenderSVGContainer {g} at (25.17,182) size 182.83x90
     63      RenderSVGContainer {g} at (18.80,178.80) size 189.20x93.20
    6464        RenderSVGText {text} at (90,270) size 77x11 contains 1 chunk(s)
    6565          RenderSVGInlineText {#text} at (0,-9) size 77x11
    6666            chunk 1 text run 1 at (90.00,270.00) startOffset 0 endOffset 16 width 77.00: "Mixed Properties"
    67         RenderPath {path} at (25.17,188) size 56.83x56.83 [stroke={[type=SOLID] [color=#800080] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FF0000]}] [start marker=marker3] [middle marker=marker3] [end marker=marker3] [data="M30.00,190.00 L80.00,190.00 L80.00,240.00 Z"]
     67        RenderPath {path} at (18.80,178.80) size 72.40x72.40 [stroke={[type=SOLID] [color=#800080] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FF0000]}] [start marker=marker3] [middle marker=marker3] [end marker=marker3] [data="M30.00,190.00 L80.00,190.00 L80.00,240.00 Z"]
    6868        RenderSVGContainer {g} at (142,182) size 66x66 [transform={m=((1.00,0.00)(0.00,1.00)) t=(120.00,0.00)}]
    6969          RenderPath {path} at (145.17,188) size 56.83x56.83 [stroke={[type=SOLID] [color=#800080] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M30.00,190.00 L80.00,190.00 L80.00,240.00 Z"]
     
    8181                RenderSVGContainer {g} at (188.80,228.80) size 22.40x22.40 [transform={m=((0.20,0.00)(0.00,0.20)) t=(0.00,0.00)}]
    8282                  RenderPath {rect} at (188.80,228.80) size 22.40x22.40 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L20.00,0.00 L20.00,20.00 L0.00,20.00 Z"]
    83       RenderSVGContainer {g} at (265.17,182) size 182.83x90
     83      RenderSVGContainer {g} at (258.80,178.80) size 189.20x93.20
    8484        RenderSVGText {text} at (340,270) size 77x11 contains 1 chunk(s)
    8585          RenderSVGInlineText {#text} at (0,-9) size 77x11
    8686            chunk 1 text run 1 at (340.00,270.00) startOffset 0 endOffset 16 width 77.00: "Mixed Properties"
    87         RenderPath {path} at (265.17,188) size 56.83x56.83 [stroke={[type=SOLID] [color=#800080] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FF0000]}] [start marker=marker4] [middle marker=marker4] [end marker=marker4] [data="M270.00,190.00 L320.00,190.00 L320.00,240.00 Z"]
     87        RenderPath {path} at (258.80,178.80) size 72.40x72.40 [stroke={[type=SOLID] [color=#800080] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FF0000]}] [start marker=marker4] [middle marker=marker4] [end marker=marker4] [data="M270.00,190.00 L320.00,190.00 L320.00,240.00 Z"]
    8888        RenderSVGContainer {g} at (382,182) size 66x66 [transform={m=((1.00,0.00)(0.00,1.00)) t=(120.00,0.00)}]
    8989          RenderPath {path} at (385.17,188) size 56.83x56.83 [stroke={[type=SOLID] [color=#800080] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M270.00,190.00 L320.00,190.00 L320.00,240.00 Z"]
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/painting-marker-03-f-expected.txt

    r52750 r52866  
    1616      RenderSVGInlineText {#text} at (0,-18) size 140x23
    1717        chunk 1 (middle anchor) text run 1 at (170.00,70.00) startOffset 0 endOffset 17 width 140.00: "'marker' property"
    18     RenderSVGContainer {g} at (59.50,79.50) size 360.83x81 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,20.00)}] [start marker=marker1] [middle marker=marker1] [end marker=marker1]
    19       RenderPath {path} at (59.50,79.50) size 81x81 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M10.00,60.00 C63.33,60.00,90.00,86.67,90.00,140.00 C36.67,140.00,10.00,113.33,10.00,60.00 Z M10.00,140.00 C10.00,86.67,36.67,60.00,90.00,60.00 C90.00,113.33,63.33,140.00,10.00,140.00 Z M50.00,70.00 L80.00,100.00 L50.00,130.00 L20.00,100.00 Z"]
    20       RenderPath {polygon} at (149.50,79.88) size 81x80.24 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M100.00,60.00 L120.00,140.00 L140.00,60.00 L160.00,140.00 L180.00,60.00 L180.00,100.00 L100.00,100.00 Z"]
    21       RenderPath {polyline} at (239.51,79.88) size 80.99x80.24 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M190.00,60.00 L210.00,140.00 L230.00,60.00 L250.00,140.00 L270.00,60.00 L270.00,100.00 L190.00,100.00"]
    22       RenderPath {line} at (329.67,79.63) size 90.66x80.75 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M280.00,60.00 L370.00,140.00"]
    23       RenderPath {line} at (329.67,79.63) size 90.66x80.75 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M370.00,60.00 L280.00,140.00"]
     18    RenderSVGContainer {g} at (57.50,77.50) size 365x85 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,20.00)}] [start marker=marker1] [middle marker=marker1] [end marker=marker1]
     19      RenderPath {path} at (57.50,77.50) size 85x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M10.00,60.00 C63.33,60.00,90.00,86.67,90.00,140.00 C36.67,140.00,10.00,113.33,10.00,60.00 Z M10.00,140.00 C10.00,86.67,36.67,60.00,90.00,60.00 C90.00,113.33,63.33,140.00,10.00,140.00 Z M50.00,70.00 L80.00,100.00 L50.00,130.00 L20.00,100.00 Z"]
     20      RenderPath {polygon} at (147.50,77.50) size 85x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M100.00,60.00 L120.00,140.00 L140.00,60.00 L160.00,140.00 L180.00,60.00 L180.00,100.00 L100.00,100.00 Z"]
     21      RenderPath {polyline} at (237.50,77.50) size 85x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M190.00,60.00 L210.00,140.00 L230.00,60.00 L250.00,140.00 L270.00,60.00 L270.00,100.00 L190.00,100.00"]
     22      RenderPath {line} at (327.50,77.50) size 95x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M280.00,60.00 L370.00,140.00"]
     23      RenderPath {line} at (327.50,77.50) size 95x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M370.00,60.00 L280.00,140.00"]
    2424    RenderSVGText {text} at (27,200) size 426x23 contains 1 chunk(s)
    2525      RenderSVGInlineText {#text} at (0,-18) size 426x23
    2626        chunk 1 (middle anchor) text run 1 at (27.00,200.00) startOffset 0 endOffset 53 width 426.00: "'marker-start', 'marker-mid' & 'marker-end' attribute"
    27     RenderSVGContainer {g} at (59.50,209.50) size 360.83x81 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,150.00)}] [start marker=marker1] [middle marker=marker1] [end marker=marker1]
    28       RenderPath {path} at (59.50,209.50) size 81x81 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M10.00,60.00 C63.33,60.00,90.00,86.67,90.00,140.00 C36.67,140.00,10.00,113.33,10.00,60.00 Z M10.00,140.00 C10.00,86.67,36.67,60.00,90.00,60.00 C90.00,113.33,63.33,140.00,10.00,140.00 Z M50.00,70.00 L80.00,100.00 L50.00,130.00 L20.00,100.00 Z"]
    29       RenderPath {polygon} at (149.50,209.88) size 81x80.24 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M100.00,60.00 L120.00,140.00 L140.00,60.00 L160.00,140.00 L180.00,60.00 L180.00,100.00 L100.00,100.00 Z"]
    30       RenderPath {polyline} at (239.51,209.88) size 80.99x80.24 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M190.00,60.00 L210.00,140.00 L230.00,60.00 L250.00,140.00 L270.00,60.00 L270.00,100.00 L190.00,100.00"]
    31       RenderPath {line} at (329.67,209.63) size 90.66x80.75 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M280.00,60.00 L370.00,140.00"]
    32       RenderPath {line} at (329.67,209.63) size 90.66x80.75 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M370.00,60.00 L280.00,140.00"]
     27    RenderSVGContainer {g} at (57.50,207.50) size 365x85 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,150.00)}] [start marker=marker1] [middle marker=marker1] [end marker=marker1]
     28      RenderPath {path} at (57.50,207.50) size 85x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M10.00,60.00 C63.33,60.00,90.00,86.67,90.00,140.00 C36.67,140.00,10.00,113.33,10.00,60.00 Z M10.00,140.00 C10.00,86.67,36.67,60.00,90.00,60.00 C90.00,113.33,63.33,140.00,10.00,140.00 Z M50.00,70.00 L80.00,100.00 L50.00,130.00 L20.00,100.00 Z"]
     29      RenderPath {polygon} at (147.50,207.50) size 85x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M100.00,60.00 L120.00,140.00 L140.00,60.00 L160.00,140.00 L180.00,60.00 L180.00,100.00 L100.00,100.00 Z"]
     30      RenderPath {polyline} at (237.50,207.50) size 85x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M190.00,60.00 L210.00,140.00 L230.00,60.00 L250.00,140.00 L270.00,60.00 L270.00,100.00 L190.00,100.00"]
     31      RenderPath {line} at (327.50,207.50) size 95x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M280.00,60.00 L370.00,140.00"]
     32      RenderPath {line} at (327.50,207.50) size 95x85 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFD700] [fill rule=EVEN-ODD]}] [start marker=marker1] [middle marker=marker1] [end marker=marker1] [data="M370.00,60.00 L280.00,140.00"]
    3333    RenderSVGText {text} at (10,340) size 264x46 contains 1 chunk(s)
    3434      RenderSVGInlineText {#text} at (0,-36) size 264x46
  • trunk/LayoutTests/platform/mac/svg/custom/circular-marker-reference-1-expected.txt

    r52750 r52866  
    33  RenderView at (0,0) size 800x600
    44layer at (0,0) size 800x600
    5   RenderSVGRoot {svg} at (235,345) size 330x30
     5  RenderSVGRoot {svg} at (108.67,265.08) size 458.91x109.92
    66    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    7       RenderSVGViewportContainer {marker} at (-2.06,-0.94) size 4.12x0.38
    8         RenderPath {path} at (-2.06,-0.94) size 4.12x0.38 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
    9     RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
     7      RenderSVGViewportContainer {marker} at (-3.21,-1.66) size 5.30x1.10
     8        RenderPath {path} at (-3.21,-1.66) size 5.30x1.10 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
     9    RenderPath {path} at (108.67,265.08) size 458.91x109.92 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/circular-marker-reference-2-expected.txt

    r52750 r52866  
    33  RenderView at (0,0) size 800x600
    44layer at (0,0) size 800x600
    5   RenderSVGRoot {svg} at (235,225) size 330x150 [start marker=mark] [middle marker=mark] [end marker=mark]
     5  RenderSVGRoot {svg} at (210.63,200.63) size 378.74x198.74 [start marker=mark] [middle marker=mark] [end marker=mark]
    66    RenderSVGHiddenContainer {defs} at (0,0) size 0x0 [start marker=mark] [middle marker=mark] [end marker=mark]
    77      RenderSVGViewportContainer {marker} at (0.19,0.19) size 2.62x2.62 [start marker=mark] [middle marker=mark] [end marker=mark]
    88        RenderPath {circle} at (0.19,0.19) size 2.62x2.62 [stroke={[type=SOLID] [color=#FF0000] [line cap=ROUND]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M7.00,4.00 L6.99,4.19 L6.98,4.38 L6.95,4.56 L6.91,4.75 L6.85,4.93 L6.79,5.10 L6.71,5.28 L6.63,5.45 L6.53,5.61 L6.43,5.76 L6.31,5.91 L6.19,6.05 L6.05,6.19 L5.91,6.31 L5.76,6.43 L5.61,6.53 L5.45,6.63 L5.28,6.71 L5.10,6.79 L4.93,6.85 L4.75,6.91 L4.56,6.95 L4.38,6.98 L4.19,6.99 L4.00,7.00 L3.81,6.99 L3.62,6.98 L3.44,6.95 L3.25,6.91 L3.07,6.85 L2.90,6.79 L2.72,6.71 L2.55,6.63 L2.39,6.53 L2.24,6.43 L2.09,6.31 L1.95,6.19 L1.81,6.05 L1.69,5.91 L1.57,5.76 L1.47,5.61 L1.37,5.45 L1.29,5.28 L1.21,5.10 L1.15,4.93 L1.09,4.75 L1.05,4.56 L1.02,4.38 L1.01,4.19 L1.00,4.00 L1.01,3.81 L1.02,3.62 L1.05,3.44 L1.09,3.25 L1.15,3.07 L1.21,2.90 L1.29,2.72 L1.37,2.55 L1.47,2.39 L1.57,2.24 L1.69,2.09 L1.81,1.95 L1.95,1.81 L2.09,1.69 L2.24,1.57 L2.39,1.47 L2.55,1.37 L2.72,1.29 L2.90,1.21 L3.07,1.15 L3.25,1.09 L3.44,1.05 L3.62,1.02 L3.81,1.01 L4.00,1.00 L4.19,1.01 L4.38,1.02 L4.56,1.05 L4.75,1.09 L4.93,1.15 L5.10,1.21 L5.28,1.29 L5.45,1.37 L5.61,1.47 L5.76,1.57 L5.91,1.69 L6.05,1.81 L6.19,1.95 L6.31,2.09 L6.43,2.24 L6.53,2.39 L6.63,2.55 L6.71,2.72 L6.79,2.90 L6.85,3.07 L6.91,3.25 L6.95,3.44 L6.98,3.62 L6.99,3.81 Z"]
    9     RenderPath {path} at (235,225) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
    10     RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
     9    RenderPath {path} at (210.63,200.63) size 378.74x78.74 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
     10    RenderPath {path} at (210.63,320.63) size 378.74x78.74 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/circular-marker-reference-3-expected.txt

    r52750 r52866  
    33  RenderView at (0,0) size 800x600
    44layer at (0,0) size 800x600
    5   RenderSVGRoot {svg} at (235,345) size 330x30 [start marker=mark] [middle marker=mark] [end marker=mark]
     5  RenderSVGRoot {svg} at (108.67,265.08) size 458.91x109.92 [start marker=mark] [middle marker=mark] [end marker=mark]
    66    RenderSVGHiddenContainer {defs} at (0,0) size 0x0 [start marker=mark] [middle marker=mark] [end marker=mark]
    7       RenderSVGViewportContainer {marker} at (-2.06,-0.94) size 4.12x0.38 [start marker=mark] [middle marker=mark] [end marker=mark]
    8         RenderPath {path} at (-2.06,-0.94) size 4.12x0.38 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
    9     RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
     7      RenderSVGViewportContainer {marker} at (-3.21,-1.66) size 5.30x1.10 [start marker=mark] [middle marker=mark] [end marker=mark]
     8        RenderPath {path} at (-3.21,-1.66) size 5.30x1.10 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
     9    RenderPath {path} at (108.67,265.08) size 458.91x109.92 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/circular-marker-reference-4-expected.txt

    r52750 r52866  
    44  RenderView at (0,0) size 800x600
    55layer at (0,0) size 800x600
    6   RenderSVGRoot {svg} at (235,271.88) size 330x103.12
    7     RenderSVGViewportContainer {marker} at (338.12,271.88) size 123.75x11.25
    8       RenderPath {path} at (338.12,271.88) size 123.75x11.25 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark2] [middle marker=mark2] [end marker=mark2] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
    9     RenderSVGViewportContainer {marker} at (338.12,316.88) size 123.75x11.25
    10       RenderPath {path} at (338.12,316.88) size 123.75x11.25 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark1] [middle marker=mark1] [end marker=mark1] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
    11     RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark1] [middle marker=mark1] [end marker=mark1] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
     6  RenderSVGRoot {svg} at (95.75,258.78) size 472.09x116.22
     7    RenderSVGViewportContainer {marker} at (290.75,258.78) size 172.09x24.35
     8      RenderPath {path} at (290.75,258.78) size 172.09x24.35 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark2] [middle marker=mark2] [end marker=mark2] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
     9    RenderSVGViewportContainer {marker} at (303.67,295.08) size 158.91x33.05
     10      RenderPath {path} at (303.67,295.08) size 158.91x33.05 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark1] [middle marker=mark1] [end marker=mark1] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
     11    RenderPath {path} at (95.75,273.78) size 472.09x101.22 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark1] [middle marker=mark1] [end marker=mark1] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/js-late-marker-and-object-creation-expected.txt

    r52750 r52866  
    55  RenderView at (0,0) size 800x600
    66layer at (0,0) size 800x600
    7   RenderSVGRoot {svg} at (216.67,218.33) size 90.00x90
     7  RenderSVGRoot {svg} at (203.33,211.67) size 110x110.00
    88    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    99      RenderSVGViewportContainer {marker} at (0,0) size 2x2
     
    1313      RenderSVGViewportContainer {marker} at (0,0) size 2x2
    1414        RenderPath {circle} at (0,0) size 2x2 [fill={[type=SOLID] [color=#008000]}] [data="M10.00,5.00 L9.99,5.31 L9.96,5.63 L9.91,5.94 L9.84,6.24 L9.76,6.55 L9.65,6.84 L9.52,7.13 L9.38,7.41 L9.22,7.68 L9.05,7.94 L8.85,8.19 L8.64,8.42 L8.42,8.64 L8.19,8.85 L7.94,9.05 L7.68,9.22 L7.41,9.38 L7.13,9.52 L6.84,9.65 L6.55,9.76 L6.24,9.84 L5.94,9.91 L5.63,9.96 L5.31,9.99 L5.00,10.00 L4.69,9.99 L4.37,9.96 L4.06,9.91 L3.76,9.84 L3.45,9.76 L3.16,9.65 L2.87,9.52 L2.59,9.38 L2.32,9.22 L2.06,9.05 L1.81,8.85 L1.58,8.64 L1.36,8.42 L1.15,8.19 L0.95,7.94 L0.78,7.68 L0.62,7.41 L0.48,7.13 L0.35,6.84 L0.24,6.55 L0.16,6.24 L0.09,5.94 L0.04,5.63 L0.01,5.31 L0.00,5.00 L0.01,4.69 L0.04,4.37 L0.09,4.06 L0.16,3.76 L0.24,3.45 L0.35,3.16 L0.48,2.87 L0.62,2.59 L0.78,2.32 L0.95,2.06 L1.15,1.81 L1.36,1.58 L1.58,1.36 L1.81,1.15 L2.06,0.95 L2.32,0.78 L2.59,0.62 L2.87,0.48 L3.16,0.35 L3.45,0.24 L3.76,0.16 L4.06,0.09 L4.37,0.04 L4.69,0.01 L5.00,0.00 L5.31,0.01 L5.63,0.04 L5.94,0.09 L6.24,0.16 L6.55,0.24 L6.84,0.35 L7.13,0.48 L7.41,0.62 L7.68,0.78 L7.94,0.95 L8.19,1.15 L8.42,1.36 L8.64,1.58 L8.85,1.81 L9.05,2.06 L9.22,2.32 L9.38,2.59 L9.52,2.87 L9.65,3.16 L9.76,3.45 L9.84,3.76 L9.91,4.06 L9.96,4.37 L9.99,4.69 Z"]
    15     RenderSVGContainer {g} at (216.67,218.33) size 90.00x90
    16       RenderPath {path} at (216.67,218.33) size 90.00x90 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
     15    RenderSVGContainer {g} at (203.33,211.67) size 110x110.00
     16      RenderPath {path} at (203.33,211.67) size 110x110.00 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/js-late-marker-creation-expected.txt

    r52750 r52866  
    55  RenderView at (0,0) size 800x600
    66layer at (0,0) size 800x600
    7   RenderSVGRoot {svg} at (216.67,218.33) size 90.00x90
     7  RenderSVGRoot {svg} at (203.33,211.67) size 110x110.00
    88    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    99      RenderSVGViewportContainer {marker} at (0,0) size 2x2
     
    1313      RenderSVGViewportContainer {marker} at (0,0) size 2x2
    1414        RenderPath {circle} at (0,0) size 2x2 [fill={[type=SOLID] [color=#008000]}] [data="M10.00,5.00 L9.99,5.31 L9.96,5.63 L9.91,5.94 L9.84,6.24 L9.76,6.55 L9.65,6.84 L9.52,7.13 L9.38,7.41 L9.22,7.68 L9.05,7.94 L8.85,8.19 L8.64,8.42 L8.42,8.64 L8.19,8.85 L7.94,9.05 L7.68,9.22 L7.41,9.38 L7.13,9.52 L6.84,9.65 L6.55,9.76 L6.24,9.84 L5.94,9.91 L5.63,9.96 L5.31,9.99 L5.00,10.00 L4.69,9.99 L4.37,9.96 L4.06,9.91 L3.76,9.84 L3.45,9.76 L3.16,9.65 L2.87,9.52 L2.59,9.38 L2.32,9.22 L2.06,9.05 L1.81,8.85 L1.58,8.64 L1.36,8.42 L1.15,8.19 L0.95,7.94 L0.78,7.68 L0.62,7.41 L0.48,7.13 L0.35,6.84 L0.24,6.55 L0.16,6.24 L0.09,5.94 L0.04,5.63 L0.01,5.31 L0.00,5.00 L0.01,4.69 L0.04,4.37 L0.09,4.06 L0.16,3.76 L0.24,3.45 L0.35,3.16 L0.48,2.87 L0.62,2.59 L0.78,2.32 L0.95,2.06 L1.15,1.81 L1.36,1.58 L1.58,1.36 L1.81,1.15 L2.06,0.95 L2.32,0.78 L2.59,0.62 L2.87,0.48 L3.16,0.35 L3.45,0.24 L3.76,0.16 L4.06,0.09 L4.37,0.04 L4.69,0.01 L5.00,0.00 L5.31,0.01 L5.63,0.04 L5.94,0.09 L6.24,0.16 L6.55,0.24 L6.84,0.35 L7.13,0.48 L7.41,0.62 L7.68,0.78 L7.94,0.95 L8.19,1.15 L8.42,1.36 L8.64,1.58 L8.85,1.81 L9.05,2.06 L9.22,2.32 L9.38,2.59 L9.52,2.87 L9.65,3.16 L9.76,3.45 L9.84,3.76 L9.91,4.06 L9.96,4.37 L9.99,4.69 Z"]
    15     RenderSVGContainer {g} at (216.67,218.33) size 90.00x90
    16       RenderPath {path} at (216.67,218.33) size 90.00x90 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
     15    RenderSVGContainer {g} at (203.33,211.67) size 110x110.00
     16      RenderPath {path} at (203.33,211.67) size 110x110.00 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/marker-changes-expected.checksum

    r52750 r52866  
    1 cb9c6ae0d0cd0a862ab1a47be6272684
     1fbb0a4464cb404cec2fa22a55477ff2e
  • trunk/LayoutTests/platform/mac/svg/custom/marker-changes-expected.txt

    r52750 r52866  
    55  RenderView at (0,0) size 800x600
    66layer at (0,0) size 800x600
    7   RenderSVGRoot {svg} at (130,131) size 54x54
     7  RenderSVGRoot {svg} at (122,127) size 66x66
    88    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    99      RenderSVGViewportContainer {marker} at (0,0) size 2x2
     
    1313      RenderSVGViewportContainer {marker} at (0,0) size 2x2
    1414        RenderPath {path} at (0,0) size 2x2 [fill={[type=SOLID] [color=#0000FF]}] [data="M5.00,0.00 L10.00,10.00 L0.00,10.00 Z"]
    15     RenderSVGContainer {g} at (130,131) size 54x54
    16       RenderPath {path} at (130,131) size 54x54 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
     15    RenderSVGContainer {g} at (122,127) size 66x66
     16      RenderPath {path} at (122,127) size 66x66 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/marker-child-changes-expected.checksum

    r52750 r52866  
    1 f99aed7b122ebf0155573231013d80d7
     1fbb0a4464cb404cec2fa22a55477ff2e
  • trunk/LayoutTests/platform/mac/svg/custom/marker-child-changes-expected.txt

    r52750 r52866  
    55  RenderView at (0,0) size 800x600
    66layer at (0,0) size 800x600
    7   RenderSVGRoot {svg} at (130,131) size 54x54
     7  RenderSVGRoot {svg} at (122,127) size 66x66
    88    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    99      RenderSVGViewportContainer {marker} at (0,0) size 2x2
     
    1313      RenderSVGViewportContainer {marker} at (0,0) size 2x2
    1414        RenderPath {path} at (0,0) size 2x2 [fill={[type=SOLID] [color=#0000FF]}] [data="M5.00,0.00 L10.00,10.00 L0.00,10.00 Z"]
    15     RenderSVGContainer {g} at (130,131) size 54x54
    16       RenderPath {path} at (130,131) size 54x54 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
     15    RenderSVGContainer {g} at (122,127) size 66x66
     16      RenderPath {path} at (122,127) size 66x66 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/marker-default-width-height-expected.txt

    r52750 r52866  
    55  RenderView at (0,0) size 800x600
    66layer at (0,0) size 800x600
    7   RenderSVGRoot {svg} at (0,0) size 643.33x283.33
    8     RenderSVGContainer {g} at (0,0) size 643.33x283.33
     7  RenderSVGRoot {svg} at (0,0) size 643.33x303.33
     8    RenderSVGContainer {g} at (0,0) size 643.33x303.33
    99      RenderSVGText {text} at (0,20) size 386x18 contains 1 chunk(s)
    1010        RenderSVGInlineText {#text} at (0,-14) size 386x18
     
    2525      RenderSVGViewportContainer {marker} at (0,0) size 5x5
    2626        RenderPath {rect} at (0,0) size 5x5 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L10.00,0.00 L10.00,10.00 L0.00,10.00 Z"]
    27       RenderPath {path} at (216.67,200) size 83.33x83.33 [start marker=marker1] [middle marker=marker2] [end marker=marker3] [data="M130.00,120.00 L180.00,120.00 L180.00,170.00"]
     27      RenderPath {path} at (196.67,180) size 123.33x123.33 [start marker=marker1] [middle marker=marker2] [end marker=marker3] [data="M130.00,120.00 L180.00,120.00 L180.00,170.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/marker-viewBox-changes-expected.checksum

    r52750 r52866  
    1 112d6156ec1070f8934e12652f26239a
     1fbb0a4464cb404cec2fa22a55477ff2e
  • trunk/LayoutTests/platform/mac/svg/custom/marker-viewBox-changes-expected.txt

    r52750 r52866  
    55  RenderView at (0,0) size 800x600
    66layer at (0,0) size 800x600
    7   RenderSVGRoot {svg} at (130,131) size 54x54
     7  RenderSVGRoot {svg} at (122,127) size 66x66
    88    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    99      RenderSVGViewportContainer {marker} at (0,0) size 2x2
     
    1313      RenderSVGViewportContainer {marker} at (0,0) size 2x2
    1414        RenderPath {path} at (0,0) size 2x2 [fill={[type=SOLID] [color=#0000FF]}] [data="M5.00,0.00 L10.00,10.00 L0.00,10.00 Z"]
    15     RenderSVGContainer {g} at (130,131) size 54x54
    16       RenderPath {path} at (130,131) size 54x54 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
     15    RenderSVGContainer {g} at (122,127) size 66x66
     16      RenderPath {path} at (122,127) size 66x66 [stroke={[type=SOLID] [color=#000000] [stroke width=8.00]}] [start marker=markerStart] [middle marker=markerMiddle] [end marker=markerEnd] [data="M130.00,135.00 L180.00,135.00 L180.00,185.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/non-circular-marker-reference-expected.txt

    r52750 r52866  
    33  RenderView at (0,0) size 800x600
    44layer at (0,0) size 800x600
    5   RenderSVGRoot {svg} at (235,225) size 330x150
     5  RenderSVGRoot {svg} at (210.63,225) size 378.74x174.37
    66    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    77      RenderSVGViewportContainer {marker} at (0.19,0.19) size 2.62x2.62
    88        RenderPath {circle} at (0.19,0.19) size 2.62x2.62 [stroke={[type=SOLID] [color=#FF0000] [line cap=ROUND]}] [data="M7.00,4.00 L6.99,4.19 L6.98,4.38 L6.95,4.56 L6.91,4.75 L6.85,4.93 L6.79,5.10 L6.71,5.28 L6.63,5.45 L6.53,5.61 L6.43,5.76 L6.31,5.91 L6.19,6.05 L6.05,6.19 L5.91,6.31 L5.76,6.43 L5.61,6.53 L5.45,6.63 L5.28,6.71 L5.10,6.79 L4.93,6.85 L4.75,6.91 L4.56,6.95 L4.38,6.98 L4.19,6.99 L4.00,7.00 L3.81,6.99 L3.62,6.98 L3.44,6.95 L3.25,6.91 L3.07,6.85 L2.90,6.79 L2.72,6.71 L2.55,6.63 L2.39,6.53 L2.24,6.43 L2.09,6.31 L1.95,6.19 L1.81,6.05 L1.69,5.91 L1.57,5.76 L1.47,5.61 L1.37,5.45 L1.29,5.28 L1.21,5.10 L1.15,4.93 L1.09,4.75 L1.05,4.56 L1.02,4.38 L1.01,4.19 L1.00,4.00 L1.01,3.81 L1.02,3.62 L1.05,3.44 L1.09,3.25 L1.15,3.07 L1.21,2.90 L1.29,2.72 L1.37,2.55 L1.47,2.39 L1.57,2.24 L1.69,2.09 L1.81,1.95 L1.95,1.81 L2.09,1.69 L2.24,1.57 L2.39,1.47 L2.55,1.37 L2.72,1.29 L2.90,1.21 L3.07,1.15 L3.25,1.09 L3.44,1.05 L3.62,1.02 L3.81,1.01 L4.00,1.00 L4.19,1.01 L4.38,1.02 L4.56,1.05 L4.75,1.09 L4.93,1.15 L5.10,1.21 L5.28,1.29 L5.45,1.37 L5.61,1.47 L5.76,1.57 L5.91,1.69 L6.05,1.81 L6.19,1.95 L6.31,2.09 L6.43,2.24 L6.53,2.39 L6.63,2.55 L6.71,2.72 L6.79,2.90 L6.85,3.07 L6.91,3.25 L6.95,3.44 L6.98,3.62 L6.99,3.81 Z"]
    99    RenderPath {path} at (235,225) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
    10     RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
     10    RenderPath {path} at (210.63,320.63) size 378.74x78.74 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/shapes-supporting-markers-expected.txt

    r52750 r52866  
    33  RenderView at (0,0) size 800x600
    44layer at (0,0) size 800x600
    5   RenderSVGRoot {svg} at (-0.83,10) size 622.50x275.20
     5  RenderSVGRoot {svg} at (-2.19,10) size 623.85x275.52
    66    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    77      RenderSVGViewportContainer {marker} at (0.19,0.19) size 2.62x2.62
    88        RenderPath {circle} at (0.19,0.19) size 2.62x2.62 [stroke={[type=SOLID] [color=#FF0000]}] [data="M7.00,4.00 L6.99,4.19 L6.98,4.38 L6.95,4.56 L6.91,4.75 L6.85,4.93 L6.79,5.10 L6.71,5.28 L6.63,5.45 L6.53,5.61 L6.43,5.76 L6.31,5.91 L6.19,6.05 L6.05,6.19 L5.91,6.31 L5.76,6.43 L5.61,6.53 L5.45,6.63 L5.28,6.71 L5.10,6.79 L4.93,6.85 L4.75,6.91 L4.56,6.95 L4.38,6.98 L4.19,6.99 L4.00,7.00 L3.81,6.99 L3.62,6.98 L3.44,6.95 L3.25,6.91 L3.07,6.85 L2.90,6.79 L2.72,6.71 L2.55,6.63 L2.39,6.53 L2.24,6.43 L2.09,6.31 L1.95,6.19 L1.81,6.05 L1.69,5.91 L1.57,5.76 L1.47,5.61 L1.37,5.45 L1.29,5.28 L1.21,5.10 L1.15,4.93 L1.09,4.75 L1.05,4.56 L1.02,4.38 L1.01,4.19 L1.00,4.00 L1.01,3.81 L1.02,3.62 L1.05,3.44 L1.09,3.25 L1.15,3.07 L1.21,2.90 L1.29,2.72 L1.37,2.55 L1.47,2.39 L1.57,2.24 L1.69,2.09 L1.81,1.95 L1.95,1.81 L2.09,1.69 L2.24,1.57 L2.39,1.47 L2.55,1.37 L2.72,1.29 L2.90,1.21 L3.07,1.15 L3.25,1.09 L3.44,1.05 L3.62,1.02 L3.81,1.01 L4.00,1.00 L4.19,1.01 L4.38,1.02 L4.56,1.05 L4.75,1.09 L4.93,1.15 L5.10,1.21 L5.28,1.29 L5.45,1.37 L5.61,1.47 L5.76,1.57 L5.91,1.69 L6.05,1.81 L6.19,1.95 L6.31,2.09 L6.43,2.24 L6.53,2.39 L6.63,2.55 L6.71,2.72 L6.79,2.90 L6.85,3.07 L6.91,3.25 L6.95,3.44 L6.98,3.62 L6.99,3.81 Z"]
    9     RenderSVGContainer {g} at (-0.83,10) size 622.50x275.20 [start marker=mark] [middle marker=mark] [end marker=mark]
     9    RenderSVGContainer {g} at (-2.19,10) size 623.85x275.52 [start marker=mark] [middle marker=mark] [end marker=mark]
    1010      RenderSVGText {text} at (0,20) size 373x18 contains 1 chunk(s)
    1111        RenderSVGInlineText {#text} at (0,-14) size 373x18
     
    1717      RenderPath {circle} at (90.83,84.17) size 85.00x85.00 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M105.00,76.00 L104.95,77.57 L104.80,79.13 L104.56,80.68 L104.21,82.22 L103.78,83.73 L103.24,85.20 L102.62,86.64 L101.91,88.04 L101.11,89.40 L100.23,90.69 L99.26,91.94 L98.22,93.11 L97.11,94.22 L95.94,95.26 L94.69,96.23 L93.40,97.11 L92.04,97.91 L90.64,98.62 L89.20,99.24 L87.73,99.78 L86.22,100.21 L84.68,100.56 L83.13,100.80 L81.57,100.95 L80.00,101.00 L78.43,100.95 L76.87,100.80 L75.32,100.56 L73.78,100.21 L72.27,99.78 L70.80,99.24 L69.36,98.62 L67.96,97.91 L66.60,97.11 L65.31,96.23 L64.06,95.26 L62.89,94.22 L61.78,93.11 L60.74,91.94 L59.77,90.69 L58.89,89.40 L58.09,88.04 L57.38,86.64 L56.76,85.20 L56.22,83.73 L55.79,82.22 L55.44,80.68 L55.20,79.13 L55.05,77.57 L55.00,76.00 L55.05,74.43 L55.20,72.87 L55.44,71.32 L55.79,69.78 L56.22,68.27 L56.76,66.80 L57.38,65.36 L58.09,63.96 L58.89,62.60 L59.77,61.31 L60.74,60.06 L61.78,58.89 L62.89,57.78 L64.06,56.74 L65.31,55.77 L66.60,54.89 L67.96,54.09 L69.36,53.38 L70.80,52.76 L72.27,52.22 L73.78,51.79 L75.32,51.44 L76.87,51.20 L78.43,51.05 L80.00,51.00 L81.57,51.05 L83.13,51.20 L84.68,51.44 L86.22,51.79 L87.73,52.22 L89.20,52.76 L90.64,53.38 L92.04,54.09 L93.40,54.89 L94.69,55.77 L95.94,56.74 L97.11,57.78 L98.22,58.89 L99.26,60.06 L100.23,61.31 L101.11,62.60 L101.91,63.96 L102.62,65.36 L103.24,66.80 L103.78,68.27 L104.21,69.78 L104.56,71.32 L104.80,72.87 L104.95,74.43 Z"]
    1818      RenderPath {ellipse} at (182.50,84.17) size 101.67x85.00 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M170.00,76.00 L169.94,77.57 L169.76,79.13 L169.47,80.68 L169.06,82.22 L168.53,83.73 L167.89,85.20 L167.14,86.64 L166.29,88.04 L165.33,89.40 L164.27,90.69 L163.12,91.94 L161.87,93.11 L160.54,94.22 L159.12,95.26 L157.63,96.23 L156.07,97.11 L154.45,97.91 L152.77,98.62 L151.04,99.24 L149.27,99.78 L147.46,100.21 L145.62,100.56 L143.76,100.80 L141.88,100.95 L140.00,101.00 L138.12,100.95 L136.24,100.80 L134.38,100.56 L132.54,100.21 L130.73,99.78 L128.96,99.24 L127.23,98.62 L125.55,97.91 L123.93,97.11 L122.37,96.23 L120.88,95.26 L119.46,94.22 L118.13,93.11 L116.88,91.94 L115.73,90.69 L114.67,89.40 L113.71,88.04 L112.86,86.64 L112.11,85.20 L111.47,83.73 L110.94,82.22 L110.53,80.68 L110.24,79.13 L110.06,77.57 L110.00,76.00 L110.06,74.43 L110.24,72.87 L110.53,71.32 L110.94,69.78 L111.47,68.27 L112.11,66.80 L112.86,65.36 L113.71,63.96 L114.67,62.60 L115.73,61.31 L116.88,60.06 L118.13,58.89 L119.46,57.78 L120.88,56.74 L122.37,55.77 L123.93,54.89 L125.55,54.09 L127.23,53.38 L128.96,52.76 L130.73,52.22 L132.54,51.79 L134.38,51.44 L136.24,51.20 L138.12,51.05 L140.00,51.00 L141.88,51.05 L143.76,51.20 L145.62,51.44 L147.46,51.79 L149.27,52.22 L151.04,52.76 L152.77,53.38 L154.45,54.09 L156.07,54.89 L157.63,55.77 L159.12,56.74 L160.54,57.78 L161.87,58.89 L163.12,60.06 L164.27,61.31 L165.33,62.60 L166.29,63.96 L167.14,65.36 L167.89,66.80 L168.53,68.27 L169.06,69.78 L169.47,71.32 L169.76,72.87 L169.94,74.43 Z"]
    19       RenderPath {line} at (-0.83,200) size 1.67x83.33 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M0.00,120.00 L0.00,170.00"]
    20       RenderPath {polyline} at (50,199.17) size 84.68x84.54 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M30.00,120.00 L80.00,120.00 L55.00,170.00"]
    21       RenderPath {polygon} at (165.32,199.17) size 86.03x86.03 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M100.00,120.00 L150.00,120.00 L125.00,170.00 Z"]
    22       RenderPath {path} at (282.50,199.17) size 85.52x85.00 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M170.00,120.00 L220.00,120.00 L195.00,170.00 C185.00,170.00,170.00,140.00,170.00,120.00"]
     19      RenderPath {line} at (-2.19,197.81) size 4.37x87.71 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M0.00,120.00 L0.00,170.00"]
     20      RenderPath {polyline} at (47.81,197.81) size 87.71x87.71 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M30.00,120.00 L80.00,120.00 L55.00,170.00"]
     21      RenderPath {polygon} at (164.48,197.81) size 87.71x87.71 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M100.00,120.00 L150.00,120.00 L125.00,170.00 Z"]
     22      RenderPath {path} at (281.15,197.81) size 87.71x87.71 [stroke={[type=SOLID] [color=#000000]}] [start marker=mark] [middle marker=mark] [end marker=mark] [data="M170.00,120.00 L220.00,120.00 L195.00,170.00 C185.00,170.00,170.00,140.00,170.00,120.00"]
  • trunk/WebCore/Android.mk

    r52750 r52866  
    631631        rendering/SVGInlineFlowBox.cpp \
    632632        rendering/SVGInlineTextBox.cpp \
     633        rendering/SVGMarkerLayoutInfo.cpp \
    633634        rendering/SVGRenderSupport.cpp \
    634635        rendering/SVGRenderTreeAsText.cpp \
  • trunk/WebCore/ChangeLog

    r52865 r52866  
     12010-01-06  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        Marker code is buggy: referencePoint translation is off
     6        https://bugs.webkit.org/show_bug.cgi?id=33012
     7
     8        Rewrite marker code, as it had many issues:
     9        - Correct refX/refY handling (covered by new marker-referencePoint.svg test)
     10        - Calculate marker bounds on layout time, instead of paint time, to deliver correct repaint rects
     11        - Cleanup RenderPath code, which was cluttered by marker stuff (outlay in SVGMarkerLayoutInfo)
     12        - Fix SVGResource assuming that there is only one resource per resource type per element. Markers
     13          can have three different resources of the same type (three markers, start/mid/end markers)
     14
     15        Filed bug 33115 (PathElementAddQuadCurveToPoint not handled for <marker>), which was just a TODO in the code before.
     16
     17        Fixes all svg/custom/marker*.svg tests, that use dynamic updates (propagation failed before).
     18        Test: svg/custom/marker-referencePoint.svg
     19              svg/custom/marker-opacity.svg
     20              svg/custom/marker-strokeWidth-changes.svg
     21
     22        * Android.mk: Add SVGMarkerData.h / SVGMarkerLayoutInfo.(cpp,h) to build.
     23        * GNUmakefile.am: Ditto.
     24        * WebCore.gypi: Ditto.
     25        * WebCore.pro: Ditto.
     26        * WebCore.vcproj/WebCore.vcproj: Ditto.
     27        * WebCore.xcodeproj/project.pbxproj: Ditto.
     28        * page/FrameView.cpp: Notify RenderSVGRoot children about viewport size changes, just like it's handled for <body> in HTML.
     29        (WebCore::FrameView::layout): This is important, as marker bounding boxes may depend on the current viewport size through relative coordinates used in <svg>.
     30        * rendering/RenderPath.cpp:
     31        (WebCore::RenderPath::markerBoundingBox): Calculates and caches marker boundaries in the layout() phase.
     32        (WebCore::RenderPath::repaintRectInLocalCoordinates): Use the cached marker bounding box during paint() time.
     33        (WebCore::RenderPath::setPath): Clear marker boundaries upon path changes.
     34        (WebCore::RenderPath::paint): Use SVGMarkerLayoutInfo::drawMarkers() instead of the local drawMarkersIfNeeded() function, which is gone now.
     35        (WebCore::RenderPath::calculateMarkerBoundsIfNeeded): Utilized by markerBoundingBox() to request SVGResourceMarker objects and calculate their boundaries.
     36        * rendering/RenderPath.h: Store SVGMarkerLayoutInfo objects, and rename m_markerBounds to m_cachedLocalMarkerBBox for consistency.
     37        (WebCore::RenderPath::path): Inline this accessor.
     38        * rendering/RenderSVGContainer.h: Make paint() public (to be used from SVGResourceMarker), all other methods protected (to be used from RenderSVGViewportContainer).
     39        * rendering/RenderSVGViewportContainer.cpp: Remove useless paint() override, as the comment in the code indicated.
     40        (WebCore::RenderSVGViewportContainer::markerBoundaries): Maps the marker contents repaintRectInLocalCoordinates() into the final coordinate system (see code).
     41        (WebCore::RenderSVGViewportContainer::markerContentTransformation): Add marker-specific helper method, allowing to make viewportTransform() private again.
     42        * rendering/RenderSVGViewportContainer.h: Marking viewportTransform() private, it's never meant to be used outside this renderer.
     43        * rendering/SVGMarkerData.h: Added. Refactored from existing RenderPath code, preserving original copyrights.
     44        (WebCore::SVGMarkerData::): Helper struct for SVGMarkerLayoutInfo.
     45        (WebCore::SVGMarkerData::origin): Holds the final computed destination of a marker.
     46        (WebCore::SVGMarkerData::marker): Holds a pointer to the associated SVGResourceMarker object, which we're aiming to layout.
     47        (WebCore::SVGMarkerData::currentAngle): Calculates the current angle for a certain marker type (start/mid/end) based upon the computed inslope/outslope values.
     48        (WebCore::SVGMarkerData::updateTypeAndMarker): Helper method.
     49        (WebCore::SVGMarkerData::updateOutslope): Ditto.
     50        (WebCore::SVGMarkerData::updateMarkerDataForPathElement): Does the actual inslope/outslope calculation.
     51        (WebCore::SVGMarkerData::updateInslope): Helper method.
     52        * rendering/SVGMarkerLayoutInfo.cpp: Added. New approach to build marker layout info, this time correct during layout() time instead of paint() time.
     53        (WebCore::SVGMarkerLayoutInfo::SVGMarkerLayoutInfo):
     54        (WebCore::SVGMarkerLayoutInfo::~SVGMarkerLayoutInfo):
     55        (WebCore::processStartAndMidMarkers): Static helper method used to visit each path element in order to calculate inslopes/outslopes (-> orientation angles)
     56        (WebCore::SVGMarkerLayoutInfo::calculateBoundaries): Build list of MarkerLayout objects, used to query boundaries, and to paint markers during drawMarkers().
     57        (WebCore::SVGMarkerLayoutInfo::drawMarkers): Cheap method walking existing MarkerLayout vector, drawing the individual RenderSVGViewportContainer of the markers.
     58        (WebCore::SVGMarkerLayoutInfo::addLayoutedMarker): Helper method.
     59        * rendering/SVGMarkerLayoutInfo.h: Added.
     60        (WebCore::MarkerLayout::MarkerLayout): Helper struct storing a pair of SVGResourceMarker* and a TranformationMatrix.
     61        (WebCore::SVGMarkerLayoutInfo::markerData): Public helper methods returning references to private member variables, used from processStartAndMidMarkers.
     62        (WebCore::SVGMarkerLayoutInfo::midMarker): Ditto.
     63        (WebCore::SVGMarkerLayoutInfo::elementIndex): Ditto.
     64        * svg/SVGMarkerElement.cpp: Adopt to name change: setRef() -> setReferencePoint(). setMarker() -> setRenderer()
     65        (WebCore::SVGMarkerElement::~SVGMarkerElement): Remove obsolete detach() hack, fixed by SVGUseElement changes.
     66        (WebCore::SVGMarkerElement::canvasResource): Add ASSERT(renderer()) to clarify that canvasResource() is only meant to used after renderer creation.
     67        * svg/SVGSVGElement.cpp:
     68        (WebCore::SVGSVGElement::~SVGSVGElement): Remove obsolete detach() hack, fixed by SVGUseElement changes.
     69        * svg/SVGUseElement.cpp: Rework buildPendingResource() to remove SVGSVGElement/SVGMarkerElement detach() hacks (called manually from destructors), see below.
     70        (WebCore::SVGUseElement::buildPendingResource): Always detach() the shadow tree root element, before destructing it - this caused the regression with this patch before.
     71        * svg/graphics/SVGResource.cpp: Instead of maintaining a global hashmap between SVGStyledElements and an array of possible SVGResources, use a HashSet of SVGResources
     72                                        and directly scan the already existing list of clients for a certain SVGResource. This wrong approach has been introduced over two years
     73                                        ago, making the assumption that there's only one resource type per element. Though markers can provide three resources of the same type
     74                                        per element (all SVGResourceMarker objects, but in different rules: start/mid/end marker). That information is only available while painting.
     75        (WebCore::resourceSet): Add global static HashSet<SVGResource*>.
     76        (WebCore::SVGResource::SVGResource): Add us to the resourceSet.
     77        (WebCore::SVGResource::~SVGResource): Remove us from resourceSet.
     78        (WebCore::SVGResource::removeClient): Traverse all SVGResource clients and remove the passed SVGStyledElement from the client list (invoked by SVGStyledElement destructor).
     79        (WebCore::SVGResource::addClient): Remove the offending part of the old approach, making the wrong assumption regarding resource types.
     80        * svg/graphics/SVGResourceMarker.cpp:
     81        (WebCore::SVGResourceMarker::SVGResourceMarker):
     82        (WebCore::SVGResourceMarker::markerTransformation): Create TransformationMatrix in the local marker content (RenderSVGViewportContainer) coordinate system, to position a marker.
     83        (WebCore::SVGResourceMarker::draw): Simplify marker drawing a lot: used the passing TransformationMatrix (cached in SVGMarkerLayoutInfo) to draw the marker content renderer.
     84        (WebCore::SVGResourceMarker::externalRepresentation): Adopt to refX/refY -> referencePoint changes.
     85        * svg/graphics/SVGResourceMarker.h: Store a FloatPoint m_referecePoint instead of two refX/refY float values.
     86        (WebCore::SVGResourceMarker::setRenderer): Renamed from setMarker().
     87        (WebCore::SVGResourceMarker::setReferencePoint): Renamed from setRef().
     88        (WebCore::SVGResourceMarker::referencePoint): New accessor replacing refX() / refY().
     89
    1902010-01-06  Dirk Schulze  <krit@webkit.org>
    291
  • trunk/WebCore/Configurations/Base.xcconfig

    r49969 r52866  
    3535GCC_MODEL_TUNING = G5;
    3636GCC_OBJC_CALL_CXX_CDTORS = YES;
    37 GCC_PRECOMPILE_PREFIX_HEADER = YES;
     37GCC_PRECOMPILE_PREFIX_HEADER = NO;
    3838GCC_THREADSAFE_STATICS = NO;
    3939GCC_TREAT_WARNINGS_AS_ERRORS = YES;
  • trunk/WebCore/GNUmakefile.am

    r52813 r52866  
    29512951        WebCore/rendering/SVGInlineTextBox.cpp \
    29522952        WebCore/rendering/SVGInlineTextBox.h \
     2953        WebCore/rendering/SVGMarkerData.h \
     2954        WebCore/rendering/SVGMarkerLayoutInfo.cpp \
     2955        WebCore/rendering/SVGMarkerLayoutInfo.h \
    29532956        WebCore/rendering/SVGRenderSupport.cpp \
    29542957        WebCore/rendering/SVGRenderSupport.h \
  • trunk/WebCore/WebCore.gypi

    r52811 r52866  
    31383138            'rendering/SVGInlineTextBox.cpp',
    31393139            'rendering/SVGInlineTextBox.h',
     3140            'rendering/SVGMarkerData.h',
     3141            'rendering/SVGMarkerLayoutInfo.cpp',
     3142            'rendering/SVGMarkerLayoutInfo.h',
    31403143            'rendering/SVGRenderSupport.cpp',
    31413144            'rendering/SVGRenderSupport.h',
  • trunk/WebCore/WebCore.pro

    r52792 r52866  
    21442144    rendering/SVGInlineFlowBox.h \
    21452145    rendering/SVGInlineTextBox.h \
     2146    rendering/SVGMarkerData.h \
     2147    rendering/SVGMarkerLayoutInfo.h \
    21462148    rendering/SVGRenderSupport.h \
    21472149    rendering/SVGRenderTreeAsText.h \
     
    31203122        rendering/SVGInlineFlowBox.cpp \
    31213123        rendering/SVGInlineTextBox.cpp \
     3124        rendering/SVGMarkerLayoutInfo.cpp \
    31223125        rendering/SVGRenderSupport.cpp \
    31233126        rendering/SVGRootInlineBox.cpp
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r52770 r52866  
    2782027820                        </File>
    2782127821                        <File
     27822                                RelativePath="..\rendering\SVGMarkerData.h"
     27823                                >
     27824                        </File>
     27825                        <File
     27826                                RelativePath="..\rendering\SVGMarkerLayoutInfo.cpp"
     27827                                >
     27828                        </File>
     27829                        <File
     27830                                RelativePath="..\rendering\SVGMarkerLayoutInfo.h"
     27831                                >
     27832                        </File>
     27833                        <File
    2782227834                                RelativePath="..\rendering\SVGRenderSupport.cpp"
    2782327835                                >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r52750 r52866  
    6363                082341C50FCF3A9500D75BD6 /* WMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 082341C30FCF3A9400D75BD6 /* WMLSelectElement.cpp */; };
    6464                082341C60FCF3A9500D75BD6 /* WMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */; };
     65                08385FF610F0186000BFE07B /* SVGMarkerData.h in Headers */ = {isa = PBXBuildFile; fileRef = 08385FF510F0186000BFE07B /* SVGMarkerData.h */; };
    6566                0839476C0ECE4BD600027350 /* WMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08FB84B00ECE373300DC064E /* WMLElementFactory.cpp */; };
    6667                0839476D0ECE4BD600027350 /* WMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 08FB84B10ECE373300DC064E /* WMLElementFactory.h */; };
     
    8990                087281570F26B9B600AFC596 /* OptionGroupElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087281530F26B9B600AFC596 /* OptionGroupElement.cpp */; };
    9091                087281580F26B9B600AFC596 /* OptionGroupElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 087281540F26B9B600AFC596 /* OptionGroupElement.h */; };
     92                08735FB810E91232006D6FAD /* SVGMarkerLayoutInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08735FB610E91232006D6FAD /* SVGMarkerLayoutInfo.cpp */; };
     93                08735FB910E91232006D6FAD /* SVGMarkerLayoutInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 08735FB710E91232006D6FAD /* SVGMarkerLayoutInfo.h */; };
    9194                08744BAA0EDB7D86004C9E63 /* WMLOnEventElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08744BA90EDB7D86004C9E63 /* WMLOnEventElement.cpp */; };
    9295                08744BAE0EDB7D92004C9E63 /* WMLOnEventElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08744BAD0EDB7D92004C9E63 /* WMLOnEventElement.h */; };
     
    52795282                082341C30FCF3A9400D75BD6 /* WMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLSelectElement.cpp; sourceTree = "<group>"; };
    52805283                082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLSelectElement.h; sourceTree = "<group>"; };
     5284                08385FF510F0186000BFE07B /* SVGMarkerData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMarkerData.h; sourceTree = "<group>"; };
    52815285                083DAEA20F01A7FB00342754 /* RenderTextControlMultiLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextControlMultiLine.cpp; sourceTree = "<group>"; };
    52825286                083DAEA30F01A7FB00342754 /* RenderTextControlMultiLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTextControlMultiLine.h; sourceTree = "<group>"; };
     
    53035307                087281530F26B9B600AFC596 /* OptionGroupElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionGroupElement.cpp; sourceTree = "<group>"; };
    53045308                087281540F26B9B600AFC596 /* OptionGroupElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionGroupElement.h; sourceTree = "<group>"; };
     5309                08735FB610E91232006D6FAD /* SVGMarkerLayoutInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGMarkerLayoutInfo.cpp; sourceTree = "<group>"; };
     5310                08735FB710E91232006D6FAD /* SVGMarkerLayoutInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMarkerLayoutInfo.h; sourceTree = "<group>"; };
    53055311                08744BA90EDB7D86004C9E63 /* WMLOnEventElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLOnEventElement.cpp; sourceTree = "<group>"; };
    53065312                08744BAD0EDB7D92004C9E63 /* WMLOnEventElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLOnEventElement.h; sourceTree = "<group>"; };
     
    1556115567                                AA0972CA0B6947A800A705E9 /* SVGInlineTextBox.cpp */,
    1556215568                                AA0972CB0B6947A800A705E9 /* SVGInlineTextBox.h */,
     15569                                08385FF510F0186000BFE07B /* SVGMarkerData.h */,
     15570                                08735FB610E91232006D6FAD /* SVGMarkerLayoutInfo.cpp */,
     15571                                08735FB710E91232006D6FAD /* SVGMarkerLayoutInfo.h */,
    1556315572                                A8F4FB950C169E85002AFED5 /* SVGRenderSupport.cpp */,
    1556415573                                A8F4FB930C169E7B002AFED5 /* SVGRenderSupport.h */,
     
    1826618275                                BC56CB2410D5AC8000A77C64 /* GeolocationError.h in Headers */,
    1826718276                                BC56CB2510D5AC8000A77C64 /* GeolocationPosition.h in Headers */,
     18277                                08735FB910E91232006D6FAD /* SVGMarkerLayoutInfo.h in Headers */,
     18278                                08385FF610F0186000BFE07B /* SVGMarkerData.h in Headers */,
    1826818279                        );
    1826918280                        runOnlyForDeploymentPostprocessing = 0;
     
    2042220433                                0C45342710CDBBFA00869157 /* JSWebGLUniformLocation.cpp in Sources */,
    2042320434                                BC56CB2110D5AC8000A77C64 /* GeolocationController.cpp in Sources */,
     20435                                08735FB810E91232006D6FAD /* SVGMarkerLayoutInfo.cpp in Sources */,
    2042420436                        );
    2042520437                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/page/FrameView.cpp

    r52759 r52866  
    598598
    599599    if (!subtree) {
    600         RenderObject* rootRenderer = document->documentElement() ? document->documentElement()->renderer() : 0;
     600        Node* documentElement = document->documentElement();
     601        RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0;
    601602        Node* body = document->body();
    602603        if (body && body->renderer()) {
     
    613614                applyOverflowToViewport(o, hMode, vMode);
    614615            }
    615         } else if (rootRenderer)
     616        } else if (rootRenderer) {
     617#if ENABLE(SVG)
     618            if (documentElement->isSVGElement()) {
     619                if (!m_firstLayout && (m_size.width() != layoutWidth() || m_size.height() != layoutHeight()))
     620                    rootRenderer->setChildNeedsLayout(true);
     621            }
     622#endif
    616623            applyOverflowToViewport(rootRenderer, hMode, vMode);
     624        }
    617625#ifdef INSTRUMENT_LAYOUT_SCHEDULING
    618626        if (m_firstLayout && !document->ownerElement())
  • trunk/WebCore/rendering/RenderPath.cpp

    r52750 r52866  
    132132}
    133133
     134FloatRect RenderPath::markerBoundingBox() const
     135{
     136    if (m_path.isEmpty())
     137        return FloatRect();
     138
     139    if (m_cachedLocalMarkerBBox.isEmpty())
     140        calculateMarkerBoundsIfNeeded();
     141
     142    return m_cachedLocalMarkerBBox;
     143}
     144
    134145FloatRect RenderPath::repaintRectInLocalCoordinates() const
    135146{
     
    141152        return m_cachedLocalRepaintRect;
    142153
    143     m_cachedLocalRepaintRect = strokeBoundingBox();
    144 
    145     // Markers and filters can paint outside of the stroke path
    146     m_cachedLocalRepaintRect.unite(m_markerBounds);
    147 
    148154    // FIXME: We need to be careful here. We assume that there is no filter,
    149     // clipper or masker if the rects are empty.
     155    // clipper, marker or masker if the rects are empty.
    150156    FloatRect rect = filterBoundingBoxForRenderer(this);
    151157    if (!rect.isEmpty())
    152158        m_cachedLocalRepaintRect = rect;
     159    else {
     160        m_cachedLocalRepaintRect = strokeBoundingBox();
     161        m_cachedLocalRepaintRect.unite(markerBoundingBox());
     162    }
    153163
    154164    rect = clipperBoundingBoxForRenderer(this);
     
    169179    m_cachedLocalStrokeBBox = FloatRect();
    170180    m_cachedLocalFillBBox = FloatRect();
    171 }
    172 
    173 const Path& RenderPath::path() const
    174 {
    175     return m_path;
     181    m_cachedLocalMarkerBBox = FloatRect();
    176182}
    177183
     
    225231
    226232            if (static_cast<SVGStyledElement*>(node())->supportsMarkers())
    227                 m_markerBounds = drawMarkersIfNeeded(paintInfo, m_path);
     233                m_markerLayoutInfo.drawMarkers(paintInfo);
    228234        }
    229235        finishRenderSVGContent(this, paintInfo, filter, savedInfo.context);
     
    268274}
    269275
    270 enum MarkerType {
    271     Start,
    272     Mid,
    273     End
    274 };
    275 
    276 struct MarkerData {
    277     FloatPoint origin;
    278     FloatPoint subpathStart;
    279     double strokeWidth;
    280     FloatPoint inslopePoints[2];
    281     FloatPoint outslopePoints[2];
    282     MarkerType type;
    283     SVGResourceMarker* marker;
    284 };
    285 
    286 struct DrawMarkersData {
    287     DrawMarkersData(RenderObject::PaintInfo&, SVGResourceMarker* startMarker, SVGResourceMarker* midMarker, double strokeWidth);
    288     RenderObject::PaintInfo& paintInfo;
    289     int elementIndex;
    290     MarkerData previousMarkerData;
    291     SVGResourceMarker* midMarker;
    292 };
    293 
    294 DrawMarkersData::DrawMarkersData(RenderObject::PaintInfo& pi, SVGResourceMarker* start, SVGResourceMarker* mid, double strokeWidth)
    295     : paintInfo(pi)
    296     , elementIndex(0)
    297     , midMarker(mid)
    298 {
    299     previousMarkerData.origin = FloatPoint();
    300     previousMarkerData.subpathStart = FloatPoint();
    301     previousMarkerData.strokeWidth = strokeWidth;
    302     previousMarkerData.marker = start;
    303     previousMarkerData.type = Start;
    304 }
    305 
    306 static void drawMarkerWithData(RenderObject::PaintInfo& paintInfo, MarkerData& data)
    307 {
    308     if (!data.marker)
     276void RenderPath::calculateMarkerBoundsIfNeeded() const
     277{
     278    Document* doc = document();
     279
     280    SVGElement* svgElement = static_cast<SVGElement*>(node());
     281    ASSERT(svgElement && svgElement->document());
     282    if (!svgElement->isStyled())
    309283        return;
    310284
    311     FloatPoint inslopeChange = data.inslopePoints[1] - FloatSize(data.inslopePoints[0].x(), data.inslopePoints[0].y());
    312     FloatPoint outslopeChange = data.outslopePoints[1] - FloatSize(data.outslopePoints[0].x(), data.outslopePoints[0].y());
    313 
    314     double inslope = rad2deg(atan2(inslopeChange.y(), inslopeChange.x()));
    315     double outslope = rad2deg(atan2(outslopeChange.y(), outslopeChange.x()));
    316 
    317     double angle = 0.0;
    318     switch (data.type) {
    319         case Start:
    320             angle = outslope;
    321             break;
    322         case Mid:
    323             angle = (inslope + outslope) / 2;
    324             break;
    325         case End:
    326             angle = inslope;
    327     }
    328 
    329     data.marker->draw(paintInfo, data.origin.x(), data.origin.y(), data.strokeWidth, angle);
    330 }
    331 
    332 static inline void updateMarkerDataForElement(MarkerData& previousMarkerData, const PathElement* element)
    333 {
    334     FloatPoint* points = element->points;
    335    
    336     switch (element->type) {
    337     case PathElementAddQuadCurveToPoint:
    338         // TODO
    339         previousMarkerData.origin = points[1];
    340         break;
    341     case PathElementAddCurveToPoint:
    342         previousMarkerData.inslopePoints[0] = points[1];
    343         previousMarkerData.inslopePoints[1] = points[2];
    344         previousMarkerData.origin = points[2];
    345         break;
    346     case PathElementMoveToPoint:
    347         previousMarkerData.subpathStart = points[0];
    348     case PathElementAddLineToPoint:
    349         previousMarkerData.inslopePoints[0] = previousMarkerData.origin;
    350         previousMarkerData.inslopePoints[1] = points[0];
    351         previousMarkerData.origin = points[0];
    352         break;
    353     case PathElementCloseSubpath:
    354         previousMarkerData.inslopePoints[0] = previousMarkerData.origin;
    355         previousMarkerData.inslopePoints[1] = points[0];
    356         previousMarkerData.origin = previousMarkerData.subpathStart;
    357         previousMarkerData.subpathStart = FloatPoint();
    358     }
    359 }
    360 
    361 static void drawStartAndMidMarkers(void* info, const PathElement* element)
    362 {
    363     DrawMarkersData& data = *reinterpret_cast<DrawMarkersData*>(info);
    364 
    365     int elementIndex = data.elementIndex;
    366     MarkerData& previousMarkerData = data.previousMarkerData;
    367 
    368     FloatPoint* points = element->points;
    369 
    370     // First update the outslope for the previous element
    371     previousMarkerData.outslopePoints[0] = previousMarkerData.origin;
    372     previousMarkerData.outslopePoints[1] = points[0];
    373 
    374     // Draw the marker for the previous element
    375     if (elementIndex != 0)
    376         drawMarkerWithData(data.paintInfo, previousMarkerData);
    377 
    378     // Update our marker data for this element
    379     updateMarkerDataForElement(previousMarkerData, element);
    380 
    381     if (elementIndex == 1) {
    382         // After drawing the start marker, switch to drawing mid markers
    383         previousMarkerData.marker = data.midMarker;
    384         previousMarkerData.type = Mid;
    385     }
    386 
    387     data.elementIndex++;
    388 }
    389 
    390 FloatRect RenderPath::drawMarkersIfNeeded(PaintInfo& paintInfo, const Path& path) const
    391 {
    392     Document* doc = document();
    393 
    394     SVGElement* svgElement = static_cast<SVGElement*>(node());
    395     ASSERT(svgElement && svgElement->document() && svgElement->isStyled());
    396 
    397285    SVGStyledElement* styledElement = static_cast<SVGStyledElement*>(svgElement);
     286    if (!styledElement->supportsMarkers())
     287        return;
     288
    398289    const SVGRenderStyle* svgStyle = style()->svgStyle();
    399 
    400290    AtomicString startMarkerId(svgStyle->startMarker());
    401291    AtomicString midMarkerId(svgStyle->midMarker());
     
    422312
    423313    if (!startMarker && !midMarker && !endMarker)
    424         return FloatRect();
    425 
    426     double strokeWidth = SVGRenderStyle::cssPrimitiveToLength(this, svgStyle->strokeWidth(), 1.0f);
    427     DrawMarkersData data(paintInfo, startMarker, midMarker, strokeWidth);
    428 
    429     path.apply(&data, drawStartAndMidMarkers);
    430 
    431     data.previousMarkerData.marker = endMarker;
    432     data.previousMarkerData.type = End;
    433     drawMarkerWithData(paintInfo, data.previousMarkerData);
    434 
    435     // We know the marker boundaries, only after they're drawn!
    436     // Otherwhise we'd need to do all the marker calculation twice
    437     // once here (through paint()) and once in absoluteClippedOverflowRect().
    438     FloatRect bounds;
    439 
    440     if (startMarker)
    441         bounds.unite(startMarker->cachedBounds());
    442 
    443     if (midMarker)
    444         bounds.unite(midMarker->cachedBounds());
    445 
    446     if (endMarker)
    447         bounds.unite(endMarker->cachedBounds());
    448 
    449     return bounds;
     314        return;
     315
     316    float strokeWidth = SVGRenderStyle::cssPrimitiveToLength(this, svgStyle->strokeWidth(), 1.0f);
     317    m_cachedLocalMarkerBBox = m_markerLayoutInfo.calculateBoundaries(startMarker, midMarker, endMarker, strokeWidth, m_path);
    450318}
    451319
  • trunk/WebCore/rendering/RenderPath.h

    r52750 r52866  
    2626
    2727#if ENABLE(SVG)
    28 
    2928#include "FloatRect.h"
    3029#include "RenderSVGModelObject.h"
     30#include "SVGMarkerLayoutInfo.h"
    3131#include "TransformationMatrix.h"
    3232
     
    4141    RenderPath(SVGStyledTransformableElement*);
    4242
    43     const Path& path() const;
     43    const Path& path() const { return m_path; }
    4444
    4545private:
     
    5050    virtual FloatRect objectBoundingBox() const;
    5151    virtual FloatRect strokeBoundingBox() const;
    52     virtual FloatRect markerBoundingBox() const { return m_markerBounds; }
     52    virtual FloatRect markerBoundingBox() const;
    5353    virtual FloatRect repaintRectInLocalCoordinates() const;
    5454
     
    6666    virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
    6767
    68     FloatRect drawMarkersIfNeeded(PaintInfo&, const Path&) const;
     68    void calculateMarkerBoundsIfNeeded() const;
    6969
    7070private:
     
    7575    mutable FloatRect m_cachedLocalStrokeBBox;
    7676    mutable FloatRect m_cachedLocalRepaintRect;
    77     FloatRect m_markerBounds;
     77    mutable FloatRect m_cachedLocalMarkerBBox;
     78    mutable SVGMarkerLayoutInfo m_markerLayoutInfo;
    7879    TransformationMatrix m_localTransform;
    7980};
     
    9899#endif // ENABLE(SVG)
    99100#endif
    100 
    101 // vim:ts=4:noet
  • trunk/WebCore/rendering/RenderSVGContainer.h

    r52750 r52866  
    4343    bool drawsContents() const;
    4444
    45 protected:
    4645    virtual void paint(PaintInfo&, int parentX, int parentY);
    4746
    48 private:
     47protected:
    4948    virtual RenderObjectChildList* virtualChildren() { return children(); }
    5049    virtual const RenderObjectChildList* virtualChildren() const { return children(); }
     
    7372    bool selfWillPaint() const;
    7473
     74private:
    7575    RenderObjectChildList m_children;
    7676    bool m_drawsContents : 1;
  • trunk/WebCore/rendering/RenderSVGViewportContainer.cpp

    r52750 r52866  
    3939}
    4040
    41 void RenderSVGViewportContainer::paint(PaintInfo& paintInfo, int parentX, int parentY)
     41FloatRect RenderSVGViewportContainer::markerBoundaries(const TransformationMatrix& markerTransformation) const
    4242{
    43     // FIXME: The if statement here evaluates to false. isEmpty() is exactly the same
    44     // as what is on the right side, so it's basically !isEmpty && isEmpty. So this
    45     // function does nothing.
     43    FloatRect coordinates = repaintRectInLocalCoordinates();
    4644
    47     // A value of zero disables rendering of the element.
    48     if (!m_viewport.isEmpty() && (m_viewport.width() <= 0. || m_viewport.height() <= 0.))
    49         return;
     45    // Map repaint rect into parent coordinate space, in which the marker boundaries have to be evaluated
     46    coordinates = localToParentTransform().mapRect(coordinates);
    5047
    51     RenderSVGContainer::paint(paintInfo, parentX, parentY);
     48    return markerTransformation.mapRect(coordinates);
     49}
     50
     51TransformationMatrix RenderSVGViewportContainer::markerContentTransformation(const TransformationMatrix& contentTransformation, const FloatPoint& origin, float strokeWidth) const
     52{
     53    // The 'origin' coordinate maps to SVGs refX/refY, given in coordinates relative to the viewport established by the marker
     54    FloatPoint mappedOrigin = viewportTransform().mapPoint(origin);
     55
     56    TransformationMatrix transformation = contentTransformation;
     57    if (strokeWidth != -1)
     58        transformation.scaleNonUniform(strokeWidth, strokeWidth);
     59
     60    transformation.translate(-mappedOrigin.x(), -mappedOrigin.y());
     61    return transformation;
    5262}
    5363
     
    126136
    127137#endif // ENABLE(SVG)
    128 
    129 // vim:ts=4:noet
  • trunk/WebCore/rendering/RenderSVGViewportContainer.h

    r52750 r52866  
    2525
    2626#if ENABLE(SVG)
    27 
    2827#include "RenderSVGContainer.h"
    2928
     
    3635    RenderSVGViewportContainer(SVGStyledElement*);
    3736
    38     // FIXME: This is only public for SVGResourceMarker::draw, likely the callsite should be changed.
    39     TransformationMatrix viewportTransform() const;
     37    // Calculates marker boundaries, mapped to the target element's coordinate space
     38    FloatRect markerBoundaries(const TransformationMatrix& markerTransformation) const;
    4039
    41     virtual void paint(PaintInfo&, int parentX, int parentY);
     40    // Generates a transformation matrix usable to render marker content. Handles scaling the marker content
     41    // acording to SVGs markerUnits="strokeWidth" concept, when a strokeWidth value != -1 is passed in.
     42    TransformationMatrix markerContentTransformation(const TransformationMatrix& contentTransformation, const FloatPoint& origin, float strokeWidth = -1) const;
    4243
    4344private:
     
    4546    virtual const char* renderName() const { return "RenderSVGViewportContainer"; }
    4647
     48    TransformationMatrix viewportTransform() const;
    4749    virtual TransformationMatrix localToParentTransform() const;
    4850
     
    7173#endif // ENABLE(SVG)
    7274#endif // RenderSVGViewportContainer_h
    73 
    74 // vim:ts=4:noet
  • trunk/WebCore/svg/SVGMarkerElement.cpp

    r52750 r52866  
    5959SVGMarkerElement::~SVGMarkerElement()
    6060{
    61     // Call detach() here because if we wait until ~Node() calls it, we crash during
    62     // RenderSVGViewportContainer destruction, as the renderer assumes that the element
    63     // is still fully constructed. See <https://bugs.webkit.org/show_bug.cgi?id=21293>.
    64     if (renderer())
    65         detach();
    6661}
    6762
     
    176171        m_marker = SVGResourceMarker::create();
    177172
    178     m_marker->setMarker(toRenderSVGViewportContainer(renderer()));
     173    ASSERT(renderer());
     174    m_marker->setRenderer(toRenderSVGViewportContainer(renderer()));
    179175
    180176    if (orientType() == SVG_MARKER_ORIENT_ANGLE)
     
    183179        m_marker->setAutoAngle();
    184180
    185     m_marker->setRef(refX().value(this), refY().value(this));
     181    m_marker->setReferencePoint(FloatPoint(refX().value(this), refY().value(this)));
    186182    m_marker->setUseStrokeWidth(markerUnits() == SVG_MARKERUNITS_STROKEWIDTH);
    187183
  • trunk/WebCore/svg/SVGSVGElement.cpp

    r52373 r52866  
    8686    // see ContainerNode::removeAllChildren, called by its destructor.
    8787    document()->accessSVGExtensions()->removeTimeContainer(this);
    88 
    89     // Call detach() here because if we wait until ~Node() calls it, we crash during
    90     // RenderSVGViewportContainer destruction, as the renderer assumes that the element
    91     // is still fully constructed. See <https://bugs.webkit.org/show_bug.cgi?id=21293>.
    92     if (renderer())
    93         detach();
    9488}
    9589
  • trunk/WebCore/svg/SVGUseElement.cpp

    r51366 r52866  
    347347    ASSERT(m_targetElementInstance->correspondingUseElement() == this);
    348348
     349    // Safe destruction, of the old shadow tree root element
     350    if (m_shadowTreeRootElement) {
     351        m_shadowTreeRootElement->detach();
     352        m_shadowTreeRootElement = 0;
     353    }
     354
    349355    // Setup shadow tree root node
    350356    m_shadowTreeRootElement = new SVGGElement(SVGNames::gTag, document());
  • trunk/WebCore/svg/graphics/SVGResource.cpp

    r52750 r52866  
    3232#include "SVGElement.h"
    3333#include "SVGStyledElement.h"
     34#include <wtf/HashSet.h>
    3435#include <wtf/StdLibExtras.h>
    3536
    3637namespace WebCore {
    3738
     39typedef HashSet<SVGResource*> ResourceSet;
     40
     41static ResourceSet& resourceSet()
     42{
     43    DEFINE_STATIC_LOCAL(ResourceSet, set, ());
     44    return set;
     45}
     46
    3847SVGResource::SVGResource()
    3948{
     49    ASSERT(!resourceSet().contains(this));
     50    resourceSet().add(this);
    4051}
    4152
    42 struct ResourceSet : Noncopyable {
    43     ResourceSet()
    44     {
    45         for (int i = 0; i < _ResourceTypeCount; i++)
    46             resources[i] = 0;
    47     }
    48     SVGResource* resources[_ResourceTypeCount];
    49 };
    50 
    51 typedef HashMap<SVGStyledElement*, ResourceSet*> ResourceClientMap;
    52 
    53 static ResourceClientMap& clientMap()
    54 {
    55     DEFINE_STATIC_LOCAL(ResourceClientMap, map, ());
    56     return map;
    57 }
    5853
    5954SVGResource::~SVGResource()
    6055{
    61     int type = -1;
    62     HashSet<SVGStyledElement*>::iterator itr = m_clients.begin();
    63    
    64     for (; type < 0 && itr != m_clients.end(); ++itr) {
    65         ResourceSet* target = clientMap().get(*itr);
    66         if (!target)
    67             continue;
    68 
    69         for (int i = 0; i < _ResourceTypeCount; i++) {
    70             if (target->resources[i] != this)
    71                 continue;
    72             type = i;
    73             target->resources[i] = 0;
    74             break;
    75         }
    76     }
    77    
    78     if (type < 0)
    79         return;
    80    
    81     for (; itr != m_clients.end(); ++itr) {
    82         ResourceSet* target = clientMap().get(*itr);
    83         if (!target)
    84             continue;
    85        
    86         if (target->resources[type] == this)
    87             target->resources[type] = 0;
    88     }
     56    ASSERT(resourceSet().contains(this));
     57    resourceSet().remove(this);
    8958}
    9059
     
    12190void SVGResource::removeClient(SVGStyledElement* item)
    12291{
    123     ResourceClientMap::iterator resourcePtr = clientMap().find(item);
    124     if (resourcePtr == clientMap().end())
    125         return;
    126    
    127     ResourceSet* set = resourcePtr->second;
    128     ASSERT(set);
    129    
    130     clientMap().remove(resourcePtr);
    131    
    132     for (int i = 0; i < _ResourceTypeCount; i++)
    133         if (set->resources[i])
    134             set->resources[i]->m_clients.remove(item);
    135    
    136     delete set;
     92    ResourceSet::iterator it = resourceSet().begin();
     93    ResourceSet::iterator end = resourceSet().end();
     94
     95    for (; it != end; ++it) {
     96        SVGResource* resource = *it;
     97        if (!resource->m_clients.contains(item))
     98            continue;
     99        resource->m_clients.remove(item);
     100    }
    137101}
    138102
     
    143107
    144108    m_clients.add(item);
    145 
    146     ResourceSet* target = clientMap().get(item);
    147     if (!target)
    148         target = new ResourceSet;
    149 
    150     SVGResourceType type = resourceType();
    151     if (SVGResource* oldResource = target->resources[type])
    152         oldResource->m_clients.remove(item);
    153 
    154     target->resources[type] = this;
    155     clientMap().set(item, target);
    156109}
    157110
  • trunk/WebCore/svg/graphics/SVGResourceMarker.cpp

    r52750 r52866  
    3939SVGResourceMarker::SVGResourceMarker()
    4040    : SVGResource()
    41     , m_refX(0.0)
    42     , m_refY(0.0)
    4341    , m_angle(-1) // just like using setAutoAngle()
    44     , m_marker(0)
     42    , m_renderer(0)
    4543    , m_useStrokeWidth(true)
    4644{
     
    5149}
    5250
    53 void SVGResourceMarker::setMarker(RenderSVGViewportContainer* marker)
     51TransformationMatrix SVGResourceMarker::markerTransformation(const FloatPoint& origin, float angle, float strokeWidth) const
    5452{
    55     m_marker = marker;
     53    ASSERT(m_renderer);
     54
     55    TransformationMatrix transform;
     56    transform.translate(origin.x(), origin.y());
     57    transform.rotate(m_angle == -1 ? angle : m_angle);
     58    transform = m_renderer->markerContentTransformation(transform, m_referencePoint, m_useStrokeWidth ? strokeWidth : -1);
     59    return transform;
    5660}
    5761
    58 void SVGResourceMarker::setRef(double refX, double refY)
     62void SVGResourceMarker::draw(RenderObject::PaintInfo& paintInfo, const TransformationMatrix& transform)
    5963{
    60     m_refX = refX;
    61     m_refY = refY;
    62 }
    63 
    64 void SVGResourceMarker::draw(RenderObject::PaintInfo& paintInfo, double x, double y, double strokeWidth, double angle)
    65 {
    66     if (!m_marker)
     64    if (!m_renderer)
    6765        return;
    6866
     
    7472
    7573    currentlyDrawingMarkers.add(this);
    76 
    77     TransformationMatrix transform;
    78     transform.translate(x, y);
    79     transform.rotate(m_angle > -1 ? m_angle : angle);
    80 
    81     // refX and refY are given in coordinates relative to the viewport established by the marker, yet they affect
    82     // the translation performed on the viewport itself.
    83     TransformationMatrix viewportTransform;
    84     if (m_useStrokeWidth)
    85         viewportTransform.scaleNonUniform(strokeWidth, strokeWidth);
    86     viewportTransform *= m_marker->viewportTransform();
    87     double refX, refY;
    88     viewportTransform.map(m_refX, m_refY, refX, refY);
    89     transform.translate(-refX, -refY);
    90 
    91     if (m_useStrokeWidth)
    92         transform.scaleNonUniform(strokeWidth, strokeWidth);
     74    ASSERT(!m_renderer->drawsContents());
    9375
    9476    paintInfo.context->save();
    9577    paintInfo.context->concatCTM(transform);
    96     m_marker->setDrawsContents(true);
    97     m_marker->paint(paintInfo, 0, 0);
    98     m_marker->setDrawsContents(false);
     78    m_renderer->setDrawsContents(true);
     79    m_renderer->paint(paintInfo, 0, 0);
     80    m_renderer->setDrawsContents(false);
    9981    paintInfo.context->restore();
    10082
    101     m_cachedBounds = transform.mapRect(m_marker->absoluteClippedOverflowRect());
    102 
    10383    currentlyDrawingMarkers.remove(this);
    104 }
    105 
    106 FloatRect SVGResourceMarker::cachedBounds() const
    107 {
    108     return m_cachedBounds;
    10984}
    11085
     
    11994        ts << angle() << "]";
    12095
    121     ts << " [ref x=" << refX() << " y=" << refY() << "]";
     96    ts << " [ref x=" << m_referencePoint.x() << " y=" << m_referencePoint.y() << "]";
    12297    return ts;
    12398}
  • trunk/WebCore/svg/graphics/SVGResourceMarker.h

    r52750 r52866  
    2828
    2929#if ENABLE(SVG)
    30 
     30#include "FloatPoint.h"
    3131#include "FloatRect.h"
    3232#include "RenderObject.h"
     
    3636
    3737    class RenderSVGViewportContainer;
     38    class TransformationMatrix;
    3839
    3940    class SVGResourceMarker : public SVGResource {
     
    4243        virtual ~SVGResourceMarker();
    4344
    44         void setMarker(RenderSVGViewportContainer*);
     45        RenderSVGViewportContainer* renderer() const { return m_renderer; }
     46        void setRenderer(RenderSVGViewportContainer* marker) { m_renderer = marker; }
    4547
    46         void setRef(double refX, double refY);
    47         double refX() const { return m_refX; }
    48         double refY() const { return m_refY; }
     48        void setReferencePoint(const FloatPoint& point) { m_referencePoint = point; }
     49        FloatPoint referencePoint() const { return m_referencePoint; }
    4950
    5051        void setAngle(float angle) { m_angle = angle; }
     
    5556        bool useStrokeWidth() const { return m_useStrokeWidth; }
    5657
    57         FloatRect cachedBounds() const;
    58         void draw(RenderObject::PaintInfo&, double x, double y, double strokeWidth = 1, double angle = 0);
    59        
     58        TransformationMatrix markerTransformation(const FloatPoint& origin, float angle, float strokeWidth) const;
     59        void draw(RenderObject::PaintInfo&, const TransformationMatrix&);
     60
    6061        virtual SVGResourceType resourceType() const { return MarkerResourceType; }
    6162        virtual TextStream& externalRepresentation(TextStream&) const;
     
    6364    private:
    6465        SVGResourceMarker();
    65         double m_refX, m_refY;
    66         FloatRect m_cachedBounds;
     66
     67        FloatPoint m_referencePoint;
    6768        float m_angle;
    68         RenderSVGViewportContainer* m_marker;
     69        RenderSVGViewportContainer* m_renderer;
    6970        bool m_useStrokeWidth;
    7071    };
Note: See TracChangeset for help on using the changeset viewer.