ladybird/Libraries/LibWeb/HTML/Parser
Ryan Liptak 7096a2892e LibWeb/HTML: Use lookahead when possible for named character references
When there is an active insertion point, it's necessary to tokenize
code-point-by-code-point to handle the case of document.write being
used to insert a named character reference one code point at a time.

However, when there is no insertion point defined, looking ahead at the
input and doing the matching all-at-once is more efficient since it
allows:

- Avoiding the work done in next_code_point between each code point
  being matched (leading to better CPU cache usage in theory)
- Skipping ahead to the end of the match all at once, which does less
  work overall than the equivalent number of next_code_point calls
  (that is, skip(N) does less work than next_code_point called N times)

In my benchmarking, this provides a small performance boost (fewer
instructions, fewer cpu cycles, fewer branch misses) essentially for
free.
2025-07-04 11:11:19 +02:00
..
Entities.cpp LibWeb: Make named character references more spec-compliant & efficient 2025-03-22 16:03:44 +01:00
Entities.h LibWeb: Make named character references more spec-compliant & efficient 2025-03-22 16:03:44 +01:00
Entities.json LibWeb: Make named character references more spec-compliant & efficient 2025-03-22 16:03:44 +01:00
HTMLEncodingDetection.cpp LibWeb+LibGfx: Apply editorial punctuation/whitespace/markup fixes 2025-06-25 03:12:19 +12:00
HTMLEncodingDetection.h
HTMLParser.cpp LibWeb: Avoid updating muted state on muted content attribute changes 2025-06-27 09:14:54 +12:00
HTMLParser.h Meta: Enforce newlines around namespaces 2025-05-14 02:01:59 -06:00
HTMLToken.cpp
HTMLToken.h LibWeb: Remove unused HTMLToken::Position::byte_offset 2025-04-20 18:43:11 +02:00
HTMLToken.swift LibWeb: Fix copyright headers with inconsistent > characters 2025-05-12 11:21:04 -06:00
HTMLTokenizer.cpp LibWeb/HTML: Use lookahead when possible for named character references 2025-07-04 11:11:19 +02:00
HTMLTokenizer.h LibWeb: Let HTMLTokenizer walk over code points instead of UTF-8 2025-05-11 01:13:20 +02:00
HTMLTokenizer.swift LibWeb: Fix copyright headers with inconsistent > characters 2025-05-12 11:21:04 -06:00
HTMLTokenizerHelpers.cpp LibWeb: Make named character references more spec-compliant & efficient 2025-03-22 16:03:44 +01:00
HTMLTokenizerHelpers.h LibWeb: Make named character references more spec-compliant & efficient 2025-03-22 16:03:44 +01:00
ListOfActiveFormattingElements.cpp
ListOfActiveFormattingElements.h
SpeculativeHTMLParser.swift LibWeb: Fix copyright headers with inconsistent > characters 2025-05-12 11:21:04 -06:00
StackOfOpenElements.cpp
StackOfOpenElements.h