w3c / fxtf-drafts

Mirror of https://hg.fxtf.org/drafts
https://drafts.fxtf.org/
Other
69 stars 49 forks source link

[css-masking-1] Fetch doesn't define "potentially CORS-enabled fetch" #358

Open foolip opened 5 years ago

foolip commented 5 years ago

https://drafts.fxtf.org/css-masking/#priv-sec says:

User agents must use the potentially CORS-enabled fetch method defined by the [FETCH] specification for all <mask-source>, <clip-source> and <image> values on the mask-image, mask-border-source and clip-path properties. When fetching, user agents must use “Anonymous” mode, set the referrer source to the stylesheet’s URL and set the origin to the URL of the containing document. If this results in network errors, the effect is as if the value none had been specified.

However, Fetch doesn't define "potentially CORS-enabled fetch" and mentions it only in https://fetch.spec.whatwg.org/#goals as having once been in HTML.

Perhaps @annevk can suggest what to say instead.

foolip commented 5 years ago

The original definition can be found in https://github.com/whatwg/html/pull/144, or at https://web.archive.org/web/20150906031258/https://html.spec.whatwg.org/#potentially-cors-enabled-fetch

svgeesus commented 5 years ago

This affects several other CSS specs as well. @annevk What term should be linked to, nowadays, to express this concept?

annevk commented 5 years ago

You probably want to do something similar to https://html.spec.whatwg.org/#create-a-potential-cors-request. In particular, you want to invoke https://fetch.spec.whatwg.org/#concept-fetch with a https://fetch.spec.whatwg.org/#concept-request with the appropriate bits set.

svgeesus commented 5 years ago

Thanks, @annevk !

svgeesus commented 3 years ago

Related issue https://github.com/w3c/csswg-drafts/issues/6076 (on Fonts, but the same issue)

noamr commented 2 years ago

See https://github.com/w3c/csswg-drafts/pull/6715

The "Potentially CORS request" algorithm is specifically to deal with crossorigin attributes etc. In this PR I do something similar for CSS resources (which don't have those HTML attributes).

It's not yet integrated with masking.