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

Side by Side Diff: third_party/WebKit/Source/core/editing/VisibleSelection.cpp

Issue 2533693002: [Editing] Add SelectionTemplate::showTreeForThis() (Closed)
Patch Set: Created 4 years 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
OLDNEW
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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 selectionWrapper1.extent() == selectionWrapper2.extent(); 770 selectionWrapper1.extent() == selectionWrapper2.extent();
771 } 771 }
772 772
773 template <typename Strategy> 773 template <typename Strategy>
774 bool VisibleSelectionTemplate<Strategy>::operator==( 774 bool VisibleSelectionTemplate<Strategy>::operator==(
775 const VisibleSelectionTemplate<Strategy>& other) const { 775 const VisibleSelectionTemplate<Strategy>& other) const {
776 return equalSelectionsAlgorithm<Strategy>(*this, other); 776 return equalSelectionsAlgorithm<Strategy>(*this, other);
777 } 777 }
778 778
779 #ifndef NDEBUG 779 #ifndef NDEBUG
780 template <typename Strategy>
781 void VisibleSelectionTemplate<Strategy>::showTreeForStartAndEnd(
782 const PositionTemplate<Strategy>& start,
783 const PositionTemplate<Strategy>& end) {
784 if (!start.anchorNode())
785 return;
786 LOG(INFO) << "\n"
787 << start.anchorNode()
788 ->toMarkedTreeString(start.anchorNode(), "S",
789 end.anchorNode(), "E")
790 .utf8()
791 .data()
792 << "start: " << start.toAnchorTypeAndOffsetString().utf8().data()
793 << "\n"
794 << "end: " << end.toAnchorTypeAndOffsetString().utf8().data();
795 }
780 796
781 template <typename Strategy> 797 template <typename Strategy>
782 void VisibleSelectionTemplate<Strategy>::showTreeForThis() const { 798 void VisibleSelectionTemplate<Strategy>::showTreeForThis() const {
783 if (!start().anchorNode()) 799 VisibleSelectionTemplate<Strategy>::showTreeForStartAndEnd(start(), end());
784 return;
785 LOG(INFO) << "\n"
786 << start()
787 .anchorNode()
788 ->toMarkedTreeString(start().anchorNode(), "S",
789 end().anchorNode(), "E")
790 .utf8()
791 .data()
792 << "start: " << start().toAnchorTypeAndOffsetString().utf8().data()
793 << "\n"
794 << "end: " << end().toAnchorTypeAndOffsetString().utf8().data();
795 } 800 }
796
797 #endif 801 #endif
798 802
799 template <typename Strategy> 803 template <typename Strategy>
800 void VisibleSelectionTemplate<Strategy>::PrintTo( 804 void VisibleSelectionTemplate<Strategy>::PrintTo(
801 const VisibleSelectionTemplate<Strategy>& selection, 805 const VisibleSelectionTemplate<Strategy>& selection,
802 std::ostream* ostream) { 806 std::ostream* ostream) {
803 if (selection.isNone()) { 807 if (selection.isNone()) {
804 *ostream << "VisibleSelection()"; 808 *ostream << "VisibleSelection()";
805 return; 809 return;
806 } 810 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 847
844 void showTree(const blink::VisibleSelectionInFlatTree& sel) { 848 void showTree(const blink::VisibleSelectionInFlatTree& sel) {
845 sel.showTreeForThis(); 849 sel.showTreeForThis();
846 } 850 }
847 851
848 void showTree(const blink::VisibleSelectionInFlatTree* sel) { 852 void showTree(const blink::VisibleSelectionInFlatTree* sel) {
849 if (sel) 853 if (sel)
850 sel->showTreeForThis(); 854 sel->showTreeForThis();
851 } 855 }
852 #endif 856 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698