Having these here does no harm and they're quite useful for comparing VisiblePositions. I need them for https://bugs.webkit.org/show_bug.cgi?id=119829
<rdar://problem/14797554>
Created attachment 209410 [details] patch
Comment on attachment 209410 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=209410&action=review > Source/WebCore/dom/Position.h:243 > +inline bool operator<(const Position& a, const Position& b) > +{ > + return a.anchorNode() == b.anchorNode() && a.deprecatedEditingOffset() < b.deprecatedEditingOffset() && a.anchorType() == b.anchorType(); > +} I don't think this comparison operator makes sense. Just because nodes aren't same doesn't mean they aren't comparable. If anything, we should be calling comparePositions instead. r-.
(In reply to comment #3) > (From update of attachment 209410 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=209410&action=review > > > Source/WebCore/dom/Position.h:243 > > +inline bool operator<(const Position& a, const Position& b) > > +{ > > + return a.anchorNode() == b.anchorNode() && a.deprecatedEditingOffset() < b.deprecatedEditingOffset() && a.anchorType() == b.anchorType(); > > +} > > I don't think this comparison operator makes sense. Just because nodes aren't same doesn't mean they aren't comparable. > > If anything, we should be calling comparePositions instead. r-. didn't realize that method existed...will use that instead.