Closed Bug 680701 Opened 15 years ago Closed 15 years ago

execCommand text style incorrectly applied to divisible element

Categories

(Core :: DOM: Editor, defect)

5 Branch
x86_64
Windows Server 2003
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 676966

People

(Reporter: jab_creations, Unassigned)

Details

I selected all the text in a rich-text editor and then used the following on a rich text editor... <input onclick="document.execCommand('bold',false,null);" value="Strong" /> What happened? Gecko incorrectly applied the style to the divisible element. Basic example... <div style=""><p><span>example text</span></p></div> What should have happened? Gecko should have applied the style to elements specific to text. Basic example... <div><p><span style="">example text</span></p></div> Why? The divisible element is discarded in the parser as it's merely the container for the generated XML that is sent to the server to be validated and parsed. I avoid generating divisible elements in user-generated content as I use them exclusively for page-layout and never for text-formatting. I have not observed this behavior in Presto, Trident or WebKit based browsers after extensive testing. The user's styling in this situation will be lost.
Component: DOM → Editor
QA Contact: general → editor
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.