ladybird/Libraries/LibWeb/HTML/Parser
Andreas Kling 27efb3b140 LibWeb: When declarative shadow attachment fails, continue in right spot
If attachment fails for whatever reason (e.g the host element is not
allowed to be a host), the HTML spec tells us to insert the template
element anyway and proceed.

Before this change, we were recomputing the insertion location at this
point, which caused it to be *inside* the template element. Inserting
the template element into itself didn't work, and so the DOM would end
up incorrect.

The fix here is to simply use the insertion point we determined earlier
in the same function, before putting a template element on the stack of
open elements. We already do this elsewhere.

Fixes at least 228 subtests on WPT. :^)
2025-04-25 11:01:17 +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: Correct some spec typos 2025-04-10 04:01:37 +02:00
HTMLEncodingDetection.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
HTMLParser.cpp LibWeb: When declarative shadow attachment fails, continue in right spot 2025-04-25 11:01:17 +02:00
HTMLParser.h LibWeb: Make storage of CSS::StyleValues const-correct 2025-04-16 10:41:44 -06:00
HTMLToken.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
HTMLToken.h LibWeb: Remove unused HTMLToken::Position::byte_offset 2025-04-20 18:43:11 +02:00
HTMLToken.swift LibWeb: Add remaining states to the Swift tokenizer 2024-11-15 10:51:45 -07:00
HTMLTokenizer.cpp LibWeb: Remove unused HTMLToken::Position::byte_offset 2025-04-20 18:43:11 +02:00
HTMLTokenizer.h LibJS+LibWeb: Remove more uses of DeprecatedFlyString 2025-03-24 22:27:17 +00:00
HTMLTokenizer.swift LibWeb: Make named character references more spec-compliant & efficient 2025-03-22 16:03:44 +01: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 LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ListOfActiveFormattingElements.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
SpeculativeHTMLParser.swift LibWeb: Store a SpeculativeHTMLParser on the HTML Parser 2025-04-16 09:02:27 -06:00
StackOfOpenElements.cpp LibWeb: Fix various typos 2025-01-30 15:00:16 +00:00
StackOfOpenElements.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00