CheckBox.cpp 812 B

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