HTMLHtmlElement.cpp 875 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/HTML/HTMLHtmlElement.h>
  7. #include <LibWeb/HTML/Window.h>
  8. namespace Web::HTML {
  9. HTMLHtmlElement::HTMLHtmlElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  10. : HTMLElement(document, move(qualified_name))
  11. {
  12. set_prototype(&window().cached_web_prototype("HTMLHtmlElement"));
  13. }
  14. HTMLHtmlElement::~HTMLHtmlElement() = default;
  15. bool HTMLHtmlElement::should_use_body_background_properties() const
  16. {
  17. auto background_color = layout_node()->computed_values().background_color();
  18. auto const& background_layers = layout_node()->background_layers();
  19. for (auto& layer : background_layers) {
  20. if (layer.background_image)
  21. return false;
  22. }
  23. return (background_color == Color::Transparent);
  24. }
  25. }