You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug:
Not sure why search bar from google.com and textarea doesn't have this bug.
But I found text input might crash in a subtle manner.
The caret is missing even after pressing a few times of right arrow.
To Reproduce:
Create a html file with following code and run with servoshell:
Did some initial digging, a lot of things are in play here:
In this example, the xxxxxxxxxxxxxxxxxxxx is a two glyph run text fragment which isn't properly covered by current implementation. (Where is it when I needed it the most)
This text is composed by a glyph run with length of 3 and another with a length of 20.
So seems like the zero width space is introduced to to "forces the text input to have an inline formatting context that might otherwise be trimmed if there's no text", I guess if we're to fix this issue we'll have to deal with this.
And therefore this issue actually has nothing to do with CJK character.
Not sure why search bar from google.com and textarea doesn't have this bug.
Also to add to this, turns out search bar from google.com is actually a text area, I've been using it to test for <input> for so long turns out my whole life is a lie.
Activity
dklassic commentedon Apr 10, 2025
Did some initial digging, a lot of things are in play here:
xxxxxxxxxxxxxxxxxxxxis a two glyph run text fragment which isn't properly covered by current implementation. (Where is it when I needed it the most)I'll have to dig deeper later and see if I can come up with a fix.
Edit:
okay so apparently a
ZERO WIDTH SPACEunicode character is what causes the 3 byte shift in this case..... I have no idea where it came from.dklassic commentedon Apr 11, 2025
servo/components/layout_2020/dom_traversal.rs
Lines 212 to 226 in 3c5da65
So seems like the zero width space is introduced to to "forces the text input to have an inline formatting context that might otherwise be trimmed if there's no text", I guess if we're to fix this issue we'll have to deal with this.
And therefore this issue actually has nothing to do with CJK character.
[-]Type CJK character in text input could crash[/-][+]Multi glyph runs in text input could crash[/+]dklassic commentedon Apr 11, 2025
Also to add to this, turns out search bar from google.com is actually a text area, I've been using it to test for
<input>for so long turns out my whole life is a lie.fix: Crashing due to input element hack (#36461)