servo/components/layout_2020/flow
DK Liao 5df4c760d3
fix: Crashing due to input element hack (#36461)
This PR addresses a crash in text input element due to a hack to prevent
text input being trimmed.

The updated behavior will only add `zero width space` unicode character
to the node if there's no text content instead of adding it constantly.
Also by adding the same `zero width space` unicode character to text
area when there's no text content within will allow text area element to
properly display caret.

<img width="197" alt="截圖 2025-04-11 中午12 51 00"
src="https://github.com/user-attachments/assets/10bc7314-9aa3-49df-baac-ef26d39a96d8"
/>

This PR also addresses issues with multiple glyph runs:


https://github.com/user-attachments/assets/658db56f-b166-47ec-bc77-c6c13114d669

Testing: This PR is tested using:
- `./mach run -d 'data:text/html,<input id="input_element"
value="xxxxxxxxxxxxxxxxxxxx">'`
- `./mach run -d 'data:text/html,<textarea id="input_element"
value="xxxxxxxxxxxxxxxxxxxx">'`

without causing crashes, while the results should be covered by WPT
tests

Fixes: https://github.com/servo/servo/issues/36449

---------

Signed-off-by: DK Liao <dklassic@gmail.com>
2025-04-11 06:51:52 +00:00
..
inline fix: Crashing due to input element hack (#36461) 2025-04-11 06:51:52 +00:00
construct.rs layout: Add initial support for the ::marker pseudo-element (#36317) 2025-04-07 17:49:05 +00:00
float.rs Update rustfmt to the 2024 style edition (#35764) 2025-03-03 11:26:53 +00:00
mod.rs refactor: use is_zero() instead of comparing with Au::Zero() (#36347) 2025-04-09 22:57:55 +00:00
root.rs layout: Enable using cached fragments when there is a BoxTree update point (#36404) 2025-04-09 13:32:07 +00:00