mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 23:39:02 +00:00
To illustrate the previous behavior, consider these tags and their start and end positions (shown inclusively below): Start tag: End tag: <span> </span> ^ start ^ start ^end ^end The start position of a tag is the first ASCII-alpha code point after the opening brace. The start position of a close tag is the slash just before the first ASCII-alpha code point. And the end position of both is the closing brace. So the opening brace is not included in the emitted tag, but the closing brace is. And the end tag including the slash is an oddity that had to be worked around in its only use case (syntax highlighting). We now consistently exclude the braces from the emitted tag, and also exclude the slash from the end tag, so that it does not need to be accounted for in syntax highlighting. That is, we now have: Start tag: End tag: <span> </span> ^ start ^ start ^end ^end The tokenizer unit test has been extended to test these positions. |
||
---|---|---|
.. | ||
Entities.cpp | ||
Entities.h | ||
HTMLEncodingDetection.cpp | ||
HTMLEncodingDetection.h | ||
HTMLParser.cpp | ||
HTMLParser.h | ||
HTMLToken.cpp | ||
HTMLToken.h | ||
HTMLTokenizer.cpp | ||
HTMLTokenizer.h | ||
ListOfActiveFormattingElements.cpp | ||
ListOfActiveFormattingElements.h | ||
StackOfOpenElements.cpp | ||
StackOfOpenElements.h |