Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not take effect on <a> tag with [href] attribute #5

Closed
gwerghh opened this issue Jun 29, 2021 · 4 comments
Closed

Does not take effect on <a> tag with [href] attribute #5

gwerghh opened this issue Jun 29, 2021 · 4 comments
Assignees
Labels
bug Something isn't working external Browser bugs or implementation issues

Comments

@gwerghh
Copy link

gwerghh commented Jun 29, 2021

Environment: chrome 91.0.4472.114

But it is possible on the tag without the [href] attribute

image

@wopian
Copy link
Owner

wopian commented Jun 29, 2021

I'll do some digging around - there's nothing in the paint worklet that should be stopping it from working on anchor elements that I know of.

May also be a Houdini Paint API implementation issue in Blink, as regular mask-image with url(path/to/image.svg) works without issue on anchor elements.

@wopian wopian added the bug Something isn't working label Jun 29, 2021
@wopian
Copy link
Owner

wopian commented Jun 29, 2021

I've just gone and tried doing the same thing on a bunch of other Houdini Paint API worklets other people have made. They all have the same issue with the mask not being rendered correctly with either a mask on the anchor element, or an anchor element as a parent to the masked element when the [href] attribute is defined.

Will open a bug report on Chromium's bug tracker shortly.

@wopian
Copy link
Owner

wopian commented Jun 30, 2021

Issue opened on the Chromium bug tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=1225443

@wopian wopian added the external Browser bugs or implementation issues label Jun 30, 2021
@wopian
Copy link
Owner

wopian commented Jul 1, 2021

Unfortunately, this is intentional on Chromium's end to avoid leaking the :visited state. You can work around this issue by applying the mask to the parent element of the anchor element instead. E.g <div class='mask'><a href='//wopian.local'>Link</a></div> as shown on https://s7mpl.csb.app/

I will add a notice regarding this limitation to the README.

https://developer.mozilla.org/en-US/docs/Web/API/PaintWorklet#privacy_concerns
w3c/css-houdini-drafts#791

@wopian wopian closed this as completed in 3091ae3 Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Browser bugs or implementation issues
Projects
None yet
Development

No branches or pull requests

2 participants