mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:28:11 +00:00
LibWeb: Make XMLSerializer GC-allocated
This commit is contained in:
parent
6b7a1d13e9
commit
233208b640
4 changed files with 21 additions and 16 deletions
|
@ -6,29 +6,22 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/RefCounted.h>
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
|
||||
namespace Web::DOMParsing {
|
||||
|
||||
class XMLSerializer final
|
||||
: public RefCounted<XMLSerializer>
|
||||
, public Bindings::Wrappable {
|
||||
public:
|
||||
using WrapperType = Bindings::XMLSerializerWrapper;
|
||||
class XMLSerializer final : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(XMLSerializer, Bindings::PlatformObject);
|
||||
|
||||
static NonnullRefPtr<XMLSerializer> create_with_global_object(HTML::Window&)
|
||||
{
|
||||
return adopt_ref(*new XMLSerializer());
|
||||
}
|
||||
public:
|
||||
static JS::NonnullGCPtr<XMLSerializer> create_with_global_object(HTML::Window&);
|
||||
|
||||
virtual ~XMLSerializer() override;
|
||||
|
||||
DOM::ExceptionOr<String> serialize_to_string(JS::NonnullGCPtr<DOM::Node> root);
|
||||
|
||||
private:
|
||||
XMLSerializer();
|
||||
explicit XMLSerializer(HTML::Window&);
|
||||
};
|
||||
|
||||
enum class RequireWellFormed {
|
||||
|
@ -39,3 +32,5 @@ enum class RequireWellFormed {
|
|||
DOM::ExceptionOr<String> serialize_node_to_xml_string(JS::NonnullGCPtr<DOM::Node> root, RequireWellFormed require_well_formed);
|
||||
|
||||
}
|
||||
|
||||
WRAPPER_HACK(XMLSerializer, Web::DOMParsing)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue