| OLD | NEW |
| 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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 m_deepPosition.showTreeForThis(); | 718 m_deepPosition.showTreeForThis(); |
| 719 } | 719 } |
| 720 | 720 |
| 721 #endif | 721 #endif |
| 722 | 722 |
| 723 PassRefPtrWillBeRawPtr<Range> makeRange(const VisiblePosition &start, const Visi
blePosition &end) | 723 PassRefPtrWillBeRawPtr<Range> makeRange(const VisiblePosition &start, const Visi
blePosition &end) |
| 724 { | 724 { |
| 725 if (start.isNull() || end.isNull()) | 725 if (start.isNull() || end.isNull()) |
| 726 return nullptr; | 726 return nullptr; |
| 727 | 727 |
| 728 Position s = start.deepEquivalent().parentAnchoredEquivalent(); | 728 return makeRange(start.deepEquivalent(), end.deepEquivalent()); |
| 729 Position e = end.deepEquivalent().parentAnchoredEquivalent(); | |
| 730 if (s.isNull() || e.isNull()) | |
| 731 return nullptr; | |
| 732 | |
| 733 return Range::create(s.containerNode()->document(), s.containerNode(), s.off
setInContainerNode(), e.containerNode(), e.offsetInContainerNode()); | |
| 734 } | 729 } |
| 735 | 730 |
| 736 VisiblePosition startVisiblePosition(const Range *r, EAffinity affinity) | 731 VisiblePosition startVisiblePosition(const Range *r, EAffinity affinity) |
| 737 { | 732 { |
| 738 return VisiblePosition(r->startPosition(), affinity); | 733 return VisiblePosition(r->startPosition(), affinity); |
| 739 } | 734 } |
| 740 | 735 |
| 741 bool setStart(Range *r, const VisiblePosition &visiblePosition) | 736 bool setStart(Range *r, const VisiblePosition &visiblePosition) |
| 742 { | 737 { |
| 743 if (!r) | 738 if (!r) |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 if (vpos) | 799 if (vpos) |
| 805 vpos->showTreeForThis(); | 800 vpos->showTreeForThis(); |
| 806 } | 801 } |
| 807 | 802 |
| 808 void showTree(const WebCore::VisiblePosition& vpos) | 803 void showTree(const WebCore::VisiblePosition& vpos) |
| 809 { | 804 { |
| 810 vpos.showTreeForThis(); | 805 vpos.showTreeForThis(); |
| 811 } | 806 } |
| 812 | 807 |
| 813 #endif | 808 #endif |
| OLD | NEW |