mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07:45 +00:00
Libraries: Use default constructors/destructors in LibWeb
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
This commit is contained in:
parent
c0dd188c4d
commit
c37820b898
237 changed files with 243 additions and 730 deletions
|
@ -15,10 +15,6 @@ AbortController::AbortController()
|
|||
{
|
||||
}
|
||||
|
||||
AbortController::~AbortController()
|
||||
{
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-abortcontroller-abort
|
||||
void AbortController::abort(JS::Value reason)
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
return AbortController::create();
|
||||
}
|
||||
|
||||
virtual ~AbortController() override;
|
||||
virtual ~AbortController() override = default;
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-abortcontroller-signal
|
||||
NonnullRefPtr<AbortSignal> signal() const { return m_signal; }
|
||||
|
|
|
@ -19,10 +19,6 @@ AbortSignal::AbortSignal()
|
|||
{
|
||||
}
|
||||
|
||||
AbortSignal::~AbortSignal()
|
||||
{
|
||||
}
|
||||
|
||||
JS::Object* AbortSignal::create_wrapper(JS::GlobalObject& global_object)
|
||||
{
|
||||
return wrap(global_object, *this);
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
return AbortSignal::create();
|
||||
}
|
||||
|
||||
virtual ~AbortSignal() override;
|
||||
virtual ~AbortSignal() override = default;
|
||||
|
||||
void add_abort_algorithm(Function<void()>);
|
||||
|
||||
|
|
|
@ -15,10 +15,6 @@ CharacterData::CharacterData(Document& document, NodeType type, const String& da
|
|||
{
|
||||
}
|
||||
|
||||
CharacterData::~CharacterData()
|
||||
{
|
||||
}
|
||||
|
||||
void CharacterData::set_data(String data)
|
||||
{
|
||||
if (m_data == data)
|
||||
|
|
|
@ -20,7 +20,7 @@ class CharacterData
|
|||
public:
|
||||
using WrapperType = Bindings::CharacterDataWrapper;
|
||||
|
||||
virtual ~CharacterData() override;
|
||||
virtual ~CharacterData() override = default;
|
||||
|
||||
const String& data() const { return m_data; }
|
||||
void set_data(String);
|
||||
|
|
|
@ -15,10 +15,6 @@ Comment::Comment(Document& document, const String& data)
|
|||
{
|
||||
}
|
||||
|
||||
Comment::~Comment()
|
||||
{
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-comment-comment
|
||||
NonnullRefPtr<Comment> Comment::create_with_global_object(Bindings::WindowObject& window, String const& data)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ public:
|
|||
using WrapperType = Bindings::CommentWrapper;
|
||||
|
||||
explicit Comment(Document&, const String&);
|
||||
virtual ~Comment() override;
|
||||
virtual ~Comment() override = default;
|
||||
|
||||
virtual FlyString node_name() const override { return "#comment"; }
|
||||
|
||||
|
|
|
@ -9,12 +9,6 @@
|
|||
#include <LibWeb/DOM/IDLEventListener.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
DOMEventListener::DOMEventListener()
|
||||
{
|
||||
}
|
||||
DOMEventListener::~DOMEventListener()
|
||||
{
|
||||
}
|
||||
|
||||
DOMEventListener::DOMEventListener() = default;
|
||||
DOMEventListener::~DOMEventListener() = default;
|
||||
}
|
||||
|
|
|
@ -92,9 +92,7 @@ Document::Document(const AK::URL& url)
|
|||
});
|
||||
}
|
||||
|
||||
Document::~Document()
|
||||
{
|
||||
}
|
||||
Document::~Document() = default;
|
||||
|
||||
void Document::removed_last_ref()
|
||||
{
|
||||
|
|
|
@ -14,10 +14,6 @@ DocumentFragment::DocumentFragment(Document& document)
|
|||
{
|
||||
}
|
||||
|
||||
DocumentFragment::~DocumentFragment()
|
||||
{
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment
|
||||
NonnullRefPtr<DocumentFragment> DocumentFragment::create_with_global_object(Bindings::WindowObject& window)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
static NonnullRefPtr<DocumentFragment> create_with_global_object(Bindings::WindowObject& window);
|
||||
|
||||
explicit DocumentFragment(Document& document);
|
||||
virtual ~DocumentFragment() override;
|
||||
virtual ~DocumentFragment() override = default;
|
||||
|
||||
virtual FlyString node_name() const override { return "#document-fragment"; }
|
||||
|
||||
|
|
|
@ -13,8 +13,4 @@ DocumentType::DocumentType(Document& document)
|
|||
{
|
||||
}
|
||||
|
||||
DocumentType::~DocumentType()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
}
|
||||
|
||||
explicit DocumentType(Document&);
|
||||
virtual ~DocumentType() override;
|
||||
virtual ~DocumentType() override = default;
|
||||
|
||||
virtual FlyString node_name() const override { return "#doctype"; }
|
||||
|
||||
|
|
|
@ -47,9 +47,7 @@ Element::Element(Document& document, DOM::QualifiedName qualified_name)
|
|||
make_html_uppercased_qualified_name();
|
||||
}
|
||||
|
||||
Element::~Element()
|
||||
{
|
||||
}
|
||||
Element::~Element() = default;
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-getattribute
|
||||
String Element::get_attribute(const FlyString& name) const
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
return Event::create(event_name, event_init);
|
||||
}
|
||||
|
||||
virtual ~Event() { }
|
||||
virtual ~Event() = default;
|
||||
|
||||
double time_stamp() const;
|
||||
|
||||
|
|
|
@ -37,13 +37,8 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
EventTarget::EventTarget()
|
||||
{
|
||||
}
|
||||
|
||||
EventTarget::~EventTarget()
|
||||
{
|
||||
}
|
||||
EventTarget::EventTarget() = default;
|
||||
EventTarget::~EventTarget() = default;
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-flatten-options
|
||||
static bool flatten_event_listener_options(Variant<EventListenerOptions, bool> const& options)
|
||||
|
|
|
@ -18,9 +18,7 @@ HTMLCollection::HTMLCollection(ParentNode& root, Function<bool(Element const&)>
|
|||
{
|
||||
}
|
||||
|
||||
HTMLCollection::~HTMLCollection()
|
||||
{
|
||||
}
|
||||
HTMLCollection::~HTMLCollection() = default;
|
||||
|
||||
Vector<NonnullRefPtr<Element>> HTMLCollection::collect_matching_elements() const
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Web::DOM {
|
|||
|
||||
class Position {
|
||||
public:
|
||||
Position() { }
|
||||
Position() = default;
|
||||
Position(Node&, unsigned offset);
|
||||
|
||||
bool is_valid() const { return m_node; }
|
||||
|
|
|
@ -15,8 +15,4 @@ ProcessingInstruction::ProcessingInstruction(Document& document, const String& d
|
|||
{
|
||||
}
|
||||
|
||||
ProcessingInstruction::~ProcessingInstruction()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public:
|
|||
using WrapperType = Bindings::ProcessingInstructionWrapper;
|
||||
|
||||
ProcessingInstruction(Document&, const String& data, const String& target);
|
||||
virtual ~ProcessingInstruction() override;
|
||||
virtual ~ProcessingInstruction() override = default;
|
||||
|
||||
virtual FlyString node_name() const override { return m_target; }
|
||||
|
||||
|
|
|
@ -43,10 +43,6 @@ Range::Range(Node& start_container, u32 start_offset, Node& end_container, u32 e
|
|||
{
|
||||
}
|
||||
|
||||
Range::~Range()
|
||||
{
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-range-root
|
||||
Node& Range::root()
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ class Range final : public AbstractRange {
|
|||
public:
|
||||
using WrapperType = Bindings::RangeWrapper;
|
||||
|
||||
virtual ~Range() override;
|
||||
virtual ~Range() override = default;
|
||||
|
||||
static NonnullRefPtr<Range> create(Document&);
|
||||
static NonnullRefPtr<Range> create(HTML::Window&);
|
||||
|
|
|
@ -17,10 +17,6 @@ StaticRange::StaticRange(Node& start_container, u32 start_offset, Node& end_cont
|
|||
{
|
||||
}
|
||||
|
||||
StaticRange::~StaticRange()
|
||||
{
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-staticrange-staticrange
|
||||
ExceptionOr<NonnullRefPtr<StaticRange>> StaticRange::create_with_global_object(JS::GlobalObject&, StaticRangeInit& init)
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ class StaticRange final : public AbstractRange {
|
|||
public:
|
||||
using WrapperType = Bindings::StaticRangeWrapper;
|
||||
|
||||
virtual ~StaticRange() override;
|
||||
virtual ~StaticRange() override = default;
|
||||
|
||||
static ExceptionOr<NonnullRefPtr<StaticRange>> create_with_global_object(JS::GlobalObject&, StaticRangeInit& init);
|
||||
|
||||
|
|
|
@ -16,10 +16,6 @@ Text::Text(Document& document, const String& data)
|
|||
{
|
||||
}
|
||||
|
||||
Text::~Text()
|
||||
{
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-text-text
|
||||
NonnullRefPtr<Text> Text::create_with_global_object(Bindings::WindowObject& window, String const& data)
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
using WrapperType = Bindings::TextWrapper;
|
||||
|
||||
explicit Text(Document&, const String&);
|
||||
virtual ~Text() override;
|
||||
virtual ~Text() override = default;
|
||||
|
||||
static NonnullRefPtr<Text> create_with_global_object(Bindings::WindowObject& window, String const& data);
|
||||
|
||||
|
|
|
@ -22,10 +22,6 @@ TreeWalker::TreeWalker(Node& root)
|
|||
{
|
||||
}
|
||||
|
||||
TreeWalker::~TreeWalker()
|
||||
{
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-document-createtreewalker
|
||||
NonnullRefPtr<TreeWalker> TreeWalker::create(Node& root, unsigned what_to_show, RefPtr<NodeFilter> filter)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
using WrapperType = Bindings::TreeWalkerWrapper;
|
||||
|
||||
static NonnullRefPtr<TreeWalker> create(Node& root, unsigned what_to_show, RefPtr<NodeFilter>);
|
||||
virtual ~TreeWalker() override;
|
||||
virtual ~TreeWalker() override = default;
|
||||
|
||||
NonnullRefPtr<Node> current_node() const;
|
||||
void set_current_node(Node&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue