ladybird/Userland/Libraries/LibWeb/HTML/Parser
Timothy Flynn 5b2bc90b50 LibWeb: Set consistent positions for the start and end of HTML tags
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.
2023-08-25 08:22:24 +02:00
..
Entities.cpp Everywhere: Use nested namespace qualifiers 2023-07-12 10:05:42 +03:30
Entities.h Everywhere: Use nested namespace qualifiers 2023-07-12 10:05:42 +03:30
HTMLEncodingDetection.cpp LibJS: Make Heap::allocate<T>() infallible 2023-08-13 15:38:42 +02:00
HTMLEncodingDetection.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
HTMLParser.cpp LibWeb: Make StyleValue constructors infallible 2023-08-19 17:34:22 +02:00
HTMLParser.h LibWeb: Add Web::HTML::parse_legacy_color_value 2023-05-28 13:24:37 +02:00
HTMLToken.cpp Everywhere: Rename to_{string => deprecated_string}() where applicable 2022-12-06 08:54:33 +01:00
HTMLToken.h Everywhere: Use AK_MAKE_DEFAULT_MOVABLE to avoid mistakes 2023-06-18 08:47:51 +01:00
HTMLTokenizer.cpp LibWeb: Set consistent positions for the start and end of HTML tags 2023-08-25 08:22:24 +02:00
HTMLTokenizer.h LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00
ListOfActiveFormattingElements.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
ListOfActiveFormattingElements.h Everywhere: Remove NonnullRefPtr.h includes 2023-03-06 23:46:35 +01:00
StackOfOpenElements.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
StackOfOpenElements.h Everywhere: Remove NonnullRefPtr.h includes 2023-03-06 23:46:35 +01:00