Bug 69023 - Remove direct reads to m_firstNodeInserted and m_lastLeafInserted in ReplaceSelectionCommand
Summary: Remove direct reads to m_firstNodeInserted and m_lastLeafInserted in ReplaceS...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 68874
  Show dependency treegraph
 
Reported: 2011-09-28 13:30 PDT by Ryosuke Niwa
Modified: 2011-09-29 13:30 PDT (History)
10 users (show)

See Also:


Attachments
Patch (23.39 KB, patch)
2011-09-28 13:42 PDT, 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 2011-09-28 13:30:57 PDT
To resolve the bug 68874, we need to encapsulate all access to m_firstNodeInserted and m_lastLeafInserted except updates.
Comment 1 Ryosuke Niwa 2011-09-28 13:42:18 PDT
Created attachment 109066 [details]
Patch
Comment 2 Ryosuke Niwa 2011-09-29 11:00:31 PDT
Any reviewers?
Comment 3 Enrica Casucci 2011-09-29 11:18:45 PDT
Comment on attachment 109066 [details]
Patch

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

Looks good to me.

> Source/WebCore/editing/ReplaceSelectionCommand.cpp:1226
> +        }

I know the original code was already like this, but it would be nice to have methods to update m_firstNodeInserted and m_lastLeafInserted in a consistent way. It is a bit unclear when reading this code that, in the case of the trailing space there is no explicit update of m_lastLeafInserted, but there is an explicit updated of m_firstNodeInserted in case of the leading space. Only reading the comment above helps you understand.
Comment 4 Ryosuke Niwa 2011-09-29 11:27:21 PDT
(In reply to comment #3)
> (From update of attachment 109066 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=109066&action=review
> 
> Looks good to me.
> 
> > Source/WebCore/editing/ReplaceSelectionCommand.cpp:1226
> > +        }
> 
> I know the original code was already like this, but it would be nice to have methods to update m_firstNodeInserted and m_lastLeafInserted in a consistent way. It is a bit unclear when reading this code that, in the case of the trailing space there is no explicit update of m_lastLeafInserted, but there is an explicit updated of m_firstNodeInserted in case of the leading space. Only reading the comment above helps you understand.

Right. The next patch should be able to eliminate all of that.
Comment 5 WebKit Review Bot 2011-09-29 13:30:49 PDT
Comment on attachment 109066 [details]
Patch

Clearing flags on attachment: 109066

Committed r96353: <http://trac.webkit.org/changeset/96353>
Comment 6 WebKit Review Bot 2011-09-29 13:30:53 PDT
All reviewed patches have been landed.  Closing bug.