mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb/CSS: Preserve whitespace and comments in custom properties
A couple of parts of this: - Store the source text for Declarations of custom properties. - Then save that in the UnresolvedStyleValue. - Serialize UnresolvedStyleValue using the saved source when available - that is, for custom properties but not for regular properties that include var() or attr().
This commit is contained in:
parent
f8995d37a2
commit
bf3e6daedb
Notes:
github-actions[bot]
2024-10-16 12:23:36 +00:00
Author: https://github.com/AtkinsSJ
Commit: bf3e6daedb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1795
4 changed files with 20 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org>
|
||||
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
|
@ -14,6 +14,9 @@ namespace Web::CSS {
|
|||
|
||||
String UnresolvedStyleValue::to_string() const
|
||||
{
|
||||
if (m_original_source_text.has_value())
|
||||
return *m_original_source_text;
|
||||
|
||||
StringBuilder builder;
|
||||
for (auto& value : m_values)
|
||||
builder.append(value.to_string());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue