--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDiG%3DTmbkfL0u%3Du6smGPhzt2n%2B9RtadQ04ouLw54cWoLsA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAARdPYft2NjUnWLQxwt3Rb8QTz5j5cgSf9MxuRLTKCm4dny3nw%40mail.gmail.com.
What's the current usage of the feature? Is it implemented in other browsers? Are they also dropping it?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6cb07226-6e0c-a794-dc3c-39444419fa27%40igalia.com.
On 2/26/20 10:36 AM, Manuel Rego Casasnovas wrote:
>
> On 25/02/2020 23:53, Mason Freed wrote:
>> The original spec for constructable stylesheets allowed for calls to
>> sheet.replace("@import('some.css');"). This use case is being removed -
>> calls to replace() will throw an exception if @import rules are found in
>> the replaced content.
>
> It seems error handling was not discussed/agreed on the CSSWG
> resolution. Dunno if this was agreed somewhere else, but otherwise I
> guess it'd be nice to have a proposal and agree there with other parties.
I think the main reason on why we didn't have consensus on error
handling is because we didn't know off-hand how CSS imports were
handling it. They just rely on replaceSync turns out.
I think the "throw/reject if there are any import rules" is a bit
inconsistent with how the rest of stylesheet parsing works everywhere
else. This is a problem that replaceSync() also has, fwiw.
* Syntactically valid @import rules just disappear from a stylesheet.
* Other kind of invalid @import rules (like, failed or blocked loads)
just have an empty CSSStyleSheet.
It's slightly weird that constructable stylesheets introduce this third
failure mode where if you have an @import your whole stylesheet is
invalid... But anyhow not really opposed to it, just odd, and causes our
implementation to have a somewhat ugly special-case just for this.
Per testing https://software.hixie.ch/utilities/js/live-dom-viewer/saved/7780 in Firefox and Safari, they don't have CSSStyleSheet.prototype.replace at all. Per the same test, it looks like it was shipped in Chrome 73 (intent).Thanks Mason for adding the extra use counter. If you'd like to, I think it'd make sense to land that counter now, and the removal right after the next branch point (week of March 12). That would give enough time to have some numbers in time to revert the removal if necessary.There's a certain cost to delaying too, so if you think @import in replace() calls is likely a very small proportion of total replace() calls, then adding the exception and counter in the same release and comparing relative usage in the beta channel would also work.
--On Wed, Feb 26, 2020 at 10:37 AM Manuel Rego Casasnovas <re...@igalia.com> wrote:
On 25/02/2020 23:53, Mason Freed wrote:
> The original spec for constructable stylesheets allowed for calls to
> sheet.replace("@import('some.css');"). This use case is being removed -
> calls to replace() will throw an exception if @import rules are found in
> the replaced content.
It seems error handling was not discussed/agreed on the CSSWG
resolution. Dunno if this was agreed somewhere else, but otherwise I
guess it'd be nice to have a proposal and agree there with other parties.
Bye,
Rego
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6cb07226-6e0c-a794-dc3c-39444419fa27%40igalia.com.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAARdPYc4FPjpUXiWeYudFBy%3DSQSivwib3Uwaki8FAoYjFDqpSw%40mail.gmail.com.
On Wed, Feb 26, 2020 at 2:00 AM Philip Jägenstedt <foo...@chromium.org> wrote:Per testing https://software.hixie.ch/utilities/js/live-dom-viewer/saved/7780 in Firefox and Safari, they don't have CSSStyleSheet.prototype.replace at all. Per the same test, it looks like it was shipped in Chrome 73 (intent).Thanks Mason for adding the extra use counter. If you'd like to, I think it'd make sense to land that counter now, and the removal right after the next branch point (week of March 12). That would give enough time to have some numbers in time to revert the removal if necessary.There's a certain cost to delaying too, so if you think @import in replace() calls is likely a very small proportion of total replace() calls, then adding the exception and counter in the same release and comparing relative usage in the beta channel would also work.Thanks - I landed the counter and the deprecation message a few days ago. Pending resolution of the "throw or don't throw" question below, I can also land the removal as soon as Canary 83 branches. That's a good suggestion, thanks.> I was just pointing out that this failure mode is unheard of, as far as I can tell, and that saying "@import rules don't parse for Constructable StyleSheets / CSS Modules" is a much more natural way to handle it (in my opinion). You can still detect whether support is present by looking at cssRules.length, or calling functions that throw on invalid rulesyntax like insertRule.I think I generally agree with you that throwing on @import is a bit odd, as compared to the other ways to load stylesheets. The only problem I see is that from a developer's point of view, it doesn't give much guidance that your @import didn't load, or why. It feels a bit too "silent". Especially in the case that you were previously using this functionality, and then M83 rolls around and it just stops working. I suppose we could add a console warning to make that easier to see?We do need a resolution on what to do when replace() is called with @import rules.
On Wed, Feb 26, 2020 at 10:37 AM Manuel Rego Casasnovas <re...@igalia.com> wrote:
On 25/02/2020 23:53, Mason Freed wrote:
> The original spec for constructable stylesheets allowed for calls to
> sheet.replace("@import('some.css');"). This use case is being removed -
> calls to replace() will throw an exception if @import rules are found in
> the replaced content.
It seems error handling was not discussed/agreed on the CSSWG
resolution. Dunno if this was agreed somewhere else, but otherwise I
guess it'd be nice to have a proposal and agree there with other parties.
Bye,
Rego
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6cb07226-6e0c-a794-dc3c-39444419fa27%40igalia.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/e405b269-7e3d-4c94-a988-c99261277074%40chromium.org.
LGTM3
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEgV4b6ieeDtKi8wOJ%3D_FvkTfBBGHPEyrcNtJ6bT%2BFm0uw%40mail.gmail.com.
So as I previously mentioned, the CSSWG resolved that "@import doesn't parse in constructable stylesheets and as a result throw syntax errors". As this sentence isn't completely clear, and neither is the full transcript of the discussion leading up to the resolution, we have a comment requesting clarification. But as I mentioned below, my working assumption is:
- calling replace() with text that includes @import will silently ignore the @import. No exception or warning. This, in particular, is a larger change than the original I2R indicated.
- calling replaceSync() with text that includes @import will silently ignore the @import. No exception or warning.
Why no warning? How are developers supposed to know that their @imports are not working.
So as I previously mentioned, the CSSWG resolved that "@import doesn't parse in constructable stylesheets and as a result throw syntax errors". As this sentence isn't completely clear, and neither is the full transcript of the discussion leading up to the resolution, we have a comment requesting clarification. But as I mentioned below, my working assumption is:
- calling insertRule() with an @import rule will throw a SyntaxError.
Prior to these changes, the behavior of Chromium was:
- calling insertRule() with an @import rule would throw a SyntaxError for constructed stylesheets only. No exception would be thrown for document.styleSheets.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACuPfeQ6DZ8JhREjiOZdYp1Yp%2Bk65UT5Vnod2HVG5ZYad%3Dy-uQ%40mail.gmail.com.
This system also is able to load stylesheets via url, this is to load themes. themes have dependencies to other sheets and therefor use @import.Now that I can fetch and replace into a contructed stylesheet anymore.
What is the 'new' recommended way to add a stylesheet of which I only have an url into the `adoptedstyleheets` property of my shadowDOM?