Comments: One of the successes of the HTML 5 Recommendation standards is to provide a detailed specification to illustrate how to parse HTML documents. For a long time, browser providers have tried to guess and copy the implementations of other browsers, hoping that their parser will not produce too many problems when processing HTML documents. Although some parts of HTML 5 are currently highly controversial, the parsing part is recognized by browser vendors. Once the browser starts to implement it, users can benefit from the increased compatibility.
One of the initial implementations of HTML 5 parsing rules was developed to support the HTML 5 validator. (If you want to test this validator, The http://ejohn.org should be legal HTML 5 .) This implementation is developed in Java and provides interfaces of SAX and DOM, and is open-source.
Interestingly, Henri Sivonen (author of the validator) recently developed a brand new HTML 5 parsing engine for Gecko, which will be used in the next version of Firefox.
This implementation is actually completed by automatically converting the Java Implementation of Henri's HTML 5 parser to C ++. This conversion is automatically completed, and all changes will be submitted to the Mozilla code base.
In general, I will jump out when it comes to this large-scale procedural method of converting the Java code library to C ++. However, the results were surprising: The page loading performance increased by 3%.
These are based on a series of bug fixes and consistency checks provided by the code library. You can view the patch progress in the Mozilla bug library.
If you want to try a new Parser (You are unlikely to find many significant changes, but any effort to find Bugs is appreciated .), Download a daily Firefox build version, open about: config, and set html5.enable to true.
If you want to upgrade to HTML 5, now is the time. Because HTML 5 is a superset of functions provided by HTML 4 and XHTML 1, it is very easy to upgrade. You only need to replace the current (X) HTML document type declaration with the HTML 5 document type.
<! DOCTYPE html> you can find details on how to make the new HTML 5 elements work on all browsers from the HTML 5 Doctor website.