Problem/Motivation

Two new deprecation skips added in Symfony 7.4:

Since symfony/browser-kit 7.4: Method "Symfony\Component\BrowserKit\AbstractBrowser::useHtml5Parser()" is deprecated. Symfony 8 will unconditionally use the native HTML5 parser.
Since symfony/dom-crawler 7.4: Disabling HTML5 parsing is deprecated. Symfony 8 will unconditionally use the native HTML5 parser.

This triggered some test failures the first time round, including uncovering possible bugs in Symfony:

https://github.com/symfony/symfony/issues/62233
https://github.com/symfony/symfony/issues/62236

Steps to reproduce

Proposed resolution

Upgrade to at least Symfony 7.4.0-BETA2 or RC1.
Enable the HTML5 parser.
Fix any tests cases that fail - note that the HTML5 parser is only enabled on PHP 8.4 and above.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3555527

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave’s picture

longwave’s picture

Status: Active » Needs work
longwave’s picture

Issue summary: View changes
longwave’s picture

Status: Needs work » Needs review

I thought we had some fails in the original 7.4 upgrade MR but the upstream fixes must have resolved them, everything seems fine here.

andypost’s picture

longwave’s picture

Thanks for the heads-up, opened #3557639: Update to Symfony 7.4.0-RC1

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

No test failures so seems like a good cleanup.

longwave’s picture

Rebased.

catch’s picture

What happened to the original test failure that https://github.com/symfony/symfony/issues/62236 was opened to fix - looks like neither of the symfony issues landed.

longwave’s picture

It no longer crashes:

> new \Symfony\Component\DomCrawler\Crawler('<script&>')->html();
= "<head></head><body></body>"

It's possible the test (and similar ones with malformed HTML) are not really testing the same thing any more? But I am not sure DomCrawler is ever going to operate exactly like a real browser would...

  • catch committed b5c30c32 on 11.3.x
    fix: #3555527 Since symfony/dom-crawler 7.4: Disabling HTML5 parsing is...

  • catch committed c9472457 on 11.x
    fix: #3555527 Since symfony/dom-crawler 7.4: Disabling HTML5 parsing is...
catch’s picture

Status: Reviewed & tested by the community » Fixed

OK fair enough, we have to do this anyway, and figuring out why we couldn't with previous rcs of symfony is not really the priority.

Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.