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

Side by Side Diff: Source/core/dom/Position.cpp

Issue 24253004: Cleanup: Start using toFoo methods as part of newly adopted coding guideline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
« no previous file with comments | « Source/core/dom/DocumentMarkerController.cpp ('k') | Source/core/dom/TouchEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 667
668 // The text continues on the next line only if the last text box is not on this line and 668 // The text continues on the next line only if the last text box is not on this line and
669 // none of the boxes on this line have a larger start offset. 669 // none of the boxes on this line have a larger start offset.
670 670
671 bool continuesOnNextLine = true; 671 bool continuesOnNextLine = true;
672 InlineBox* otherBox = box; 672 InlineBox* otherBox = box;
673 while (continuesOnNextLine) { 673 while (continuesOnNextLine) {
674 otherBox = otherBox->nextLeafChild(); 674 otherBox = otherBox->nextLeafChild();
675 if (!otherBox) 675 if (!otherBox)
676 break; 676 break;
677 if (otherBox == lastTextBox || (otherBox->renderer() == text Renderer && static_cast<InlineTextBox*>(otherBox)->start() > textOffset)) 677 if (otherBox == lastTextBox || (otherBox->renderer() == text Renderer && toInlineTextBox(otherBox)->start() > textOffset))
678 continuesOnNextLine = false; 678 continuesOnNextLine = false;
679 } 679 }
680 680
681 otherBox = box; 681 otherBox = box;
682 while (continuesOnNextLine) { 682 while (continuesOnNextLine) {
683 otherBox = otherBox->prevLeafChild(); 683 otherBox = otherBox->prevLeafChild();
684 if (!otherBox) 684 if (!otherBox)
685 break; 685 break;
686 if (otherBox == lastTextBox || (otherBox->renderer() == text Renderer && static_cast<InlineTextBox*>(otherBox)->start() > textOffset)) 686 if (otherBox == lastTextBox || (otherBox->renderer() == text Renderer && toInlineTextBox(otherBox)->start() > textOffset))
687 continuesOnNextLine = false; 687 continuesOnNextLine = false;
688 } 688 }
689 689
690 if (continuesOnNextLine) 690 if (continuesOnNextLine)
691 return currentPos; 691 return currentPos;
692 } 692 }
693 } 693 }
694 } 694 }
695 695
696 return lastVisible; 696 return lastVisible;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 791
792 // The text continues on the next line only if the last text box is not on this line and 792 // The text continues on the next line only if the last text box is not on this line and
793 // none of the boxes on this line have a larger start offset. 793 // none of the boxes on this line have a larger start offset.
794 794
795 bool continuesOnNextLine = true; 795 bool continuesOnNextLine = true;
796 InlineBox* otherBox = box; 796 InlineBox* otherBox = box;
797 while (continuesOnNextLine) { 797 while (continuesOnNextLine) {
798 otherBox = otherBox->nextLeafChild(); 798 otherBox = otherBox->nextLeafChild();
799 if (!otherBox) 799 if (!otherBox)
800 break; 800 break;
801 if (otherBox == lastTextBox || (otherBox->renderer() == text Renderer && static_cast<InlineTextBox*>(otherBox)->start() >= textOffset)) 801 if (otherBox == lastTextBox || (otherBox->renderer() == text Renderer && toInlineTextBox(otherBox)->start() >= textOffset))
802 continuesOnNextLine = false; 802 continuesOnNextLine = false;
803 } 803 }
804 804
805 otherBox = box; 805 otherBox = box;
806 while (continuesOnNextLine) { 806 while (continuesOnNextLine) {
807 otherBox = otherBox->prevLeafChild(); 807 otherBox = otherBox->prevLeafChild();
808 if (!otherBox) 808 if (!otherBox)
809 break; 809 break;
810 if (otherBox == lastTextBox || (otherBox->renderer() == text Renderer && static_cast<InlineTextBox*>(otherBox)->start() >= textOffset)) 810 if (otherBox == lastTextBox || (otherBox->renderer() == text Renderer && toInlineTextBox(otherBox)->start() >= textOffset))
811 continuesOnNextLine = false; 811 continuesOnNextLine = false;
812 } 812 }
813 813
814 if (continuesOnNextLine) 814 if (continuesOnNextLine)
815 return currentPos; 815 return currentPos;
816 } 816 }
817 } 817 }
818 } 818 }
819 819
820 return lastVisible; 820 return lastVisible;
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 pos.showTreeForThis(); 1384 pos.showTreeForThis();
1385 } 1385 }
1386 1386
1387 void showTree(const WebCore::Position* pos) 1387 void showTree(const WebCore::Position* pos)
1388 { 1388 {
1389 if (pos) 1389 if (pos)
1390 pos->showTreeForThis(); 1390 pos->showTreeForThis();
1391 } 1391 }
1392 1392
1393 #endif 1393 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentMarkerController.cpp ('k') | Source/core/dom/TouchEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698