1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00
ladybird/Libraries/LibWeb/HTML/XMLSerializer.h
Timothy Flynn 7280ed6312 Meta: Enforce newlines around namespaces
This has come up several times during code review, so let's just enforce
it using a new clang-format 20 option.
2025-05-14 02:01:59 -06:00

38 lines
951 B
C++

/*
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/PlatformObject.h>
namespace Web::HTML {
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#xmlserializer
class XMLSerializer final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(XMLSerializer, Bindings::PlatformObject);
GC_DECLARE_ALLOCATOR(XMLSerializer);
public:
static WebIDL::ExceptionOr<GC::Ref<XMLSerializer>> construct_impl(JS::Realm&);
virtual ~XMLSerializer() override;
WebIDL::ExceptionOr<String> serialize_to_string(GC::Ref<DOM::Node const> root);
private:
explicit XMLSerializer(JS::Realm&);
virtual void initialize(JS::Realm&) override;
};
enum class RequireWellFormed {
No,
Yes,
};
WebIDL::ExceptionOr<String> serialize_node_to_xml_string(GC::Ref<DOM::Node const> root, RequireWellFormed require_well_formed);
}