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

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

Issue 2293703002: Refactor Node::showTree*() functions. (Closed)
Patch Set: Created 4 years, 3 months 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, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple 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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 break; 623 break;
624 } 624 }
625 fprintf(stderr, ", offset:%d\n", m_offset); 625 fprintf(stderr, ", offset:%d\n", m_offset);
626 } 626 }
627 627
628 template <typename Strategy> 628 template <typename Strategy>
629 void PositionTemplate<Strategy>::showTreeForThis() const 629 void PositionTemplate<Strategy>::showTreeForThis() const
630 { 630 {
631 if (!anchorNode()) 631 if (!anchorNode())
632 return; 632 return;
633 anchorNode()->showTreeForThis(); 633 // TODO(tkent): Replace WTFLogAlways with something else.
634 WTFLogAlways("%s", anchorNode()->toTreeStringForThis().utf8().data());
634 showAnchorTypeAndOffset(); 635 showAnchorTypeAndOffset();
635 } 636 }
636 637
637 template <typename Strategy> 638 template <typename Strategy>
638 void PositionTemplate<Strategy>::showTreeForThisInFlatTree() const 639 void PositionTemplate<Strategy>::showTreeForThisInFlatTree() const
639 { 640 {
640 if (!anchorNode()) 641 if (!anchorNode())
641 return; 642 return;
642 anchorNode()->showTreeForThisInFlatTree(); 643 // TODO(tkent): Replace WTFLogAlways with something else.
644 WTFLogAlways("%s", anchorNode()->toFlatTreeStringForThis().utf8().data());
643 showAnchorTypeAndOffset(); 645 showAnchorTypeAndOffset();
644 } 646 }
645 647
646 #endif 648 #endif
647 649
648 template <typename PositionType> 650 template <typename PositionType>
649 static std::ostream& printPosition(std::ostream& ostream, const PositionType& po sition) 651 static std::ostream& printPosition(std::ostream& ostream, const PositionType& po sition)
650 { 652 {
651 if (position.isNull()) 653 if (position.isNull())
652 return ostream << "null"; 654 return ostream << "null";
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 700
699 void showTree(const blink::Position* pos) 701 void showTree(const blink::Position* pos)
700 { 702 {
701 if (pos) 703 if (pos)
702 pos->showTreeForThis(); 704 pos->showTreeForThis();
703 else 705 else
704 fprintf(stderr, "Cannot showTree for (nil)\n"); 706 fprintf(stderr, "Cannot showTree for (nil)\n");
705 } 707 }
706 708
707 #endif 709 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Range.cpp ('k') | third_party/WebKit/Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698