OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All |
3 * rights reserved. | 3 * rights reserved. |
4 * Copyright (C) 2005 Alexey Proskuryakov. | 4 * Copyright (C) 2005 Alexey Proskuryakov. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 return false; | 730 return false; |
731 | 731 |
732 // The startPos.isNotNull() check is needed because the start could be before | 732 // The startPos.isNotNull() check is needed because the start could be before |
733 // the body, and in that case we'll get null. We don't want to put in newlines | 733 // the body, and in that case we'll get null. We don't want to put in newlines |
734 // at the start in that case. | 734 // at the start in that case. |
735 // The currPos.isNotNull() check is needed because positions in non-HTML | 735 // The currPos.isNotNull() check is needed because positions in non-HTML |
736 // content (like SVG) do not have visible positions, and we don't want to emit | 736 // content (like SVG) do not have visible positions, and we don't want to emit |
737 // for them either. | 737 // for them either. |
738 VisiblePosition start_pos = | 738 VisiblePosition start_pos = |
739 CreateVisiblePosition(Position(start_container_, start_offset_)); | 739 CreateVisiblePosition(Position(start_container_, start_offset_)); |
740 VisiblePosition curr_pos = VisiblePosition::BeforeNode(node_); | 740 VisiblePosition curr_pos = VisiblePosition::BeforeNode(*node_); |
741 return start_pos.IsNotNull() && curr_pos.IsNotNull() && | 741 return start_pos.IsNotNull() && curr_pos.IsNotNull() && |
742 !InSameLine(start_pos, curr_pos); | 742 !InSameLine(start_pos, curr_pos); |
743 } | 743 } |
744 | 744 |
745 template <typename Strategy> | 745 template <typename Strategy> |
746 bool TextIteratorAlgorithm<Strategy>::ShouldEmitSpaceBeforeAndAfterNode( | 746 bool TextIteratorAlgorithm<Strategy>::ShouldEmitSpaceBeforeAndAfterNode( |
747 Node* node) { | 747 Node* node) { |
748 return IsRenderedAsTable(node) && | 748 return IsRenderedAsTable(node) && |
749 (node->GetLayoutObject()->IsInline() || | 749 (node->GetLayoutObject()->IsInline() || |
750 EmitsCharactersBetweenAllVisiblePositions()); | 750 EmitsCharactersBetweenAllVisiblePositions()); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 String PlainText(const EphemeralRangeInFlatTree& range, | 1017 String PlainText(const EphemeralRangeInFlatTree& range, |
1018 const TextIteratorBehavior& behavior) { | 1018 const TextIteratorBehavior& behavior) { |
1019 return CreatePlainText<EditingInFlatTreeStrategy>(range, behavior); | 1019 return CreatePlainText<EditingInFlatTreeStrategy>(range, behavior); |
1020 } | 1020 } |
1021 | 1021 |
1022 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>; | 1022 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>; |
1023 template class CORE_TEMPLATE_EXPORT | 1023 template class CORE_TEMPLATE_EXPORT |
1024 TextIteratorAlgorithm<EditingInFlatTreeStrategy>; | 1024 TextIteratorAlgorithm<EditingInFlatTreeStrategy>; |
1025 | 1025 |
1026 } // namespace blink | 1026 } // namespace blink |
OLD | NEW |