Page MenuHomePhabricator

css-sanitizerComponent
ActivePublic

Members

  • This project does not have any members.
  • View All

Watchers (3)

Details

Description

MediaWiki library which implements a CSS tokenizer, parser and grammar matcher in PHP that mostly follows the CSS Syntax Module Level 3 candidate recommendation dated 20 February 2014, the CSS Values and Units Module Level 3, and the CSS Selectors Level 3 grammar.
It also provides a sanitizer that recognizes various CSS3 modules.

Homepage

Code repository: rCSSS

Recent Activity

Sat, Sep 7

Izno updated the task description for T374292: css sanitizer getSizingAdditions() use by multicol sanitizer allows invalid CSS.
Sat, Sep 7, 12:06 AM · css-sanitizer
Izno created T374292: css sanitizer getSizingAdditions() use by multicol sanitizer allows invalid CSS.
Sat, Sep 7, 12:05 AM · css-sanitizer

Fri, Sep 6

Ebrahim added a comment to T271958: Support "width: fit-content" in TemplateStyles/Sanitized CSS.

@Ioaxxere I can also take over some time later if you like to though I might the same chance as you but I think developing the patch can be a fun by itself also.

Fri, Sep 6, 6:23 PM · css-sanitizer, TemplateStyles
Aklapper added a comment to T271958: Support "width: fit-content" in TemplateStyles/Sanitized CSS.

https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines :)

Fri, Sep 6, 10:41 AM · css-sanitizer, TemplateStyles
Ebrahim added a comment to T271958: Support "width: fit-content" in TemplateStyles/Sanitized CSS.

@Ioaxxere I'm not maintainer there and my patches struggle to get merged so you can ignore my feedback but I want to say for the ease of finding reviewer on the patch please add Bug: T216897 in the below of your commit message there, add a test and add appropriate links, https://gerrit.wikimedia.org/r/c/css-sanitizer/+/1070601 may help as an example. https://www.w3.org/TR/2021/WD-css-sizing-4-20210520/#sizing-values can be a better link to add to README, inline comment and the changelog and since you are adding fit-content, I think you should also add stretch and contain in addition to fit-content, at least completing one section of a specification if not all of it.

Fri, Sep 6, 10:24 AM · css-sanitizer, TemplateStyles

Aug 17 2024

gerritbot added a comment to T322482: TemplateStyles does not allow logical CSS properties.

Change #1050724 merged by jenkins-bot:

[css-sanitizer@master] Add CSS Logical 1 Properties support

https://gerrit.wikimedia.org/r/1050724

Aug 17 2024, 11:01 AM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles

Aug 9 2024

Izno added a comment to T372091: Embedded CSS bypasses edit checks but doesn't work the way editors expect to it.

but you can't put a media query in a rule block.

Your assertion (or I suppose the 2021 blog article's assertion) regarding where an @-rule may be placed is dated, I suspect, if that's how you read root. CSS nesting allows it. W3C and MDN. (And also caniuse I guess.)

Aug 9 2024, 6:54 PM · TemplateStyles, css-sanitizer
Tgr closed T372091: Embedded CSS bypasses edit checks but doesn't work the way editors expect to it as Invalid.

@Jdlrobson I think you might be testing it incorrectly. Browser support for dark mode can be pretty confusing, there are various settings called dark mode which don't actually set dark mode as defined by the CSS spec. (E.g. on Ubuntu at least, Chrome will always use the OS setting for dark mode, even though it has a "dark mode" flag in the settings menu and another one in the theming sidebar, those change the color scheme of the browser itself but don't actually trigger dark mode in the web content.) I don't think css-sanitizer does anything incorrectly here.

Aug 9 2024, 11:54 AM · TemplateStyles, css-sanitizer
Tgr added a comment to T372091: Embedded CSS bypasses edit checks but doesn't work the way editors expect to it.

Works for me: https://codepen.io/tisza_gergo/pen/yLdowrE

