Skip to content

Enhancement: mat-icon set current page absolute path on filter urls for compatibility with safari #9276

@MikaAK

Description

@MikaAK

Feature request:

mat-icon is super useful for using svg's inline in the browser. However what's the solution when you need to filter. Since <base href='/'> is in use for history you must append svg filters with the current url.
Example:

<svg viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <mask id="b" fill="#fff">
      <use xlink:href="#a"/>
    </mask>
  </defs>
  <path d='SOMEAMOUNTOFPOINTS' mask='url(http://example.com/my-page#b)'
</svg>

This works because url is set to absolute path. Anything else and the svg works in chrome but not in safari! This used to be an issue in chrome a few years ago but it seems chrome got smarter, however safari has not 😢

What are the steps to reproduce?

I tried to reproduce on plunker but since there's no baseUrl being set and it doesn't seem possible to set I cannot reproduce.

What is the use-case or motivation for changing an existing behavior?

Safari Compatibility

Other Info

As a workaround you can skip setting baseUrl in the index document and set it with

import {APP_BASE_HREF} from '@angular/common'

providers: [{provide: APP_BASE_HREF, useValue: '/'}]

Metadata

Metadata

Labels

P4A relatively minor issue that is not relevant to core functionsfeatureThis issue represents a new feature or feature request rather than a bug or bug fixneeds: discussionFurther discussion with the team is needed before proceeding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions