diff options
author | Karol Kosek <krkk@serenityos.org> | 2021-07-29 15:36:10 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-02-14 12:50:44 +0330 |
commit | fb5e2670d634f8a024d76f28d931bc36988884b4 (patch) | |
tree | b4ac0553306f85e052b605935c261ba90724706d /Tests/LibWeb | |
parent | 704bb361bbb40f01259d963ae5d20cd4b9c51482 (diff) | |
download | serenity-fb5e2670d634f8a024d76f28d931bc36988884b4.zip |
LibWeb: Fix highlighting HTML comments
Commit b193351a99 caused the HTML comments to flash when changing
the text cursor. Also, when double-clicking on a comment, the selection
started from the beginning of the file instead.
The following message was displaying when `TOKENIZER_TRACE_DEBUG`
was enabled:
(Tokenizer::nth_last_position) Invalid position requested: 4th-last
of 4. Returning (0-0).
Changing the `nth_last_position` to 3 fixes this. I'm guessing that's
because the parser is at that moment on the second hyphen of the `<!--`
string, so it has to go back only by three characters.
Diffstat (limited to 'Tests/LibWeb')
-rw-r--r-- | Tests/LibWeb/TestHTMLTokenizer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Tests/LibWeb/TestHTMLTokenizer.cpp b/Tests/LibWeb/TestHTMLTokenizer.cpp index 71ca7409ee..da84b9e295 100644 --- a/Tests/LibWeb/TestHTMLTokenizer.cpp +++ b/Tests/LibWeb/TestHTMLTokenizer.cpp @@ -206,5 +206,5 @@ TEST_CASE(regression) auto file_contents = file.value()->read_all(); auto tokens = run_tokenizer(file_contents); u32 hash = hash_tokens(tokens); - EXPECT_EQ(hash, 1280197787u); + EXPECT_EQ(hash, 3215459107u); } |