OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
3 * Copyright (C) 2005 Alexey Proskuryakov. | 3 * Copyright (C) 2005 Alexey Proskuryakov. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 // Additionally, if the range we are iterating over contains huge sections o
f unrendered content, | 869 // Additionally, if the range we are iterating over contains huge sections o
f unrendered content, |
870 // we would create VisiblePositions on every call to this function without t
his check. | 870 // we would create VisiblePositions on every call to this function without t
his check. |
871 if (!m_node->layoutObject() || m_node->layoutObject()->style()->visibility()
!= VISIBLE | 871 if (!m_node->layoutObject() || m_node->layoutObject()->style()->visibility()
!= VISIBLE |
872 || (m_node->layoutObject()->isLayoutBlockFlow() && !toLayoutBlock(m_node
->layoutObject())->size().height() && !isHTMLBodyElement(*m_node))) | 872 || (m_node->layoutObject()->isLayoutBlockFlow() && !toLayoutBlock(m_node
->layoutObject())->size().height() && !isHTMLBodyElement(*m_node))) |
873 return false; | 873 return false; |
874 | 874 |
875 // The startPos.isNotNull() check is needed because the start could be befor
e the body, | 875 // The startPos.isNotNull() check is needed because the start could be befor
e the body, |
876 // and in that case we'll get null. We don't want to put in newlines at the
start in that case. | 876 // and in that case we'll get null. We don't want to put in newlines at the
start in that case. |
877 // The currPos.isNotNull() check is needed because positions in non-HTML con
tent | 877 // The currPos.isNotNull() check is needed because positions in non-HTML con
tent |
878 // (like SVG) do not have visible positions, and we don't want to emit for t
hem either. | 878 // (like SVG) do not have visible positions, and we don't want to emit for t
hem either. |
879 VisiblePosition startPos = VisiblePosition(Position(m_startContainer, m_star
tOffset), DOWNSTREAM); | 879 VisiblePosition startPos = VisiblePosition(Position(m_startContainer, m_star
tOffset)); |
880 VisiblePosition currPos = VisiblePosition(positionBeforeNode(m_node), DOWNST
REAM); | 880 VisiblePosition currPos = VisiblePosition(positionBeforeNode(m_node)); |
881 return startPos.isNotNull() && currPos.isNotNull() && !inSameLine(startPos,
currPos); | 881 return startPos.isNotNull() && currPos.isNotNull() && !inSameLine(startPos,
currPos); |
882 } | 882 } |
883 | 883 |
884 template<typename Strategy> | 884 template<typename Strategy> |
885 bool TextIteratorAlgorithm<Strategy>::shouldEmitSpaceBeforeAndAfterNode(Node* no
de) | 885 bool TextIteratorAlgorithm<Strategy>::shouldEmitSpaceBeforeAndAfterNode(Node* no
de) |
886 { | 886 { |
887 return isRenderedTableElement(node) && (node->layoutObject()->isInline() ||
emitsCharactersBetweenAllVisiblePositions()); | 887 return isRenderedTableElement(node) && (node->layoutObject()->isInline() ||
emitsCharactersBetweenAllVisiblePositions()); |
888 } | 888 } |
889 | 889 |
890 template<typename Strategy> | 890 template<typename Strategy> |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 | 1113 |
1114 String plainText(const EphemeralRangeInComposedTree& range, TextIteratorBehavior
Flags behavior) | 1114 String plainText(const EphemeralRangeInComposedTree& range, TextIteratorBehavior
Flags behavior) |
1115 { | 1115 { |
1116 return createPlainText<EditingInComposedTreeStrategy>(range, behavior); | 1116 return createPlainText<EditingInComposedTreeStrategy>(range, behavior); |
1117 } | 1117 } |
1118 | 1118 |
1119 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>; | 1119 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>; |
1120 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS
trategy>; | 1120 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS
trategy>; |
1121 | 1121 |
1122 } // namespace blink | 1122 } // namespace blink |
OLD | NEW |