Summary: | Underline formatting bleeds into other formatting during delete/backspace | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Julie Parent <jparent> | ||||
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED DUPLICATE | ||||||
Severity: | Normal | CC: | eric, justin.garcia, rniwa, tony | ||||
Priority: | P3 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Julie Parent
2009-02-17 14:00:19 PST
*** Bug 23994 has been marked as a duplicate of this bug. *** Minor thing: in step 3 you write that the "html is ..." but it isn't in that state until after step 5. Also notice that pasting text that isn't underlined anywhere inside, just before or just after underlined content will incorrectly underline the pasted content. This is because the pasted content goes into an element with text-decoration: underline, and every descendant of such an element, no matter what, will be underlined. In the bold case, pasted content goes into a bold tag, but the pasted content is surrounded by a span with font-weight: normal, which negates the boldness. We need a function positionAvoidingTextDecoration or the like in ReplaceSelectionCommand to fix this. Created attachment 32692 [details]
demonstrates the bug: underline extends to the next line when adjoint lines are merged with deletion
I noticed that there is -webkit-text-decorations-in-effect property is added in the result. Does anyone know what this property is for? <span class="Apple-style-span" style="text-decoration: underline;">hello<span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; ">world</span></span> This is another bug with ReplaceSelectionCommand as Justin suggested, we need to adjust where we insert the fragment. Around the line 865, we have insertNodeAtAndUpdateNodesInserted(refNode, insertionPos); And refNode->showTreeForThis() results in: SPAN 0x1af7ee50 CLASS=Apple-style-span STYLE=border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; #text 0x1af7f170 "world" Is it even correct to have "-webkit-text-decoration: none" here? If so, when are you taking care of it? handleStyleSpans? Justin and I talked on IRC, and it's maybe sensible to delete all style-spans and reapply ApplyStyleCommand because we need to push down text decoration and other styles and apply them again. |