-
Notifications
You must be signed in to change notification settings - Fork 25
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
Specification text for replace() does not match Chromium implementation #123
Comments
Please note that we look likely to remove support for @import from style sheets loaded via replace(), in order to be consistent with all the other ways of creating such style sheets, and therefore improve API interop between them. See #119 . Are there use cases where you think it would be unreasonable to work around the removal of @import? |
@chrishtr Thanks for the clarification. I had started work on this feature prior to the decision about #119. As it says in #119, "this [restriction] might relax in future." I wouldn't expect Chromium to fully undo its existing implementation details. It will probably just restrict the behavior as early as possible in the method call. This way it's still ready to go if/when the restriction relaxes. Even if the current plan is to disallow @import rules for now, I think it would still be worthwhile to gain clarity on this functionality that already exists (yet differs from the current spec). |
@chrishtr I stand corrected. I had assumed that since the decision from #119 said:
that the underlying implementation would be kept around, and that the call to It appears that the plan is, indeed, is to deprecate |
@mfreed7 Thanks for the update. In that case, I do think that this issue is still relevant. |
I just wanted to add support to this issue. It would seem to be most-useful to ignore Note that only "part 1" of the suggestion is relevant here, I think:
Part 2, I think, is moot, given 119 and I2D:
|
cc @tabatkins @rakina @mfreed7 Quoting myself from here, after the recent TPAC breakout session I think it would be useful to move forward in this manner with an
And then eventually:
Shipping and standardizing an |
I agree with just about everything in your post - I think this is the right way forward. Let's limit the use of The only real question I (still) have is whether throwing exceptions (and stopping parsing) is the more "future proof" way to go here. I know we went the opposite direction for Constructable Stylesheets, and I fully support making that behavior the same as the CSS Modules behavior. But I'm wondering if we shouldn't revisit that, since CSS Modules are likely to get significant usage. I just want to make sure we're leaving ourselves open to later allow
Of these, #2 seems less likely to get baked in somewhere. If exceptions get thrown, I'd expect developers to fix/remove the offending |
I'm finally getting to this with #137 and #138. One change from the plan I discussed here is that for now I think CSS modules should still reference the steps from @mfreed7 I am sympathetic to the concerns that ignoring |
Description
I am currently implementing the
replace()
functionality for Constructable StyleSheets in Firefox. I noticed that the specification steps forreplace()
do not match what is implemented in Chromium.To be clear, I think that what is implemented in Chromium is more desirable than what is described in the spec, and I think that the spec should be updated to reflect this.
Differences
The sheet keeps the new rules, even if an @import rule fails:
Spec
Actual
Other @import rules are loaded, even if one of them fails.
Spec
Actual
Proposed Resolution
I think that the spec text should be modified to convey the following:
This is also consistent with how loading @import rules works in contexts other than Constructable StyleSheets.
The text was updated successfully, but these errors were encountered: