OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |