Bug 179922
| Summary: | Setting text with innerHTML on a node with fixed height does not clear out old text | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | mjstaffa |
| Component: | Text | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Major | CC: | ahmad.saleem792, arcangelo.vicedomini, mmaxfield, simon.fraser, zalan |
| Priority: | P2 | ||
| Version: | Safari 11 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
mjstaffa
If you use innerHTML = ... to replace the text in a DOM node, and
- the original text spans more than one line
- the DOM node has a fixed height
- the new text is shorter than the original text
the original text is not cleared out completely.
For example, if the original text is 4 lines and the new text is only 1 line,
3 lines of the original text remain.
Reproduced in Safari 11.
Apologies if this is a Safari issue - there's no way for me to test this.
See https://plnkr.co/edit/JodXz1tPTawVgoomctDL?p=preview
(Make sure the text on init spans more than one line. Then click the button).
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Myles C. Maxfield
You're right - this is a WebKit (repaint) issue.
Arcangelo Vicedomini
Hello, is there any updates on that bug?
It seems to have high priority but is untouched since 6 months ago
alan
(In reply to Arcangelo Vicedomini from comment #2)
> Hello, is there any updates on that bug?
> It seems to have high priority but is untouched since 6 months ago
I can't reproduce this issue with trunk. After clicking on the button, the old text is cleared properly. Do you mind checking with the latest build at https://webkit.org/build-archives/ to see if the repaint problem is still there?
Ahmad Saleem
I am unable to reproduce this bug in Safari 16.3 and it updates the text properly and don't have any lingering text issue.
Marking this as "RESOLVED CONFIGURATION CHANGED".