Skip to content

Support context-stroke and context-fill SVG painting values #2667

@YakBizzarro

Description

@YakBizzarro

When a SVG marker is used, and the marker uses the "context-stroke" to inherit the stroke color, instead other properties like dash-array are taken instead. Only the color should be taken (as per spec, and other renderer like Firefox).

Minimal example:

<svg viewBox="0 0 100 20" xmlns="http://www.w3.org/2000/svg">
  <marker
    id="circle"
    markerWidth="6"
    markerHeight="6"
    refX="3"
    refY="3"
    markerUnits="strokeWidth">
    <circle cx="3" cy="3" r="2" stroke="context-stroke" fill="context-fill" />
  </marker>
  <path d="M 10,10 h 50"  style="marker: url(#circle);stroke:#ff0000;stroke-dasharray:6,6;stroke-dashoffset:0" />
</svg> 

in Firefox, that results in the marker color take the the line definition

Image

in Weasyprint on the contrary the color stay the sane, while it inherit the dash style:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature that should be supported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions