Bug 51006 - Range::processContents needs cleanup
Summary: Range::processContents needs cleanup
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Enhancement
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on: 51005 54282 54425
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-13 21:11 PST by Ryosuke Niwa
Modified: 2011-02-28 05:24 PST (History)
10 users (show)

See Also:


Attachments
Patch (12.85 KB, patch)
2011-02-16 23:38 PST, Ryosuke Niwa
no flags 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-12-13 21:11:10 PST
Range::processContents is one giant function that implements multiple features for Range.  We should split up this function into smaller pieces.
Comment 1 Ryosuke Niwa 2011-01-03 20:47:54 PST
I'm seeing some similarities between processContents and StyledMarkupAccumulator::serializeNodes but I'm not sure how we can share code.
Comment 2 Ryosuke Niwa 2011-02-16 23:38:23 PST
Created attachment 82761 [details]
Patch
Comment 3 Ryosuke Niwa 2011-02-23 21:24:10 PST
Could someone review my patch?
Comment 4 Kent Tamura 2011-02-28 00:48:54 PST
Comment on attachment 82761 [details]
Patch

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

> Source/WebCore/dom/Range.cpp:630
> +    // This switch statement must be consistent with that of Range::processContentsBetweenOffsets.

So, we had better add a comment to Range::processContentBetweenoffsets().

> Source/WebCore/dom/Range.cpp:760
> +    // This switch statement must be consistent with that of lengthOfContentsInNode.

ditto.
Comment 5 Kent Tamura 2011-02-28 00:49:50 PST
(In reply to comment #4)
> (From update of attachment 82761 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=82761&action=review
> 
> > Source/WebCore/dom/Range.cpp:630
> > +    // This switch statement must be consistent with that of Range::processContentsBetweenOffsets.
> 
> So, we had better add a comment to Range::processContentBetweenoffsets().
> 
> > Source/WebCore/dom/Range.cpp:760
> > +    // This switch statement must be consistent with that of lengthOfContentsInNode.
> 
> ditto.

Oh, I was confused.  Ignore comments :-)
Comment 6 Ryosuke Niwa 2011-02-28 00:50:58 PST
Comment on attachment 82761 [details]
Patch

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

>> Source/WebCore/dom/Range.cpp:630
>> +    // This switch statement must be consistent with that of Range::processContentsBetweenOffsets.
> 
> So, we had better add a comment to Range::processContentBetweenoffsets().

I have.

>> Source/WebCore/dom/Range.cpp:760
>> +    // This switch statement must be consistent with that of lengthOfContentsInNode.
> 
> ditto.

This comment is added in processContentsBetweenOffsets, and refers back to lengthOfContentsInNode.
Comment 7 Ryosuke Niwa 2011-02-28 00:51:01 PST
Comment on attachment 82761 [details]
Patch

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

>> Source/WebCore/dom/Range.cpp:630
>> +    // This switch statement must be consistent with that of Range::processContentsBetweenOffsets.
> 
> So, we had better add a comment to Range::processContentBetweenoffsets().

I have.

>> Source/WebCore/dom/Range.cpp:760
>> +    // This switch statement must be consistent with that of lengthOfContentsInNode.
> 
> ditto.

This comment is added in processContentsBetweenOffsets, and refers back to lengthOfContentsInNode.
Comment 8 Ryosuke Niwa 2011-02-28 00:52:52 PST
(In reply to comment #5)
> (In reply to comment #4)
> > (From update of attachment 82761 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=82761&action=review
> > 
> > > Source/WebCore/dom/Range.cpp:630
> > > +    // This switch statement must be consistent with that of Range::processContentsBetweenOffsets.
> > 
> > So, we had better add a comment to Range::processContentBetweenoffsets().
> > 
> > > Source/WebCore/dom/Range.cpp:760
> > > +    // This switch statement must be consistent with that of lengthOfContentsInNode.
> > 
> > ditto.
> 
> Oh, I was confused.  Ignore comments :-)

Ah, ok.  Thanks for the review anyways :)
Comment 9 WebKit Commit Bot 2011-02-28 05:24:42 PST
Comment on attachment 82761 [details]
Patch

Clearing flags on attachment: 82761

Committed r79854: <http://trac.webkit.org/changeset/79854>
Comment 10 WebKit Commit Bot 2011-02-28 05:24:48 PST
All reviewed patches have been landed.  Closing bug.