Description
Description
Support for native HTML5 parser is being added to DomCrawler.
Lately, a lot of great additions are being added to the new DOM extension, especially query selectors : https://wiki.php.net/rfc/dom_additions_84 (it's the first section of the RFC).
DomCrawler could definitely benefit from this. At this time, the component is using CssSelector (the dependency is in the require-dev
section currently). It would be nice to leverage this new native feature also when available !
I think it is not a good idea to bring support right now in the WIP PR, it is already kind of huge and complex, and we should do this step by step. For the record, the patch was merged in the engine upstream already: php/php-src#13819.
I'm creating this issue so we don't forget about it 😄 Indeed related to #53666
Example
The Crawler API wouldn't change, but internals of Crawler::matches
, Crawler::closest()
and alike would leverage the new native API.