mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
Presenter: Don't give a style value if there are no styles
This commit is contained in:
parent
fcda397136
commit
244ea0fa9c
Notes:
sideshowbarker
2024-07-16 22:33:51 +09:00
Author: https://github.com/lanmonster Commit: https://github.com/SerenityOS/serenity/commit/244ea0fa9c Pull-request: https://github.com/SerenityOS/serenity/pull/17957
|
@ -145,12 +145,15 @@ ErrorOr<void> HTMLElement::serialize(StringBuilder& builder) const
|
|||
// FIXME: Escape the value string as necessary.
|
||||
TRY(builder.try_appendff(" {}='{}'", key, value));
|
||||
}
|
||||
TRY(builder.try_append(" style=\""sv));
|
||||
for (auto const& [key, value] : style) {
|
||||
// FIXME: Escape the value string as necessary.
|
||||
TRY(builder.try_appendff(" {}: {};", key, value));
|
||||
if (!style.is_empty()) {
|
||||
TRY(builder.try_append(" style=\""sv));
|
||||
for (auto const& [key, value] : style) {
|
||||
// FIXME: Escape the value string as necessary.
|
||||
TRY(builder.try_appendff(" {}: {};", key, value));
|
||||
}
|
||||
TRY(builder.try_append("\""sv));
|
||||
}
|
||||
TRY(builder.try_append("\">"sv));
|
||||
TRY(builder.try_append(">"sv));
|
||||
if (!inner_text.is_empty())
|
||||
TRY(builder.try_append(inner_text));
|
||||
for (auto const& child : children) {
|
||||
|
|
Loading…
Reference in a new issue