TextMetrics.cpp 546 B

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