Aug 9 2024, 11:50 AM · TemplateStyles, css-sanitizer

Aug 8 2024

Izno attached a referenced file: F57183189: image.png.
Aug 8 2024, 9:52 PM · TemplateStyles, css-sanitizer
Izno attached a referenced file: F57183190: image.png.
Aug 8 2024, 9:52 PM · TemplateStyles, css-sanitizer
Izno added a comment to T372091: Embedded CSS bypasses edit checks but doesn't work the way editors expect to it.

I would guess you have some other override. This works for me in live preview:

Aug 8 2024, 9:49 PM · TemplateStyles, css-sanitizer
Izno added a comment to T372091: Embedded CSS bypasses edit checks but doesn't work the way editors expect to it.

Accepting :root as a valid pre-text (like body and html are today) might be a good idea that would possibly correct this? It probably wouldn't take much effort to extend how that's done. I'm not sure if

Aug 8 2024, 8:52 PM · TemplateStyles, css-sanitizer
Izno added a project to T372091: Embedded CSS bypasses edit checks but doesn't work the way editors expect to it: TemplateStyles.

CSS Tricks blog article indicates that media queries like this work only from the root? But yes, a quick Google indicates that the CSS is valid (and I have wished it worked, so I guess I'm glad I know it does now). As such, I think it would be incorrect to change CSS sanitizer to reject this CSS.

Aug 8 2024, 8:44 PM · TemplateStyles, css-sanitizer
Jdlrobson created T372091: Embedded CSS bypasses edit checks but doesn't work the way editors expect to it.
Aug 8 2024, 7:01 PM · TemplateStyles, css-sanitizer

Aug 5 2024

Izno added a comment to T354228: Formalize expectation for CSS sanitizer of level of W3C support.

I also noticed it, it's displayed on MDN prominently, though I think it may have showed up on a Discord server I frequent first. From what I can see, the source data is web-platform-dx/web-features/tree/main/features. I don't understand how they get from the YAML files there to the .dist files. For example, <search> is currently "newly available" at MDN, which I suppose matches the search.yml.dist baseline: "low", but search.yml does not have an assertion that I can see indicating its baseline, and search.yml.dist indicates you're supposed to edit the source file, which I can only assume means search.yml. (I feel like the Baseline endeavor is somewhat hacking around the aforementioned failure of W3C to progress their documents on the standards track, but that's just a complaint with things outside this forum's interest.)

Aug 5 2024, 9:27 PM · Documentation, TemplateStyles, css-sanitizer
Izno renamed T371809: "Invalid or unsupported value" for custom CSS "counter()" in Bengali from "Invalid or unsupported value" for custom CSS "counter" in Bengali to "Invalid or unsupported value" for custom CSS "counter()" in Bengali.
Aug 5 2024, 8:57 PM · css-sanitizer, TemplateStyles
Tgr added a comment to T354228: Formalize expectation for CSS sanitizer of level of W3C support.

There's apparently a newish W3C project called Baseline that intends to define which web features are well-supported by browsers. (They don't really explain how to access the data, but it's displayed very prominently on caniuse.com.)

Aug 5 2024, 6:02 PM · Documentation, TemplateStyles, css-sanitizer
Aklapper renamed T371809: "Invalid or unsupported value" for custom CSS "counter()" in Bengali from Facing problem with custom counter in css like counter(count, Bengali) to "Invalid or unsupported value" for custom CSS "counter" in Bengali.
Aug 5 2024, 4:52 PM · css-sanitizer, TemplateStyles
Maintenance_bot removed a project from T283210: Support :dir() for better RTL language support in template styles: Patch-For-Review.
Aug 5 2024, 4:30 PM · css-sanitizer, I18n, RTL, TemplateStyles
Izno changed the subtype of T371809: "Invalid or unsupported value" for custom CSS "counter()" in Bengali from "Bug Report" to "Feature Request".
Aug 5 2024, 4:26 PM · css-sanitizer, TemplateStyles
Izno moved T371809: "Invalid or unsupported value" for custom CSS "counter()" in Bengali from Unsorted to W3C Working Draft (or earlier) on the css-sanitizer board.
Aug 5 2024, 4:25 PM · css-sanitizer, TemplateStyles
Izno moved T371809: "Invalid or unsupported value" for custom CSS "counter()" in Bengali from Backlog to External (css-sanitizer) on the TemplateStyles board.
Aug 5 2024, 4:25 PM · css-sanitizer, TemplateStyles
gerritbot added a comment to T283210: Support :dir() for better RTL language support in template styles.

Change #1050742 merged by jenkins-bot:

[css-sanitizer@master] Add support for :dir() pseudo-class

https://gerrit.wikimedia.org/r/1050742

Aug 5 2024, 3:50 PM · css-sanitizer, I18n, RTL, TemplateStyles
gerritbot added a comment to T322482: TemplateStyles does not allow logical CSS properties.

Change #1050707 merged by jenkins-bot:

[css-sanitizer@master] Add support for logical values in float and clear properties

https://gerrit.wikimedia.org/r/1050707

Aug 5 2024, 3:47 PM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles

Jul 26 2024

PerfektesChaos added a comment to T364685: CSS sanitizer refuses TemplateStyles variable assignment to border-color but does permit background-color.

border: 1px solid var( --border-color-base, #a2a9b1 ); also works as advised in T368637#9942128.

Jul 26 2024, 9:20 AM · TemplateStyles, css-sanitizer

Jul 25 2024

stjn added a comment to T364685: CSS sanitizer refuses TemplateStyles variable assignment to border-color but does permit background-color.

I don't get why the security issue of variable concatenation made it impossible to also set border-color: var(--border-color-base) without any additional concatenation. This, to me, seems like an easy thing to allow right now without having the perfect to be an enemy of the good.

Jul 25 2024, 8:58 PM · TemplateStyles, css-sanitizer

Jul 4 2024

Izno added a project to T368637: Allow use of CSS `var()` for CSS `border` in css-sanitizer: TemplateStyles.
Jul 4 2024, 7:12 PM · TemplateStyles, css-sanitizer
Izno added a comment to T354228: Formalize expectation for CSS sanitizer of level of W3C support.

IIRC Anomie looked at the combination of W3C level and actual browser support and made the decision on a case-by-case basis.

Jul 4 2024, 7:03 PM · Documentation, TemplateStyles, css-sanitizer
Ioaxxere added a comment to T271958: Support "width: fit-content" in TemplateStyles/Sanitized CSS.

I think this could resolve this - https://gerrit.wikimedia.org/r/c/css-sanitizer/+/1052146

Jul 4 2024, 6:23 PM · css-sanitizer, TemplateStyles
Ioaxxere updated subscribers of T271958: Support "width: fit-content" in TemplateStyles/Sanitized CSS.

@Ebrahim Could you look into this?

Jul 4 2024, 5:31 PM · css-sanitizer, TemplateStyles
Jack_who_built_the_house added a comment to T364685: CSS sanitizer refuses TemplateStyles variable assignment to border-color but does permit background-color.

border: 1px solid var( --border-color-base, #a2a9b1 ); also works as advised in T368637#9942128.

Jul 4 2024, 4:51 AM · TemplateStyles, css-sanitizer

Jul 2 2024

Ebrahim added a comment to T368637: Allow use of CSS `var()` for CSS `border` in css-sanitizer.

That works also, I didn't know, but border-color: var(--border-subtle-color, #c8ccd1); doesn't.

Jul 2 2024, 7:48 AM · TemplateStyles, css-sanitizer

Jul 1 2024

Jdlrobson added a comment to T368637: Allow use of CSS `var()` for CSS `border` in css-sanitizer.

Only colors are supported right now, so border: solid 2px var(--border-subtle-color, #c8ccd1); should also work!

Jul 1 2024, 8:13 PM · TemplateStyles, css-sanitizer

Jun 29 2024

Ebrahim added a comment to T368637: Allow use of CSS `var()` for CSS `border` in css-sanitizer.

I think specifying border-top-color, border-right-color, border-bottom-color and border-left-color, while looks ugly, should work.

Jun 29 2024, 10:18 PM · TemplateStyles, css-sanitizer
Tacsipacsi added a comment to T368637: Allow use of CSS `var()` for CSS `border` in css-sanitizer.

I think specifying border-top-color, border-right-color, border-bottom-color and border-left-color, while looks ugly, should work.

Jun 29 2024, 10:05 PM · TemplateStyles, css-sanitizer
Ebrahim added a project to T322482: TemplateStyles does not allow logical CSS properties: RTL.
Jun 29 2024, 8:53 PM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles
gerritbot added a comment to T322482: TemplateStyles does not allow logical CSS properties.

Change #1050707 had a related patch set uploaded (by Ebrahim; author: Ebrahim):

[css-sanitizer@master] Add support for logical values in float property

https://gerrit.wikimedia.org/r/1050707

Jun 29 2024, 8:24 PM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles
Ebrahim claimed T322482: TemplateStyles does not allow logical CSS properties.
Jun 29 2024, 8:16 PM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles
Ebrahim claimed T283210: Support :dir() for better RTL language support in template styles.
Jun 29 2024, 8:15 PM · css-sanitizer, I18n, RTL, TemplateStyles
gerritbot added a project to T283210: Support :dir() for better RTL language support in template styles: Patch-For-Review.
Jun 29 2024, 7:45 PM · css-sanitizer, I18n, RTL, TemplateStyles
gerritbot added a comment to T283210: Support :dir() for better RTL language support in template styles.

Change #1050742 had a related patch set uploaded (by Ebrahim; author: Ebrahim):

[css-sanitizer@master] Add support for :dir() pseudo-class

https://gerrit.wikimedia.org/r/1050742

Jun 29 2024, 7:45 PM · css-sanitizer, I18n, RTL, TemplateStyles
Ebrahim updated the task description for T283210: Support :dir() for better RTL language support in template styles.
Jun 29 2024, 7:40 PM · css-sanitizer, I18n, RTL, TemplateStyles
Ebrahim added a comment to T322482: TemplateStyles does not allow logical CSS properties.
Jun 29 2024, 6:46 PM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles
gerritbot added a project to T322482: TemplateStyles does not allow logical CSS properties: Patch-For-Review.
Jun 29 2024, 6:28 PM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles
gerritbot added a comment to T322482: TemplateStyles does not allow logical CSS properties.

Change #1050707 had a related patch set uploaded (by Ebrahim; author: Ebrahim):

[css-sanitizer@master] Add support for logical values in float property

https://gerrit.wikimedia.org/r/1050707

Jun 29 2024, 6:28 PM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles
gerritbot added a comment to T322482: TemplateStyles does not allow logical CSS properties.

Change #1050724 had a related patch set uploaded (by Ebrahim; author: Ebrahim):

[css-sanitizer@master] Add support for sizing properties of CSS Logical

https://gerrit.wikimedia.org/r/1050724

Jun 29 2024, 6:28 PM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles
Izno merged T368818: Allow use of CSS Logical Properties in TemplateStyles into T322482: TemplateStyles does not allow logical CSS properties.
Jun 29 2024, 5:38 PM · RTL, Patch-For-Review, I18n, css-sanitizer, Vertical-Writing, TemplateStyles
Izno merged task T368818: Allow use of CSS Logical Properties in TemplateStyles into T322482: TemplateStyles does not allow logical CSS properties.
Jun 29 2024, 5:37 PM · css-sanitizer, Patch-For-Review, TemplateStyles
Izno moved T368818: Allow use of CSS Logical Properties in TemplateStyles from Unsorted to W3C Working Draft (or earlier) on the css-sanitizer board.
Jun 29 2024, 5:35 PM · css-sanitizer, Patch-For-Review, TemplateStyles