servo/components/layout/display_list
leo030303 93e5b672a7
layout: Fix bug where whitespace didn't have line decorations (#38007)
This PR fixes the issue where underlines weren't appearing on
whitespaces. This was due to whitespace being ignored in the `glyphs`
function of `components/layout/display_list/mod.rs` when the fragment
didn't have a selection. I added in a check to include the whitespace if
there's a selection or if there are any line decorations. I also renamed
the field from `ignore_whitespace` to `include_whitespace` to make it a
bit clearer since it was being reversed everywhere it was used anyway.

**Before:**
<img width="1235" height="169" alt="image"
src="https://github.com/user-attachments/assets/51d47781-355f-4915-8100-f3a7db81027f"
/>

**After:**
<img width="1235" height="169" alt="image"
src="https://github.com/user-attachments/assets/9b44fe77-d600-4080-9f3a-2c9b33924f51"
/>


Testing: `/css/css-text/white-space/pre-wrap-018.html` is now passing.
Also verified manually by running
`data:text/html;base64,PGRpdiBzdHlsZT0idGV4dC1kZWNvcmF0aW9uOiB1bmRlcmxpbmU7Ij5IZWxsbyBXb3JsZCE8L2Rpdj4=
`
Fixes: https://github.com/servo/servo/issues/33463

---------

Signed-off-by: Leo Ring <leoring03@gmail.com>
Signed-off-by: leo030303 <59373587+leo030303@users.noreply.github.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-07-13 13:34:51 +00:00
..
background.rs layout: Use the viewport size as the background-attachment: fixed positioning area (#37097) 2025-05-24 09:45:53 +00:00
clip.rs chore: Simplify tracing with servo_tracing macro (#36661) (#37497) 2025-06-18 16:18:04 +00:00
conversions.rs layout: Support wavy and double for text-decoration-line (#37079) 2025-05-22 17:42:50 +00:00
gradient.rs layout: Reverse vertical orientation of gradients using corner directions. (#37802) 2025-07-11 20:02:13 +00:00
mod.rs layout: Fix bug where whitespace didn't have line decorations (#38007) 2025-07-13 13:34:51 +00:00
stacking_context.rs layout: Unify scrollable overflow calculation and include position: absolute (#37475) 2025-06-16 11:30:31 +00:00