Bug 45616 - applyInlineStyleToNodeRange does not extend a run properly
Summary: applyInlineStyleToNodeRange does not extend a run properly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Blocker
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on: 45746
Blocks: 45568
  Show dependency treegraph
 
Reported: 2010-09-12 10:27 PDT by Ryosuke Niwa
Modified: 2010-09-14 13:29 PDT (History)
8 users (show)

See Also:


Attachments
fixes the bug (21.61 KB, patch)
2010-09-12 10:54 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
fixed per Tony's comment (21.75 KB, patch)
2010-09-13 14:24 PDT, Ryosuke Niwa
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2010-09-12 10:27:50 PDT
In the current implementation of applyInlineStyleToNodeRange, we do not start a run from a node that contains child nodes.
We also fail to remove redundant styled elements in a run.
Comment 1 Ryosuke Niwa 2010-09-12 10:54:02 PDT
Created attachment 67338 [details]
fixes the bug
Comment 2 Tony Chang 2010-09-13 11:59:09 PDT
Comment on attachment 67338 [details]
fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=67338&action=prettypatch

> WebCore/editing/ApplyStyleCommand.cpp:1170
> -        if (mode == RemoveAttributesAndElements)
> +        if (mode == RemoveIfNeeded)
>              removeNodePreservingChildren(element);
Should mode == RemoveAlways also cause us to removeNodePreservingChildren?
Comment 3 Ryosuke Niwa 2010-09-13 13:39:41 PDT
(In reply to comment #2)
> (From update of attachment 67338 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=67338&action=prettypatch
> 
> > WebCore/editing/ApplyStyleCommand.cpp:1170
> > -        if (mode == RemoveAttributesAndElements)
> > +        if (mode == RemoveIfNeeded)
> >              removeNodePreservingChildren(element);
> Should mode == RemoveAlways also cause us to removeNodePreservingChildren?

That's a very valid point.  Let me fix that.
Comment 4 Ryosuke Niwa 2010-09-13 14:24:42 PDT
Created attachment 67471 [details]
fixed per Tony's comment
Comment 5 Ryosuke Niwa 2010-09-14 00:12:13 PDT
Committed r67449: <http://trac.webkit.org/changeset/67449>
Comment 6 WebKit Review Bot 2010-09-14 01:01:41 PDT
http://trac.webkit.org/changeset/67449 might have broken Qt Linux Release minimal
The following changes are on the blame list:
http://trac.webkit.org/changeset/67449
http://trac.webkit.org/changeset/67450
http://trac.webkit.org/changeset/67451
Comment 7 Ryosuke Niwa 2010-09-14 07:39:12 PDT
http://trac.webkit.org/changeset/67459 rolled out this patch due the failure of /fast/events/event-input-contentEditable.html

Will rebaseline this patch and commit again.
Comment 8 Eric Seidel (no email) 2010-09-14 13:04:25 PDT
I can't tell who was to blame, I thought bug 45071 was what caused that test to regress?
Comment 9 Ryosuke Niwa 2010-09-14 13:29:15 PDT
Committed r67490: <http://trac.webkit.org/changeset/67490>