HTMLPreElement.cpp 755 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/HTML/HTMLPreElement.h>
  7. namespace Web::HTML {
  8. HTMLPreElement::HTMLPreElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  9. : HTMLElement(document, move(qualified_name))
  10. {
  11. }
  12. HTMLPreElement::~HTMLPreElement() = default;
  13. void HTMLPreElement::apply_presentational_hints(CSS::StyleProperties& style) const
  14. {
  15. HTMLElement::apply_presentational_hints(style);
  16. for_each_attribute([&](auto const& name, auto const&) {
  17. if (name.equals_ignoring_case(HTML::AttributeNames::wrap))
  18. style.set_property(CSS::PropertyID::WhiteSpace, CSS::IdentifierStyleValue::create(CSS::ValueID::PreWrap));
  19. });
  20. }
  21. }