mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Map <pre wrap> presentational hint to CSS white-space:pre-wrap
This commit is contained in:
parent
de5de4d99a
commit
5d6c5571c4
Notes:
sideshowbarker
2024-07-17 11:50:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5d6c5571c4
2 changed files with 13 additions and 0 deletions
|
@ -15,4 +15,14 @@ HTMLPreElement::HTMLPreElement(DOM::Document& document, DOM::QualifiedName quali
|
|||
|
||||
HTMLPreElement::~HTMLPreElement() = default;
|
||||
|
||||
void HTMLPreElement::apply_presentational_hints(CSS::StyleProperties& style) const
|
||||
{
|
||||
HTMLElement::apply_presentational_hints(style);
|
||||
|
||||
for_each_attribute([&](auto const& name, auto const&) {
|
||||
if (name.equals_ignoring_case(HTML::AttributeNames::wrap))
|
||||
style.set_property(CSS::PropertyID::WhiteSpace, CSS::IdentifierStyleValue::create(CSS::ValueID::PreWrap));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,9 @@ public:
|
|||
|
||||
HTMLPreElement(DOM::Document&, DOM::QualifiedName);
|
||||
virtual ~HTMLPreElement() override;
|
||||
|
||||
private:
|
||||
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue