mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-07 01:21:57 +00:00
LibWeb: Convert white-space
CSS property to shorthand
This exposed a few bugs which caused the following tests to behave incorrectly: - `tab-size-text-wrap.html`: This previously relied on a bug where we incorrectly treated `white-space: pre` as allowing text wrapping. The fix here is to implement the text-wrap CSS shorthand property. - `execCommand-preserveWhitespace.html`: We don't correctly serialize shorthand properties. This is covered by an existing FIXME in `CSSStyleProperties::serialized()` - `white-space-shorthand.html`: The last 5 subtests here fail as we don't correctly handle shorthand properties in `CSSStyleProperties::remove_property()`. This is covered by an existing FIXME in said function.
This commit is contained in:
parent
9d06c86fe4
commit
94f5a51820
Notes:
github-actions[bot]
2025-05-29 10:05:43 +00:00
Author: https://github.com/Calme1709
Commit: 94f5a51820
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4832
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/gmta ✅
28 changed files with 568 additions and 308 deletions
|
@ -41,8 +41,9 @@ void HTMLPreElement::apply_presentational_hints(GC::Ref<CSS::CascadedProperties>
|
|||
HTMLElement::apply_presentational_hints(cascaded_properties);
|
||||
|
||||
for_each_attribute([&](auto const& name, auto const&) {
|
||||
if (name.equals_ignoring_ascii_case(HTML::AttributeNames::wrap))
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::WhiteSpace, CSS::CSSKeywordValue::create(CSS::Keyword::PreWrap));
|
||||
if (name.equals_ignoring_ascii_case(HTML::AttributeNames::wrap)) {
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextWrapMode, CSS::CSSKeywordValue::create(CSS::Keyword::Wrap));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue