ladybird/Libraries/LibWeb/HTML/Parser
Luke 6ffcd53479 LibWeb: Fix character references losing characters in certain situations
This fixes 4 issues:
- RECONSUME_IN_RETURN_STATE was functionally equivalent to
  SWITCH_TO_RETURN_STATE, which caused us to lose characters.
  For example, &test= would lose the =

- & characters by themselves would be lost. For example, 1 & 2
  would become 1 2. This is because we forgot to flush
  characters in the the ANYTHING_ELSE path in CharacterReference

- Named character references didn't work at all in attributes.
  This is because there was a path that was checking the entity
  code points instead of the entity itself. Plus, the path that
  was checking the entity itself wasn't quite spec compliant.

- If we fail to match a named character reference, the first
  character is lost. For example &test would become &est.
  However, this relies on a little hack since I can't wrap my
  head around on how to change the code to do as the spec says.
  The hack is to reconsume in AmbigiousAmpersand instead of
  just switching to it.

Fixes #3957
2020-12-29 17:39:08 +01:00
..
Entities.cpp Unicode: Try s/codepoint/code_point/g again 2020-08-05 22:33:42 +02:00
Entities.h Unicode: Try s/codepoint/code_point/g again 2020-08-05 22:33:42 +02:00
HTMLDocumentParser.cpp LibWeb: Add hack to disable StyleInvalidator while parsing document 2020-12-15 19:33:53 +01:00
HTMLDocumentParser.h LibWeb: Make HTMLDocumentParser take an existing document 2020-12-13 16:59:22 +01:00
HTMLToken.cpp LibWeb: Move the HTML parser into HTML/Parser/ 2020-07-28 19:23:18 +02:00
HTMLToken.h LibWeb: Add initial implementation of foreign content parsing 2020-10-22 15:24:42 +02:00
HTMLTokenizer.cpp LibWeb: Fix character references losing characters in certain situations 2020-12-29 17:39:08 +01:00
HTMLTokenizer.h Unicode: Try s/codepoint/code_point/g again 2020-08-05 22:33:42 +02:00
ListOfActiveFormattingElements.cpp LibWeb: Add initial implementation of foreign content parsing 2020-10-22 15:24:42 +02:00
ListOfActiveFormattingElements.h LibWeb: Move the HTML parser into HTML/Parser/ 2020-07-28 19:23:18 +02:00
StackOfOpenElements.cpp LibWeb: Add initial implementation of foreign content parsing 2020-10-22 15:24:42 +02:00
StackOfOpenElements.h LibWeb: Implement <template> parsing 2020-08-21 11:57:11 +02:00