Skip to content

Update 6.1 CSS filter to match core#44962

Merged
ramonjd merged 1 commit into
trunkfrom
update/6-1-safecss-filter-to-match-core
Oct 14, 2022
Merged

Update 6.1 CSS filter to match core#44962
ramonjd merged 1 commit into
trunkfrom
update/6-1-safecss-filter-to-match-core

Conversation

@andrewserong

@andrewserong andrewserong commented Oct 14, 2022

Copy link
Copy Markdown
Contributor

What?

Follow up to #43004 to backport a backport of the CSS filter from 6.1. This copies over the logic from https://github.com/WordPress/wordpress-develop/blob/2b4d385298504d412e9f0dea2e7019d53463c705/src/wp-includes/kses.php#L2504-L2512 in core, to make sure that Gutenberg + WP 6.0 has the same support for CSS functions as 6.1.

Why?

The previous version of this code wasn't current with core, and had edge cases that weren't allowed, as discussed in #43070 (comment).

How?

Copy + paste the lines from https://github.com/WordPress/wordpress-develop/blob/2b4d385298504d412e9f0dea2e7019d53463c705/src/wp-includes/kses.php#L2504-L2512 in core.

Testing Instructions

  • Ensure that style engine tests still pass, e.g.
    'background:var(--wp--preset--color--primary, 10px);font-size:clamp(36.00rem, calc(32.00rem + 10.00vw), 40.00rem);width:min(150vw, 100px);min-width:max(150vw, 100px);max-width:minmax(400px, 50%);padding:calc(80px * -1);background-image:url("https://wordpress.org");--wp--style--unstable-gallery-gap:12em;border-width:2000.75em;',
  • Smoke test that layout styles on the site frontend are still working as expected
  • Check that the copy+pasted lines are copy+pasted correctly 😀

@ramonjd ramonjd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested as part of #44961 😄 and following the tests in #43004

All unit tests pass

Thank you!!!

@ramonjd ramonjd merged commit 35f04fa into trunk Oct 14, 2022
@ramonjd ramonjd deleted the update/6-1-safecss-filter-to-match-core branch October 14, 2022 06:56
@github-actions github-actions Bot added this to the Gutenberg 14.4 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Style Engine /packages/style-engine [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants