mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 22:49:47 +00:00
AK+LibWeb: Add a UTF-16 starts/ends with wrapper for a single code unit
This commit is contained in:
parent
7082cafdbc
commit
1bc80848fb
Notes:
github-actions[bot]
2025-08-07 00:07:32 +00:00
Author: https://github.com/trflynn89
Commit: 1bc80848fb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5746
Reviewed-by: https://github.com/gmta ✅
8 changed files with 26 additions and 9 deletions
|
@ -498,7 +498,7 @@ void canonicalize_whitespace(DOM::BoundaryPoint boundary, bool fix_collapsed_spa
|
|||
// AD-HOC: Use the white-space-collapse longhand instead of "white-space" shorthand: https://github.com/w3c/editing/issues/486.
|
||||
if (is<DOM::Text>(*end_node) && end_offset == end_node->length() && precedes_a_line_break(end_node)) {
|
||||
auto parent_white_space_collapse = resolved_keyword(*end_node->parent(), CSS::PropertyID::WhiteSpaceCollapse);
|
||||
if (parent_white_space_collapse != CSS::Keyword::Preserve && end_node->text_content()->ends_with(" "sv)) {
|
||||
if (parent_white_space_collapse != CSS::Keyword::Preserve && end_node->text_content()->ends_with(' ')) {
|
||||
// 1. Subtract one from end offset.
|
||||
--end_offset;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue