TextMetrics.cpp 628 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2021, sin-ack <sin-ack@protonmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/TextMetricsPrototype.h>
  7. #include <LibWeb/HTML/TextMetrics.h>
  8. #include <LibWeb/HTML/Window.h>
  9. namespace Web::HTML {
  10. JS::NonnullGCPtr<TextMetrics> TextMetrics::create(HTML::Window& window)
  11. {
  12. return *window.heap().allocate<TextMetrics>(window.realm(), window);
  13. }
  14. TextMetrics::TextMetrics(HTML::Window& window)
  15. : PlatformObject(window.realm())
  16. {
  17. set_prototype(&window.ensure_web_prototype<Bindings::TextMetricsPrototype>("TextMetrics"));
  18. }
  19. TextMetrics::~TextMetrics() = default;
  20. }