summaryrefslogtreecommitdiff
path: root/src/HTML5
AgeCommit message (Collapse)Author
2022-12-11Add more 'ReturnTypeWillChange' in 'StringInputStream'.wn_
https://github.com/phpstan/phpstan/issues/7415
2022-07-31add annotations for PHP8.1Andrew Dolgov
2021-06-05Fix PHP 8.1 deprecationsAlexander M. Turek
2020-08-24fix: character entity parsingKieran Brahney
2020-07-05cs fixAsmir Mustafic
2020-07-03mitigate cyclic reference between output rules and the traverser objectsAsmir Mustafic
2020-06-24Add special case for end tag </br>. Fixes #185Rowan Tommins
Normally, an end tag for a void element would simply be discarded, but the spec includes a special rule as follows: > An end tag whose tag name is "br" > Parse error. Drop the attributes from the token, and act as > described in the next entry; i.e. act as if this was a "br" > start tag token with no attributes, rather than the end tag > token that it actually is.
2020-02-06prevent infinite loop on unterminated entity declaration at end of streamAsmir Mustafic
2019-06-15Merge pull request #168 from idimopoulos/html5_encodingAsmir Mustafic
Set default encoding in the DOMDocument object
2019-06-14Set default encoding in case it does not exist.Ilias Dimopoulos
2019-03-10drop hhvm supportAsmir Mustafic
2018-12-29Allow to pass a charset to the ScannerTitouan Galopin
2018-11-27Optimize the processing of text between nodesChristophe Coevoet
Instead of processing the text token one by one in the main loop, it is now processed in batch until the next special token (< and & which have special handling in the main loop and NUL characters which need to report a parse error).
2018-11-27Merge pull request #161 from stof/optimize_main_loopAsmir Mustafic
Optimize main loop
2018-11-26Optimize the main loopChristophe Coevoet
2018-11-26Merge pull request #155 from stof/optimize_attributesAsmir Mustafic
Optimize the parsing of unquoted attributes
2018-11-26Merge pull request #154 from stof/optimize_token_comparisonAsmir Mustafic
Optimize the token comparison
2018-11-26Remove useless condition for the parsing of cdataChristophe Coevoet
The caller already ensures that the current token is the right one.
2018-11-26Simplify the doctype matchingChristophe Coevoet
- the doctype() function is only called for a D or d token, so there is no need to check again inside the method - checking that we have the DOCTYPE string can use a sequence matching
2018-11-26Optimize the handling of the EOF detection in the main loopChristophe Coevoet
The eof() method is a no-op when the token is not false. As the main loop already needs to identify that case anyway, skipping the method call allows to reduce the cost of parsing text tokens.
2018-11-26Optimize the parsing of unquoted attributesChristophe Coevoet
2018-11-26Optimize the token comparisonChristophe Coevoet
Tokens are always a single char. Using strspn to find whether they belong to a fixed list is slower than comparing them directly.
2018-11-26Replace next calls with consume calls when the return value is ignoredChristophe Coevoet
2018-11-25Normalize PHPDoc commentsTitouan Galopin
2018-11-25Fix coding styleTitouan Galopin
2018-11-24Merge pull request #153 from stof/optimize_whitespaceAsmir Mustafic
Optimize consuming whitespaces
2018-11-24Merge pull request #156 from stof/fix_typoAsmir Mustafic
Fix typos in comments
2018-11-24Fix typos in commentsChristophe Coevoet
2018-11-24Optimize the check for the element types during adding.Christophe Coevoet
2018-11-24Optimize consuming whitespacesChristophe Coevoet
Places consuming whitespaces don't care about the matched substring. They either need its length, or nothing. Returning only the length directly avoids computing the substring.
2018-11-24Merge pull request #150 from Masterminds/backportAsmir Mustafic
Backport few changes from old master branch
2018-11-24Merge pull request #152 from stof/fix_typoAsmir Mustafic
Fix typo in an error message
2018-11-24Fix typo in an error messageChristophe Coevoet
2018-11-24Optimize the handling of references when consuming dataChristophe Coevoet
2018-11-23The element mask is 0 rather than false if element not fount.Matt Farina
2018-11-23Setting variable for local namespaces to protected in writer.Matt Farina
The namespaces for mathml, html, and svg are set to protected so they cannot be altered. These are part of the spec.
2018-11-08move sequenceMatches to the ScannerAsmir Mustafic
2018-11-08improve consume speedAsmir Mustafic
2018-11-08Merge pull request #147 from tgalopin/tokenizer-perfsAsmir Mustafic
Improve the Tokenizer performance
2018-11-06Remove another current callTitouan Galopin
2018-11-05Inline tag open in Tokenizer to further improve performancesTitouan Galopin
2018-11-05Improve Tokenizer performance by inlining text parsing and removing some ↵Titouan Galopin
Scanner::current calls
2018-11-03Improve performance by relying on a native string instead of InputStreamTitouan Galopin
2018-11-02Add more extensions on composer.json, improve phpdocs and remove dead codeTitouan Galopin
2018-10-08audio is not a block tagAsmir Mustafic
see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio
2017-12-04#136: Respect self-closing tags only on foreign elementsAlbert Peschar
2017-09-01Merge pull request #134 from Masterminds/ampersand-in-urlsAsmir Mustafic
Raw & in attributes
2017-08-31reduce number of times "current" is invokedAsmir Mustafic
2017-08-28Fixes https://github.com/Masterminds/html5-php/issues/124Asmir Mustafic
Reference: https://www.w3.org/TR/html52/syntax.html#character-reference-state If the character reference was consumed as part of an attribute (return state is either attribute value (double-quoted) state, attribute value (single-quoted) state or attribute value (unquoted) state), and the last character matched is not a U+003B SEMICOLON character (;), and the next input character is either a U+003D EQUALS SIGN character (=) or an alphanumeric ASCII character, then, for historical reasons, switch to the character reference end state. If the last character matched is not a U+003B SEMICOLON character (;), this is a parse error.
2017-08-25handle special "img" "image" handlingAsmir Mustafic