Skip to content

[VarDumper] Reduce stylesheet assignments via JavaScript in HtmlDumper #49977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2023

Conversation

ohader
Copy link
Contributor

@ohader ohader commented Apr 8, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? no
Deprecations? no
Tickets none
License MIT

The dynamic <style> element in the JavaScript variable refStyle can be replaced by static CSS and element states.
The new rule .sf-dump-hover:hover substitutes JavaScript event handling for mouseover events.

This is a preparation to have the possibility to assign nonce HTML attributes to inline <script> and <style> nodes, e.g. shown as proof-of-concept at
https://review.typo3.org/c/Packages/TYPO3.CMS/+/78512/2/typo3/sysext/adminpanel/Classes/Utility/HtmlDumper.php

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@ohader ohader force-pushed the var-dumper/js-cleanup branch from c1aa788 to beb090e Compare May 14, 2023 14:01
@nicolas-grekas nicolas-grekas force-pushed the var-dumper/js-cleanup branch from beb090e to 53046a3 Compare May 16, 2023 12:15
@nicolas-grekas
Copy link
Member

Thank you @ohader.

@nicolas-grekas nicolas-grekas merged commit 825fd03 into symfony:6.3 May 16, 2023
@ohader ohader deleted the var-dumper/js-cleanup branch May 16, 2023 14:11
reviewtypo3org pushed a commit to TYPO3/typo3 that referenced this pull request Jun 26, 2023
The admin panel uses Symfony's `HtmlDumper` to output data - which is
adding inline JavaScript and StyleSheet elements. To be compatible with
CSP those elements need to be allowed with a nonce attribute.

This change relies on a merged pull request for Symfony v6.3:
symfony/symfony#49977

Executed commands:
composer req symfony/var-dumper:^6.3
composer req symfony/var-dumper:^6.3 \
  -d typo3/sysext/adminpanel --no-update

Resolves: #100456
Releases: main, 12.4
Change-Id: I7fcea196107959db85257c7d735f85a9e78839d2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78512
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: core-ci <typo3@b13.com>
TYPO3IncTeam pushed a commit to TYPO3-CMS/adminpanel that referenced this pull request Jun 26, 2023
The admin panel uses Symfony's `HtmlDumper` to output data - which is
adding inline JavaScript and StyleSheet elements. To be compatible with
CSP those elements need to be allowed with a nonce attribute.

This change relies on a merged pull request for Symfony v6.3:
symfony/symfony#49977

Executed commands:
composer req symfony/var-dumper:^6.3
composer req symfony/var-dumper:^6.3 \
  -d typo3/sysext/adminpanel --no-update

Resolves: #100456
Releases: main, 12.4
Change-Id: I7fcea196107959db85257c7d735f85a9e78839d2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78512
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: core-ci <typo3@b13.com>
TYPO3IncTeam pushed a commit to TYPO3-CMS/frontend that referenced this pull request Jun 26, 2023
The admin panel uses Symfony's `HtmlDumper` to output data - which is
adding inline JavaScript and StyleSheet elements. To be compatible with
CSP those elements need to be allowed with a nonce attribute.

This change relies on a merged pull request for Symfony v6.3:
symfony/symfony#49977

Executed commands:
composer req symfony/var-dumper:^6.3
composer req symfony/var-dumper:^6.3 \
  -d typo3/sysext/adminpanel --no-update

Resolves: #100456
Releases: main, 12.4
Change-Id: I7fcea196107959db85257c7d735f85a9e78839d2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78512
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: core-ci <typo3@b13.com>
reviewtypo3org pushed a commit to TYPO3/typo3 that referenced this pull request Jun 26, 2023
The admin panel uses Symfony's `HtmlDumper` to output data - which is
adding inline JavaScript and StyleSheet elements. To be compatible with
CSP those elements need to be allowed with a nonce attribute.

This change relies on a merged pull request for Symfony v6.3:
symfony/symfony#49977

Executed commands:
composer req symfony/var-dumper:^6.3
composer req symfony/var-dumper:^6.3 \
  -d typo3/sysext/adminpanel --no-update

Resolves: #100456
Releases: main, 12.4
Change-Id: I7fcea196107959db85257c7d735f85a9e78839d2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79204
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
TYPO3IncTeam pushed a commit to TYPO3-CMS/adminpanel that referenced this pull request Jun 26, 2023
The admin panel uses Symfony's `HtmlDumper` to output data - which is
adding inline JavaScript and StyleSheet elements. To be compatible with
CSP those elements need to be allowed with a nonce attribute.

This change relies on a merged pull request for Symfony v6.3:
symfony/symfony#49977

Executed commands:
composer req symfony/var-dumper:^6.3
composer req symfony/var-dumper:^6.3 \
  -d typo3/sysext/adminpanel --no-update

Resolves: #100456
Releases: main, 12.4
Change-Id: I7fcea196107959db85257c7d735f85a9e78839d2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79204
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
TYPO3IncTeam pushed a commit to TYPO3-CMS/frontend that referenced this pull request Jun 26, 2023
The admin panel uses Symfony's `HtmlDumper` to output data - which is
adding inline JavaScript and StyleSheet elements. To be compatible with
CSP those elements need to be allowed with a nonce attribute.

This change relies on a merged pull request for Symfony v6.3:
symfony/symfony#49977

Executed commands:
composer req symfony/var-dumper:^6.3
composer req symfony/var-dumper:^6.3 \
  -d typo3/sysext/adminpanel --no-update

Resolves: #100456
Releases: main, 12.4
Change-Id: I7fcea196107959db85257c7d735f85a9e78839d2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79204
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants