CheckBox.cpp 776 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibGfx/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. CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
  14. : FormAssociatedLabelableNode(document, element, move(style))
  15. {
  16. set_intrinsic_width(13);
  17. set_intrinsic_height(13);
  18. }
  19. CheckBox::~CheckBox() = default;
  20. RefPtr<Painting::Paintable> CheckBox::create_paintable() const
  21. {
  22. return Painting::CheckBoxPaintable::create(*this);
  23. }
  24. }