CSSFontFaceRule.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
  3. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #include <LibWeb/CSS/CSSFontFaceRule.h>
  8. #include <LibWeb/HTML/Window.h>
  9. namespace Web::CSS {
  10. CSSFontFaceRule* CSSFontFaceRule::create(HTML::Window& window_object, FontFace&& font_face)
  11. {
  12. return window_object.heap().allocate<CSSFontFaceRule>(window_object.realm(), window_object, move(font_face));
  13. }
  14. CSSFontFaceRule::CSSFontFaceRule(HTML::Window& window_object, FontFace&& font_face)
  15. : CSSRule(window_object)
  16. , m_font_face(move(font_face))
  17. {
  18. set_prototype(&window_object.cached_web_prototype("CSSFontFaceRule"));
  19. }
  20. CSSStyleDeclaration* CSSFontFaceRule::style()
  21. {
  22. // FIXME: Return a CSSStyleDeclaration subclass that directs changes to the FontFace.
  23. return nullptr;
  24. }
  25. // https://www.w3.org/TR/cssom/#ref-for-cssfontfacerule
  26. String CSSFontFaceRule::serialized() const
  27. {
  28. // FIXME: Implement this!
  29. return "@font-face { /* FIXME: Implement CSSFontFaceRule::serialized()! */ }";
  30. }
  31. }