Skip to content

Napi will render disallowed content of <clipPath> #1150

@noahbald

Description

@noahbald

The clipPath element should not render content that is not part of it's content-model.

For example, the following SVG will incorrectly use <g><rect ... /></g> despite it not being in it's content model.

<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128">
  <defs>
    <clipPath id="a">
      <g>
        <rect width="64" height="128"/>
      </g>
    </clipPath>
  </defs>
  <g clip-path="url(#a)">
    <rect width="128" height="64"/>
  </g>
</svg>

This image will render a red square.

current

However, the image should be blank.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions