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

Side by Side Diff: Source/core/editing/VisiblePosition.cpp

Issue 23467007: Have Range constructor take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 PassRefPtr<Range> makeRange(const VisiblePosition &start, const VisiblePosition &end) 673 PassRefPtr<Range> makeRange(const VisiblePosition &start, const VisiblePosition &end)
674 { 674 {
675 if (start.isNull() || end.isNull()) 675 if (start.isNull() || end.isNull())
676 return 0; 676 return 0;
677 677
678 Position s = start.deepEquivalent().parentAnchoredEquivalent(); 678 Position s = start.deepEquivalent().parentAnchoredEquivalent();
679 Position e = end.deepEquivalent().parentAnchoredEquivalent(); 679 Position e = end.deepEquivalent().parentAnchoredEquivalent();
680 if (s.isNull() || e.isNull()) 680 if (s.isNull() || e.isNull())
681 return 0; 681 return 0;
682 682
683 return Range::create(&s.containerNode()->document(), s.containerNode(), s.of fsetInContainerNode(), e.containerNode(), e.offsetInContainerNode()); 683 return Range::create(s.containerNode()->document(), s.containerNode(), s.off setInContainerNode(), e.containerNode(), e.offsetInContainerNode());
684 } 684 }
685 685
686 VisiblePosition startVisiblePosition(const Range *r, EAffinity affinity) 686 VisiblePosition startVisiblePosition(const Range *r, EAffinity affinity)
687 { 687 {
688 return VisiblePosition(r->startPosition(), affinity); 688 return VisiblePosition(r->startPosition(), affinity);
689 } 689 }
690 690
691 VisiblePosition endVisiblePosition(const Range *r, EAffinity affinity) 691 VisiblePosition endVisiblePosition(const Range *r, EAffinity affinity)
692 { 692 {
693 return VisiblePosition(r->endPosition(), affinity); 693 return VisiblePosition(r->endPosition(), affinity);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 if (vpos) 754 if (vpos)
755 vpos->showTreeForThis(); 755 vpos->showTreeForThis();
756 } 756 }
757 757
758 void showTree(const WebCore::VisiblePosition& vpos) 758 void showTree(const WebCore::VisiblePosition& vpos)
759 { 759 {
760 vpos.showTreeForThis(); 760 vpos.showTreeForThis();
761 } 761 }
762 762
763 #endif 763 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698