Bug 61822 - Running execCommand with "Bold" twice does not remove <b> elements if selection spans block elements with a whitespace text node in between
Summary: Running execCommand with "Bold" twice does not remove <b> elements if selecti...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-31 17:13 PDT by Tim Down
Modified: 2011-06-04 03:38 PDT (History)
1 user (show)

See Also:


Attachments
Test case (1.24 KB, text/html)
2011-05-31 17:13 PDT, Tim Down
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Down 2011-05-31 17:13:39 PDT
Created attachment 95515 [details]
Test case

Running document.execCommand("Bold", false, null) on the following selected HTML

<p>1</p>
<p>2</p>

... mutates that HTML into

<p><b>1</b></p>
<p><b>2</b></p>

Running the same command has no effect. However, running the same command on

<p>1</p><p>2</p>

... mutates that HTML into

<p><b>1</b></p><p><b>2</b></p>

... and running the command again returns the HTML to its original state. This suggest one possible cause is that the code mutating the HTML is ignoring the whitespace text node while the code for checking whether the selection is already bold is not ignoring the whitespace text node.
Comment 1 Ryosuke Niwa 2011-06-03 21:25:19 PDT
All three test cases work properly on WebKit ToT.  Can you tell us which revision of WebKit reproduces this bug?
Comment 2 Tim Down 2011-06-04 03:38:42 PDT
Chrome 11.0.696.68. However, it's fixed in the latest nightly build. Sorry.