mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Make HTML fragment parsing return ExceptionOr
Update Element::parse_fragment and Node::unsafely_set_html to propagate exceptions. This refactor is needed as a prerequisite for implementing the XML fragment parser, which requires consistent error handling in fragment parsing.
This commit is contained in:
parent
8417d74328
commit
0b715b20a2
Notes:
github-actions[bot]
2025-10-23 10:08:11 +00:00
Author: https://github.com/mikiubo
Commit: 0b715b20a2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6157
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 5 additions and 4 deletions
|
|
@ -2060,7 +2060,7 @@ WebIDL::ExceptionOr<GC::Ref<DOM::DocumentFragment>> Element::parse_fragment(Stri
|
|||
}
|
||||
|
||||
// 3. Let newChildren be the result of invoking algorithm given context and markup.
|
||||
auto new_children = algorithm(*this, markup, HTML::HTMLParser::AllowDeclarativeShadowRoots::No);
|
||||
auto new_children = TRY(algorithm(*this, markup, HTML::HTMLParser::AllowDeclarativeShadowRoots::No));
|
||||
|
||||
// 4. Let fragment be a new DocumentFragment whose node document is context's node document.
|
||||
auto fragment = realm().create<DOM::DocumentFragment>(document());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue