Repository navigation
fix(client): include stylesheets imported after CSS comments - #457
Conversation
Signed-off-by: Afloat <ShuffleMonkey@163.com>
ftfgithub
left a comment
There was a problem hiding this comment.
Thanks for fixing the missed stylesheet imports. There is one regression to address before merging: whitespace() is shared by @import and url(, but comment-like text inside an unquoted URL is part of that URL.
For background-image:url(/*comment*/image.png), Chromium retains /*comment*/image.png, while this PR discovers image.png. The delivery capture now succeeds and packages image.png without changing the CSS, so the delivered page still requests a different path. Previously this unsupported path was rejected.
Please skip comments only when parsing the value after @import; keep whitespace-only handling after url(. Add coverage for literal comment-like URL paths and the capture behavior so this fix cannot silently produce an incomplete delivery.
Limit comment skipping to the value after @import so unquoted url() paths retain their literal content during delivery discovery. Signed-off-by: Afloat <ShuffleMonkey@163.com>
|
Fixed in The capture regressions deliberately create the files that the incorrect stripped paths would select. On the previous head, capture silently succeeds for both an image URL and an imported stylesheet URL; after the fix, both reject the unsupported literal path and leave the CSS unchanged. The original quoted-import/comment regression remains green. The final focused file gives 3 failed / 9 passed on |
ftfgithub
left a comment
There was a problem hiding this comment.
Thanks for the update! The import-comment handling now preserves literal URL paths as well. This resolves the earlier blocking issue.
Problem and behavior
A valid
@importfollowed by a comment and a quoted filename is skipped by dependency discovery. Portable website deliveries then omit the imported stylesheet and its assets.Comment skipping is now limited to the value after
@import. The shared helper consumes whitespace only, so literal comment-like content insideurl(...)remains part of the URL. For example,url(/*comment*/image.png)is preserved as/*comment*/image.png; delivery capture rejects this unsupported literal path instead of silently packagingimage.pngwhile leaving the original CSS unchanged.Review follow-up
Commit
4ef8c8dde92c081a6a47540c0fc049e3e5f6fe01addresses the requested parser correction. The regressions cover leading, repeated, unterminated, quoted and mid-path comment-like URL text, as well as a URL-valued import. Two real capture cases deliberately provide the stripped-name image or stylesheet that the incorrect parser would select. Both now reject the unsupported literal path and preserve the CSS. The original quoted-import regression continues to pass.Validation
6497ce84: 3 failed, 9 passed. On the current fix: 12 passed.node tools/check-public-source.cjs,node tools/check-third-party.cjs,node tools/check-docs.cjs, repository-layout checks andpython3 tools/security/scan_secrets.py --downloadwith pinned Gitleaks 8.30.1.git diff --checkpass.npm testwas attempted in the isolated checkout but did not complete or pass. Runtime/build dependencies includingelectron,app-builder-lib,js-yamlandssh2were absent; the run was stopped after repeated missing-dependency failures. No complete client-suite pass is claimed.