| 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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 m_deepPosition.formatForDebugger(buffer, length); | 765 m_deepPosition.formatForDebugger(buffer, length); |
| 766 } | 766 } |
| 767 | 767 |
| 768 void VisiblePosition::showTreeForThis() const | 768 void VisiblePosition::showTreeForThis() const |
| 769 { | 769 { |
| 770 m_deepPosition.showTreeForThis(); | 770 m_deepPosition.showTreeForThis(); |
| 771 } | 771 } |
| 772 | 772 |
| 773 #endif | 773 #endif |
| 774 | 774 |
| 775 EphemeralRange makeRange(const VisiblePosition &start, const VisiblePosition &en
d) | |
| 776 { | |
| 777 if (start.isNull() || end.isNull()) | |
| 778 return EphemeralRange(); | |
| 779 | |
| 780 Position s = start.deepEquivalent().parentAnchoredEquivalent(); | |
| 781 Position e = end.deepEquivalent().parentAnchoredEquivalent(); | |
| 782 if (s.isNull() || e.isNull()) | |
| 783 return EphemeralRange(); | |
| 784 | |
| 785 return EphemeralRange(s, e); | |
| 786 } | |
| 787 | |
| 788 DEFINE_TRACE(VisiblePosition) | 775 DEFINE_TRACE(VisiblePosition) |
| 789 { | 776 { |
| 790 visitor->trace(m_deepPosition); | 777 visitor->trace(m_deepPosition); |
| 791 } | 778 } |
| 792 | 779 |
| 793 } // namespace blink | 780 } // namespace blink |
| 794 | 781 |
| 795 #ifndef NDEBUG | 782 #ifndef NDEBUG |
| 796 | 783 |
| 797 void showTree(const blink::VisiblePosition* vpos) | 784 void showTree(const blink::VisiblePosition* vpos) |
| 798 { | 785 { |
| 799 if (vpos) | 786 if (vpos) |
| 800 vpos->showTreeForThis(); | 787 vpos->showTreeForThis(); |
| 801 else | 788 else |
| 802 fprintf(stderr, "Cannot showTree for (nil) VisiblePosition.\n"); | 789 fprintf(stderr, "Cannot showTree for (nil) VisiblePosition.\n"); |
| 803 } | 790 } |
| 804 | 791 |
| 805 void showTree(const blink::VisiblePosition& vpos) | 792 void showTree(const blink::VisiblePosition& vpos) |
| 806 { | 793 { |
| 807 vpos.showTreeForThis(); | 794 vpos.showTreeForThis(); |
| 808 } | 795 } |
| 809 | 796 |
| 810 #endif | 797 #endif |
| OLD | NEW |