WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
258272
Limit maximum CSS rule nesting level
https://bugs.webkit.org/show_bug.cgi?id=258272
Summary
Limit maximum CSS rule nesting level
Antti Koivisto
Reported
2023-06-19 02:19:12 PDT
Avoid blowing up stack with bad content.
Attachments
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2023-06-19 02:19:44 PDT
rdar://110312738
Antti Koivisto
Comment 2
2023-06-19 02:23:20 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/15088
EWS
Comment 3
2023-06-19 13:20:29 PDT
Committed
265309@main
(c9ac90f8cbfa): <
https://commits.webkit.org/265309@main
> Reviewed commits have been landed. Closing PR #15088 and removing active labels.
Brandon McConnell
Comment 4
2023-06-27 08:15:57 PDT
This feels a little dangerous, though… maybe? I could see a situation where someone imports CSS that nests under a selector, and the imported CSS nesting level + the local CSS nesting level exceed 128 lines This gets much harder if a lib nests a lib that nests a lib, and so on… As a package maintainer, this is a significant reason to go on either… * not nesting my CSS at all if I can help it * using/building a preprocessor to un-nest my nested CSS before package distribution
Brandon McConnell
Comment 5
2023-06-27 08:22:06 PDT
One consideration that might work around this issue is if the limit only exists per CSS file, but if you can contextually import a CSS file at any layer and have that imported CSS actually **be** nested in the place you import it, and if your CSS file gets the 128 limit, but then so does the imported file, resulting in a great total limit. If the true goal of this change is to avoid bad, deeply nested content, this should still achieve the same goal of avoiding any insane level of nesting in a CSS file, while allowing the flexibility of importing CSS without any unexpected interaction of the file limits. So imported CSS files would get their own fresh reset 128 limit, even if they are nested at the deepest 128th level of another file.
Matthieu Dubet
Comment 6
2023-06-28 09:04:07 PDT
Brandon: I'm not sure I understand the danger ? @import is only valid at the top of a stylesheet, never under any kind of nesting.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug