Skip to content
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

[RFC] DOM HTML5 parsing and serialization support #12111

Merged
merged 53 commits into from Nov 13, 2023

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Sep 2, 2023

@lexborisov
Copy link

@nielsdos

Is there anything I can do to help you?
For example, I could put Lexbor HTML parser (code exclusively for html parsing) in a separate repository.

@nielsdos
Copy link
Member Author

@nielsdos

Is there anything I can do to help you? For example, I could put Lexbor HTML parser (code exclusively for html parsing) in a separate repository.

Hi Alexander

I don't think a separate repository is necessary. To sync upstream changes into PHP I just copy the relevant folders. So it doesn't really matter if it's in a separate repository or not. Then I apply some patches on top.
The only more "complex" change is that I patch out calls to the CSS library. That's because we don't need it and we'd like to save a bit on the binary size. I think however that's difficult to change on Lexbor's side because the dependency there makes sense.

@lexborisov
Copy link

@nielsdos

Yes, CSS makes a huge difference to a project.
I think this can be used as a positive thing. There are CSS selectors in there - it's very handy for searching for elements in the HTML tree.

Nice! Feel free to ask any related questions.

@nielsdos
Copy link
Member Author

@nielsdos

Yes, CSS makes a huge difference to a project. I think this can be used as a positive thing. There are CSS selectors in there - it's very handy for searching for elements in the HTML tree.

I agree. Having CSS Selectors is something on my roadmap, but can only land after this has been accepted.

Nice! Feel free to ask any related questions.

Thanks for the offer :)

@nielsdos nielsdos force-pushed the dom-bridge-lexbor branch 4 times, most recently from 23229eb to 73ca97f Compare October 5, 2023 21:04
@nielsdos nielsdos force-pushed the dom-bridge-lexbor branch 3 times, most recently from 219f8bf to e43f2af Compare October 8, 2023 17:35
@nielsdos
Copy link
Member Author

@theseer No problem. Feel free to take a look later when you have more time.

@nielsdos nielsdos merged commit 1492be5 into php:master Nov 13, 2023
8 of 9 checks passed
@fxzxmicah
Copy link

After 9 years, this finally arrived.

nicolas-grekas added a commit to symfony/symfony that referenced this pull request Jan 29, 2024
…#47715 (mpdude)

This PR was merged into the 6.4 branch.

Discussion
----------

[Form] Use self-closing `<input />` syntax again, reverting #47715

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #53649
| License       | MIT

This PR reverts #47715 and puts the trailing slash back into `<input .../>` markup in the form themes.

The reasons are outlined in detail in #53649. Basically, the trailing slash in void elements like `<input>` is not required in HTML 5, yet it is perfectly valid and compliant with specs.

Writing markup that way is required to parse and process it with an XML parser, like `libxml2` underlying all of the PHP DOM, XML etc. extensions.

HTML 5 capable parser support has been added to PHP in php/php-src#12111 and will be available with PHP 8.4. So, we might want to remove the trailing slashes once Symfony requires at least PHP 8.4.

Commits
-------

8c92200 Revert #47715
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.

None yet

6 participants