Re: [csswg-drafts] [css-cascade] Specify how `@import` cycles work (#9171)

> Problem 2
> This CSS sets the body to green in Chrome but red in Firefox. Following the "furthest-down" algorithm gives the order red.css + green.css + b.css + a.css + c.css + entry.css which results in a green body. But it's not clear which browser is "correct" without a specification.

This is green for me in all browsers.
It is only Firefox when running with puppeteer or marionette that has an issue.

I filed a bug report for that failure here : https://bugzilla.mozilla.org/show_bug.cgi?id=1844683

<img width="796" alt="Screenshot 2023-08-08 at 12 19 35" src="https://github.com/w3c/csswg-drafts/assets/11521496/02f9f72c-a2bb-4f67-87d4-3067fde49066">

------

To [prevent infinite loops/expansion](https://github.com/postcss/postcss-import/pull/535) I looked at the WebKit source code and found that they create a chain of ancestor stylesheets.

https://github.com/WebKit/WebKit/blob/main/Source/WebCore/css/StyleRuleImport.cpp#L123-L131

-------

I agree that this seems underspecified.
I also couldn't find any detailed description.

But I do think there is interop between browser implementations.

-- 
GitHub Notification of comment by romainmenke
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9171#issuecomment-1669347445 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 8 August 2023 10:25:38 UTC