Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: third_party/WebKit/Source/core/editing/Position.cpp

Issue 2875933004: Utilize Position::IsEquivalent() in {Up,Down}streamIgnoringEditingBoundaries() (Closed)
Patch Set: 2017-05-12T18:26:21 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 348
349 template <typename Strategy> 349 template <typename Strategy>
350 bool PositionTemplate<Strategy>::operator>=( 350 bool PositionTemplate<Strategy>::operator>=(
351 const PositionTemplate<Strategy>& other) const { 351 const PositionTemplate<Strategy>& other) const {
352 return ComparePositions(*this, other) >= 0; 352 return ComparePositions(*this, other) >= 0;
353 } 353 }
354 354
355 template <typename Strategy> 355 template <typename Strategy>
356 bool PositionTemplate<Strategy>::IsEquivalent( 356 bool PositionTemplate<Strategy>::IsEquivalent(
357 const PositionTemplate<Strategy>& other) const { 357 const PositionTemplate<Strategy>& other) const {
358 if (IsNull())
Xiaocheng 2017/05/12 18:00:05 This should go to the previous patch.
yoichio 2017/05/15 01:41:53 I oppose this change from the math sense. For exam
yosin_UTC9 2017/05/15 05:12:57 Oops, I missed rebasing.
359 return other.IsNull();
358 if (anchor_type_ == other.anchor_type_) 360 if (anchor_type_ == other.anchor_type_)
359 return *this == other; 361 return *this == other;
360 return ToOffsetInAnchor() == other.ToOffsetInAnchor(); 362 return ToOffsetInAnchor() == other.ToOffsetInAnchor();
361 } 363 }
362 364
363 template <typename Strategy> 365 template <typename Strategy>
364 bool PositionTemplate<Strategy>::AtFirstEditingPositionForNode() const { 366 bool PositionTemplate<Strategy>::AtFirstEditingPositionForNode() const {
365 if (IsNull()) 367 if (IsNull())
366 return true; 368 return true;
367 // FIXME: Position before anchor shouldn't be considered as at the first 369 // FIXME: Position before anchor shouldn't be considered as at the first
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 } 704 }
703 705
704 void showTree(const blink::Position* pos) { 706 void showTree(const blink::Position* pos) {
705 if (pos) 707 if (pos)
706 pos->ShowTreeForThis(); 708 pos->ShowTreeForThis();
707 else 709 else
708 LOG(INFO) << "Cannot showTree for <null>"; 710 LOG(INFO) << "Cannot showTree for <null>";
709 } 711 }
710 712
711 #endif 713 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698