implicitlyStyledElementShouldBeRemovedWhenApplyingStyle returns true regardless of whether the existing tag is useful or not. This causes tags to disappear and causes DOM tree to change unexpectedly. Bolding "hello<b id="test">world</b>" results in <b>hello</b><span id="test"><b>world</b></span> and bolding "hello<b><i>world</i></b>" results in "<b>hello</b><i><b>world</b></i>" (notice the ordering of b and i changed.)
Created attachment 34355 [details] fixes the bug
This patch appears reasonable on its face but has been sitting in the review queue for a long time. Who should review this code (clearly not me)?
(In reply to comment #2) > This patch appears reasonable on its face but has been sitting in the review > queue for a long time. Who should review this code (clearly not me)? This patch would conflict. We need to submit new patch for this.
Created attachment 38971 [details] new patch
Unfortunately, this patch got larger because I had to modify one more function and rebaseline one more test to make it work.
Comment on attachment 38971 [details] new patch In general this looks good. CSSDecorationAddedByTag should be "cssDecorationAddedByTag" And here: 65 bool shouldRemoveTextDecorationTag(CSSStyleDeclaration* styleToApply, int CSSDecorationAddedByTag) const; You could have used locals to store "nextElement" instead of casting nextSibling twice. But it's also OK as is. LGTM.
Landed as http://trac.webkit.org/changeset/49414.