mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-19 07:49:05 +00:00
LibWeb: Implement Element.outerHTML
This piggybacks on the same fragment serialization code that innerHTML uses, but instead of constructing an imaginary parent element like the spec asks us to, we just add a separate serialization mode that includes the context element in the serialized markup. This makes the image carousel on https://utah.edu/ show up :^)
This commit is contained in:
parent
0412e17bac
commit
870a954e11
Notes:
sideshowbarker
2024-07-18 02:13:10 +09:00
Author: https://github.com/awesomekling
Commit: 870a954e11
Pull-request: https://github.com/SerenityOS/serenity/pull/23905
Reviewed-by: https://github.com/trflynn89
9 changed files with 120 additions and 75 deletions
|
@ -45,6 +45,11 @@ struct GetRootNodeOptions {
|
|||
bool composed { false };
|
||||
};
|
||||
|
||||
enum class FragmentSerializationMode {
|
||||
Inner,
|
||||
Outer,
|
||||
};
|
||||
|
||||
class Node : public EventTarget {
|
||||
WEB_PLATFORM_OBJECT(Node, EventTarget);
|
||||
|
||||
|
@ -242,7 +247,7 @@ public:
|
|||
i32 unique_id() const { return m_unique_id; }
|
||||
static Node* from_unique_id(i32);
|
||||
|
||||
WebIDL::ExceptionOr<String> serialize_fragment(DOMParsing::RequireWellFormed) const;
|
||||
WebIDL::ExceptionOr<String> serialize_fragment(DOMParsing::RequireWellFormed, FragmentSerializationMode = FragmentSerializationMode::Inner) const;
|
||||
|
||||
void replace_all(JS::GCPtr<Node>);
|
||||
void string_replace_all(String const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue