diff options
author | Luke Wilde <lukew@serenityos.org> | 2022-12-10 21:34:25 +0000 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-12-10 21:37:18 +0000 |
commit | eabb0be7ea29709a8506e4ad6cafbf5c2a0bcbe2 (patch) | |
tree | c88ba1040c4fe12174eb3cc15c3fc36fe195a13a | |
parent | fa29214d9ab7fce395cba4688605a5d4d2b607bd (diff) | |
download | serenity-eabb0be7ea29709a8506e4ad6cafbf5c2a0bcbe2.zip |
LibWeb: Check HTML parser position is equal to or after insertion point
This used to be the other way around. If we just inserted input with
document.write, this would always be true and not allow document.write
to immediately parse its input (given that there's no pending parsing
blocking script)
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h index 2915812a2f..dc495b06c3 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h @@ -132,7 +132,7 @@ public: bool is_insertion_point_defined() const { return m_insertion_point.defined; } bool is_insertion_point_reached() { - return m_insertion_point.defined && m_insertion_point.position >= m_utf8_view.iterator_offset(m_utf8_iterator); + return m_insertion_point.defined && m_utf8_view.iterator_offset(m_utf8_iterator) >= m_insertion_point.position; } void undefine_insertion_point() { m_insertion_point.defined = false; } void store_insertion_point() { m_old_insertion_point = m_insertion_point; } |