minkphp / MinkBrowserKitDriver

Symfony2 BrowserKit driver for Mink framework
MIT License
550 stars 80 forks source link

Improve compatibility with crawler in HTML5 mode #145

Closed stof closed 4 years ago

stof commented 4 years ago

As of 4.3, symfony/dom-crawler will automatically pick masterminds/html5 as the parser when it is installed and the HTML uses the HTML5 doctype. This provides better support for HTML5, but requires using the saveHTML() method of the library rather than of the DOMDocument to avoid weird edge cases. Given that the Crawler methods dealing with HTML are already taking care of that, they are now used by the driver rather than using the DOMDocument API. The implementation of outerHTML still ships a fallback as the Crawler has the method only in 4.4+.