[webkit-reviews] review requested: [Bug 36741] Duplicate, slightly divergent implementation of Position[Iterator]::isCandidate() : [Attachment 51879] patch - consolidate implementations into PositionIterator::isCandidate()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 29 00:23:14 PDT 2010


Roland Steiner <rolandsteiner at chromium.org> has asked  for review:
Bug 36741: Duplicate, slightly divergent implementation of
Position[Iterator]::isCandidate()
https://bugs.webkit.org/show_bug.cgi?id=36741

Attachment 51879: patch - consolidate implementations into
PositionIterator::isCandidate()
https://bugs.webkit.org/attachment.cgi?id=51879&action=review

------- Additional Comments from Roland Steiner <rolandsteiner at chromium.org>
As stated in the ChangeLog, the rationale for using
PositionIterator::isCandidate() over Position::isCandidate() is that a
PositionIterator is cheaper to construct from a Position than vice versa (no
call to nodeIndex()). Also, PositionIterator::isCandidate is called in a tight
loop within next/previousCandidate (editing/htmlediting.cpp).

The code as is doesn't look very nice though, and I believe that
PositionIterator and Position should be merged at some point. But that is
another story, for another 1001 commits...


More information about the webkit-reviews mailing list