1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:47: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:
Lenny Maiorani 2022-03-14 13:21:51 -06:00 committed by Linus Groh
parent c0dd188c4d
commit c37820b898
237 changed files with 243 additions and 730 deletions

View file

@ -19,9 +19,7 @@ BlockContainer::BlockContainer(DOM::Document& document, DOM::Node* node, CSS::Co
{
}
BlockContainer::~BlockContainer()
{
}
BlockContainer::~BlockContainer() = default;
bool BlockContainer::is_scrollable() const
{

View file

@ -16,8 +16,6 @@ BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element, Nonn
set_inline(true);
}
BreakNode::~BreakNode()
{
}
BreakNode::~BreakNode() = default;
}

View file

@ -16,9 +16,7 @@ ButtonBox::ButtonBox(DOM::Document& document, HTML::HTMLInputElement& element, N
{
}
ButtonBox::~ButtonBox()
{
}
ButtonBox::~ButtonBox() = default;
void ButtonBox::prepare_for_replaced_layout()
{

View file

@ -15,9 +15,7 @@ CanvasBox::CanvasBox(DOM::Document& document, HTML::HTMLCanvasElement& element,
{
}
CanvasBox::~CanvasBox()
{
}
CanvasBox::~CanvasBox() = default;
void CanvasBox::prepare_for_replaced_layout()
{

View file

@ -20,9 +20,7 @@ CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, Non
set_intrinsic_height(13);
}
CheckBox::~CheckBox()
{
}
CheckBox::~CheckBox() = default;
RefPtr<Painting::Paintable> CheckBox::create_paintable() const
{

View file

@ -39,9 +39,7 @@ FlexFormattingContext::FlexFormattingContext(FormattingState& state, Box const&
{
}
FlexFormattingContext::~FlexFormattingContext()
{
}
FlexFormattingContext::~FlexFormattingContext() = default;
void FlexFormattingContext::run(Box const& run_box, LayoutMode)
{

View file

@ -27,9 +27,7 @@ FormattingContext::FormattingContext(Type type, FormattingState& state, Box cons
{
}
FormattingContext::~FormattingContext()
{
}
FormattingContext::~FormattingContext() = default;
bool FormattingContext::creates_block_formatting_context(const Box& box)
{

View file

@ -17,9 +17,7 @@ FrameBox::FrameBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr
{
}
FrameBox::~FrameBox()
{
}
FrameBox::~FrameBox() = default;
void FrameBox::prepare_for_replaced_layout()
{

View file

@ -16,9 +16,7 @@ InitialContainingBlock::InitialContainingBlock(DOM::Document& document, NonnullR
{
}
InitialContainingBlock::~InitialContainingBlock()
{
}
InitialContainingBlock::~InitialContainingBlock() = default;
void InitialContainingBlock::build_stacking_context_tree()
{

View file

@ -24,9 +24,7 @@ InlineFormattingContext::InlineFormattingContext(FormattingState& state, BlockCo
{
}
InlineFormattingContext::~InlineFormattingContext()
{
}
InlineFormattingContext::~InlineFormattingContext() = default;
BlockFormattingContext& InlineFormattingContext::parent()
{

View file

@ -20,9 +20,7 @@ InlineNode::InlineNode(DOM::Document& document, DOM::Element* element, NonnullRe
set_inline(true);
}
InlineNode::~InlineNode()
{
}
InlineNode::~InlineNode() = default;
RefPtr<Painting::Paintable> InlineNode::create_paintable() const
{

View file

@ -20,9 +20,7 @@ Label::Label(DOM::Document& document, HTML::HTMLLabelElement* element, NonnullRe
{
}
Label::~Label()
{
}
Label::~Label() = default;
void Label::handle_mousedown_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const&, unsigned button)
{

View file

@ -23,7 +23,7 @@ struct LayoutPosition {
class LayoutRange {
public:
LayoutRange() { }
LayoutRange() = default;
LayoutRange(const LayoutPosition& start, const LayoutPosition& end)
: m_start(start)
, m_end(end)

View file

@ -13,7 +13,7 @@ namespace Web::Layout {
class LineBox {
public:
LineBox() { }
LineBox() = default;
float width() const { return m_width; }
float bottom() const { return m_bottom; }

View file

@ -15,9 +15,7 @@ ListItemBox::ListItemBox(DOM::Document& document, DOM::Element* element, Nonnull
{
}
ListItemBox::~ListItemBox()
{
}
ListItemBox::~ListItemBox() = default;
void ListItemBox::set_marker(RefPtr<ListItemMarkerBox> marker)
{

View file

@ -49,9 +49,7 @@ ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType
}
}
ListItemMarkerBox::~ListItemMarkerBox()
{
}
ListItemMarkerBox::~ListItemMarkerBox() = default;
Gfx::Bitmap const* ListItemMarkerBox::list_style_image_bitmap() const
{

View file

@ -145,7 +145,7 @@ private:
class NodeWithStyle : public Node {
public:
virtual ~NodeWithStyle() override { }
virtual ~NodeWithStyle() override = default;
const CSS::ImmutableComputedValues& computed_values() const { return static_cast<const CSS::ImmutableComputedValues&>(m_computed_values); }

View file

@ -15,9 +15,7 @@ Progress::Progress(DOM::Document& document, HTML::HTMLProgressElement& element,
set_intrinsic_height(12);
}
Progress::~Progress()
{
}
Progress::~Progress() = default;
RefPtr<Painting::Paintable> Progress::create_paintable() const
{

View file

@ -18,9 +18,7 @@ RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& elemen
set_intrinsic_height(12);
}
RadioButton::~RadioButton()
{
}
RadioButton::~RadioButton() = default;
RefPtr<Painting::Paintable> RadioButton::create_paintable() const
{

View file

@ -18,8 +18,6 @@ ReplacedBox::ReplacedBox(DOM::Document& document, DOM::Element& element, Nonnull
set_inline(true);
}
ReplacedBox::~ReplacedBox()
{
}
ReplacedBox::~ReplacedBox() = default;
}

View file

@ -18,9 +18,7 @@ SVGFormattingContext::SVGFormattingContext(FormattingState& state, Box const& bo
{
}
SVGFormattingContext::~SVGFormattingContext()
{
}
SVGFormattingContext::~SVGFormattingContext() = default;
void SVGFormattingContext::run(Box const& box, LayoutMode)
{

View file

@ -19,8 +19,6 @@ TableBox::TableBox(DOM::Document& document, DOM::Element* element, CSS::Computed
{
}
TableBox::~TableBox()
{
}
TableBox::~TableBox() = default;
}

View file

@ -20,9 +20,7 @@ TableCellBox::TableCellBox(DOM::Document& document, DOM::Element* element, CSS::
{
}
TableCellBox::~TableCellBox()
{
}
TableCellBox::~TableCellBox() = default;
size_t TableCellBox::colspan() const
{

View file

@ -21,9 +21,7 @@ TableFormattingContext::TableFormattingContext(FormattingState& state, BlockCont
{
}
TableFormattingContext::~TableFormattingContext()
{
}
TableFormattingContext::~TableFormattingContext() = default;
void TableFormattingContext::run(Box const& box, LayoutMode)
{

View file

@ -19,8 +19,6 @@ TableRowBox::TableRowBox(DOM::Document& document, DOM::Element* element, CSS::Co
{
}
TableRowBox::~TableRowBox()
{
}
TableRowBox::~TableRowBox() = default;
}

View file

@ -16,9 +16,7 @@ TableRowGroupBox::TableRowGroupBox(DOM::Document& document, DOM::Element* elemen
{
}
TableRowGroupBox::~TableRowGroupBox()
{
}
TableRowGroupBox::~TableRowGroupBox() = default;
size_t TableRowGroupBox::column_count() const
{

View file

@ -21,9 +21,7 @@ TextNode::TextNode(DOM::Document& document, DOM::Text& text)
set_inline(true);
}
TextNode::~TextNode()
{
}
TextNode::~TextNode() = default;
static bool is_all_whitespace(StringView string)
{

View file

@ -24,9 +24,7 @@
namespace Web::Layout {
TreeBuilder::TreeBuilder()
{
}
TreeBuilder::TreeBuilder() = default;
// The insertion_parent_for_*() functions maintain the invariant that block-level boxes must have either
// only block-level children or only inline-level children.