CheckBox.cpp 726 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2020-2022, Andreas Kling <andreas@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/DOM/Document.h>
  7. #include <LibWeb/HTML/HTMLInputElement.h>
  8. #include <LibWeb/Layout/CheckBox.h>
  9. #include <LibWeb/Painting/CheckBoxPaintable.h>
  10. namespace Web::Layout {
  11. JS_DEFINE_ALLOCATOR(CheckBox);
  12. CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, CSS::StyleProperties style)
  13. : FormAssociatedLabelableNode(document, element, move(style))
  14. {
  15. set_natural_width(13);
  16. set_natural_height(13);
  17. }
  18. CheckBox::~CheckBox() = default;
  19. JS::GCPtr<Painting::Paintable> CheckBox::create_paintable() const
  20. {
  21. return Painting::CheckBoxPaintable::create(*this);
  22. }
  23. }