| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 | 775 |
| 776 template <typename Strategy> | 776 template <typename Strategy> |
| 777 bool VisibleSelectionTemplate<Strategy>::operator==(const VisibleSelectionTempla
te<Strategy>& other) const | 777 bool VisibleSelectionTemplate<Strategy>::operator==(const VisibleSelectionTempla
te<Strategy>& other) const |
| 778 { | 778 { |
| 779 return equalSelectionsAlgorithm<Strategy>(*this, other); | 779 return equalSelectionsAlgorithm<Strategy>(*this, other); |
| 780 } | 780 } |
| 781 | 781 |
| 782 #ifndef NDEBUG | 782 #ifndef NDEBUG |
| 783 | 783 |
| 784 template <typename Strategy> | 784 template <typename Strategy> |
| 785 void VisibleSelectionTemplate<Strategy>::debugPosition(const char* message) cons
t | |
| 786 { | |
| 787 fprintf(stderr, "VisibleSelection (%s) ===============\n", message); | |
| 788 | |
| 789 if (m_baseIsFirst) { | |
| 790 m_start.debugPosition("start: "); | |
| 791 m_base.debugPosition("base: "); | |
| 792 m_end.debugPosition("end: "); | |
| 793 m_extent.debugPosition("extent: "); | |
| 794 } else { | |
| 795 m_start.debugPosition("start: "); | |
| 796 m_extent.debugPosition("extent: "); | |
| 797 m_end.debugPosition("end: "); | |
| 798 m_base.debugPosition("base: "); | |
| 799 } | |
| 800 | |
| 801 fprintf(stderr, "isDirectional=%s\n", isDirectional() ? "true" : "false"); | |
| 802 fprintf(stderr, "affinity=%s\n", affinity() == TextAffinity::Downstream ? "D
OWNSTREaM" : affinity() == TextAffinity::Upstream ? "UPSTREAM" : "UNKNOWN"); | |
| 803 fprintf(stderr, "================================\n"); | |
| 804 } | |
| 805 | |
| 806 template <typename Strategy> | |
| 807 void VisibleSelectionTemplate<Strategy>::showTreeForThis() const | 785 void VisibleSelectionTemplate<Strategy>::showTreeForThis() const |
| 808 { | 786 { |
| 809 if (!start().anchorNode()) | 787 if (!start().anchorNode()) |
| 810 return; | 788 return; |
| 811 LOG(INFO) << "\n" | 789 LOG(INFO) << "\n" |
| 812 << start().anchorNode()->toMarkedTreeString(start().anchorNode(), "S", e
nd().anchorNode(), "E").utf8().data() | 790 << start().anchorNode()->toMarkedTreeString(start().anchorNode(), "S", e
nd().anchorNode(), "E").utf8().data() |
| 813 << "start: " << start().toAnchorTypeAndOffsetString().utf8().data() << "
\n" | 791 << "start: " << start().toAnchorTypeAndOffsetString().utf8().data() << "
\n" |
| 814 << "end: " << end().toAnchorTypeAndOffsetString().utf8().data(); | 792 << "end: " << end().toAnchorTypeAndOffsetString().utf8().data(); |
| 815 } | 793 } |
| 816 | 794 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 { | 846 { |
| 869 sel.showTreeForThis(); | 847 sel.showTreeForThis(); |
| 870 } | 848 } |
| 871 | 849 |
| 872 void showTree(const blink::VisibleSelectionInFlatTree* sel) | 850 void showTree(const blink::VisibleSelectionInFlatTree* sel) |
| 873 { | 851 { |
| 874 if (sel) | 852 if (sel) |
| 875 sel->showTreeForThis(); | 853 sel->showTreeForThis(); |
| 876 } | 854 } |
| 877 #endif | 855 #endif |
| OLD | NEW |