[Webkit-unassigned] [Bug 271820] New: Disabling both underline and strikethrough break the typed text
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 28 03:01:12 PDT 2024
https://bugs.webkit.org/show_bug.cgi?id=271820
Bug ID: 271820
Summary: Disabling both underline and strikethrough break the
typed text
Product: WebKit
Version: Safari 17
Hardware: All
OS: All
Status: NEW
Severity: Normal
Priority: P2
Component: HTML Editing
Assignee: webkit-unassigned at lists.webkit.org
Reporter: valentin.perignon at icloud.com
CC: wenson_hsieh at apple.com
Created attachment 470635
--> https://bugs.webkit.org/attachment.cgi?id=470635&action=review
Step 1 above - Step 2 below
The bug occurs on a contentEditable document when using `document.execCommand()`.
(Step 1) First we enable "underline" and "strikethrough", then type some text, it works as expected.
Then we disable both "underline" and "strikethrough".
(Step 2) When we type some text, the previous text that was underlined and crossed out looses its strikethrough property.
It is because, at the first step, the HTML looks like this:
```HTML
Coucou<u><strike>Tout</strike></u>
```
The word "Tout" is wrapped in two tags: u and strike.
But at the second step, the HTML looks like this:
```HTML
Coucou<strike style="text-decoration: underline;">Tout</strike>LeMonde
```
Juste the tag strike remains with a style attribute to apply the underline.
However, the `text-decoration: underline` override the webkit style `text-decoration-line: line-through`, so the text is just underlined.
You can refer to the attachment to see how it looks a the first and second steps.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240328/109dc35b/attachment.htm>
More information about the webkit-unassigned
mailing list