HTMLHtmlElement.cpp 762 B

12345678910111213141516171819202122232425262728293031
  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. namespace Web::HTML {
  8. HTMLHtmlElement::HTMLHtmlElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  9. : HTMLElement(document, move(qualified_name))
  10. {
  11. }
  12. HTMLHtmlElement::~HTMLHtmlElement() = default;
  13. bool HTMLHtmlElement::should_use_body_background_properties() const
  14. {
  15. auto background_color = layout_node()->computed_values().background_color();
  16. auto const& background_layers = layout_node()->background_layers();
  17. for (auto& layer : background_layers) {
  18. if (layer.image)
  19. return false;
  20. }
  21. return (background_color == Color::Transparent);
  22. }
  23. }