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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 } | 799 } |
800 | 800 |
801 fprintf(stderr, "isDirectional=%s\n", isDirectional() ? "true" : "false"); | 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"); | 802 fprintf(stderr, "affinity=%s\n", affinity() == TextAffinity::Downstream ? "D
OWNSTREaM" : affinity() == TextAffinity::Upstream ? "UPSTREAM" : "UNKNOWN"); |
803 fprintf(stderr, "================================\n"); | 803 fprintf(stderr, "================================\n"); |
804 } | 804 } |
805 | 805 |
806 template <typename Strategy> | 806 template <typename Strategy> |
807 void VisibleSelectionTemplate<Strategy>::showTreeForThis() const | 807 void VisibleSelectionTemplate<Strategy>::showTreeForThis() const |
808 { | 808 { |
809 if (start().anchorNode()) { | 809 if (!start().anchorNode()) |
810 // TODO(tkent): Replace WTFLogAlways with something else. | 810 return; |
811 WTFLogAlways("%s", start().anchorNode()->toMarkedTreeString(start().anch
orNode(), "S", end().anchorNode(), "E").utf8().data()); | 811 LOG(INFO) << "\n" |
812 fputs("start: ", stderr); | 812 << start().anchorNode()->toMarkedTreeString(start().anchorNode(), "S", e
nd().anchorNode(), "E").utf8().data() |
813 start().showAnchorTypeAndOffset(); | 813 << "start: " << start().toAnchorTypeAndOffsetString().utf8().data() << "
\n" |
814 fputs("end: ", stderr); | 814 << "end: " << end().toAnchorTypeAndOffsetString().utf8().data(); |
815 end().showAnchorTypeAndOffset(); | |
816 } | |
817 } | 815 } |
818 | 816 |
819 #endif | 817 #endif |
820 | 818 |
821 template <typename Strategy> | 819 template <typename Strategy> |
822 void VisibleSelectionTemplate<Strategy>::PrintTo( | 820 void VisibleSelectionTemplate<Strategy>::PrintTo( |
823 const VisibleSelectionTemplate<Strategy>& selection, | 821 const VisibleSelectionTemplate<Strategy>& selection, |
824 std::ostream* ostream) | 822 std::ostream* ostream) |
825 { | 823 { |
826 if (selection.isNone()) { | 824 if (selection.isNone()) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 { | 868 { |
871 sel.showTreeForThis(); | 869 sel.showTreeForThis(); |
872 } | 870 } |
873 | 871 |
874 void showTree(const blink::VisibleSelectionInFlatTree* sel) | 872 void showTree(const blink::VisibleSelectionInFlatTree* sel) |
875 { | 873 { |
876 if (sel) | 874 if (sel) |
877 sel->showTreeForThis(); | 875 sel->showTreeForThis(); |
878 } | 876 } |
879 #endif | 877 #endif |
OLD | NEW |