-
Notifications
You must be signed in to change notification settings - Fork 672
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
[css-cascade] When an import rule fails to load or has an unsatisfied condition, does the layer still count? #6776
Comments
The way I understand the spec, we should already have implied answers to all of these, which we can clarify if we need to:
|
The precise interleaving of layers and conditions in the import rule isn't specified, so we should be clearer about this, but I agree with @mirisuzanne on the details of how each case should work. The mental model should be that a layer is wrapped around the contents of the import (even if they're empty due to a load failure), and a condition is wrapped around the whole thing: @import url(...) layer(foo) (condition: bar);
/* equivalent to */
@media (condition: bar) {
@layer foo {
...import contents...
}
} |
As per w3c/csswg-drafts#6776: 1. @import with unmatched media query shouldn't establish layer 2. @import that fails to load should still establish layer This patch adds test cases for it and also fixes our behavior on 1. Bug: 1095765 Change-Id: Ia7d2c9921b4b93173546cbd78ab243dac3f92420
As per w3c/csswg-drafts#6776: 1. @import with unmatched media query shouldn't establish layer 2. @import that fails to load should still establish layer This patch adds test cases for it and also fixes our behavior on 1. Bug: 1095765 Change-Id: Ia7d2c9921b4b93173546cbd78ab243dac3f92420 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272669 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940505}
As per w3c/csswg-drafts#6776: 1. @import with unmatched media query shouldn't establish layer 2. @import that fails to load should still establish layer This patch adds test cases for it and also fixes our behavior on 1. Bug: 1095765 Change-Id: Ia7d2c9921b4b93173546cbd78ab243dac3f92420 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272669 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940505}
As per w3c/csswg-drafts#6776: 1. @import with unmatched media query shouldn't establish layer 2. @import that fails to load should still establish layer This patch adds test cases for it and also fixes our behavior on 1. Bug: 1095765 Change-Id: Ia7d2c9921b4b93173546cbd78ab243dac3f92420 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272669 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940505}
…vior on failed/unmatched imports, a=testonly Automatic update from web-platform-tests [@layer] Ensure layer establishment behavior on failed/unmatched imports As per w3c/csswg-drafts#6776: 1. @import with unmatched media query shouldn't establish layer 2. @import that fails to load should still establish layer This patch adds test cases for it and also fixes our behavior on 1. Bug: 1095765 Change-Id: Ia7d2c9921b4b93173546cbd78ab243dac3f92420 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272669 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940505} -- wpt-commits: c21a4bab57696f57f98fe063fd976e88e6556de4 wpt-pr: 31586
Agenda+ to get this spec change approved by the group. |
…vior on failed/unmatched imports, a=testonly Automatic update from web-platform-tests [@layer] Ensure layer establishment behavior on failed/unmatched imports As per w3c/csswg-drafts#6776: 1. @import with unmatched media query shouldn't establish layer 2. @import that fails to load should still establish layer This patch adds test cases for it and also fixes our behavior on 1. Bug: 1095765 Change-Id: Ia7d2c9921b4b93173546cbd78ab243dac3f92420 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272669 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940505} -- wpt-commits: c21a4bab57696f57f98fe063fd976e88e6556de4 wpt-pr: 31586
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: [css-cascade] When an import rule fails to load or has an unsatisfied condition, does the layer still count?<fantasai> github: https://github.com//issues/6776 <fantasai> miriam: A few questions in here <fantasai> miriam: All related to establishing layers inside of an @import statement. <fantasai> miriam: One question is what to do if the import fails <fantasai> miriam: other question is what to do if the conditions of the import don't match <fantasai> miriam: consensus in the thread was that we should conceptualize this to "layer is wrapped around contents of the import, even if empty due to failure, and condition is wrapped around the whole thing" <fantasai> miriam: We added language to spec to express it that way <fantasai> miriam: layer is still added to layer order if import fails <fantasai> miriam: but not added if the conditions don't match <fantasai> miriam: that matches the behavior of if you had import inside of layer inside of condition <fantasai> miriam: wanted to check with WG if this is acceptable <fantasai> jensimmons: Makes a lot of sense from authoring point of view <fantasai> +1 from me <fantasai> RESOLVED: Accept proposal <fantasai> miriam: This allows us to republish <fantasai> RESOLVED: Republish css-cascade-5 |
As per w3c/csswg-drafts#6776: 1. @import with unmatched media query shouldn't establish layer 2. @import that fails to load should still establish layer This patch adds test cases for it and also fixes our behavior on 1. Bug: 1095765 Change-Id: Ia7d2c9921b4b93173546cbd78ab243dac3f92420 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272669 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940505}
As per w3c/csswg-drafts#6776: 1. @import with unmatched media query shouldn't establish layer 2. @import that fails to load should still establish layer This patch adds test cases for it and also fixes our behavior on 1. Bug: 1095765 Change-Id: Ia7d2c9921b4b93173546cbd78ab243dac3f92420 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272669 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940505} NOKEYCHECK=True GitOrigin-RevId: e1a0f46a6fa0c0b07677d1afa048d0d9021a083f
Consider
@import
rules below:While these are valid but ineffective imports, do the layer declarations still count (and hence affect the global layer ordering)? The current spec seems unclear about it.
I suppose for conditional imports whose conditions evaluate to false, the layer declarations should not count, because nested
@layer
rules inside false media/supports rules do not count.I'm unsure about imports that fail to load, though. We may count the layer for a stable global layer ordering, or do not counter the layer to be consistent with media/supports conditions. Either as a resolution will be fine for me.
The text was updated successfully, but these errors were encountered: