| 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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 // Additionally, if the range we are iterating over contains huge sections o
f unrendered content, | 874 // Additionally, if the range we are iterating over contains huge sections o
f unrendered content, |
| 875 // we would create VisiblePositions on every call to this function without t
his check. | 875 // we would create VisiblePositions on every call to this function without t
his check. |
| 876 if (!m_node->layoutObject() || m_node->layoutObject()->style()->visibility()
!= VISIBLE | 876 if (!m_node->layoutObject() || m_node->layoutObject()->style()->visibility()
!= VISIBLE |
| 877 || (m_node->layoutObject()->isLayoutBlockFlow() && !toLayoutBlock(m_node
->layoutObject())->size().height() && !isHTMLBodyElement(*m_node))) | 877 || (m_node->layoutObject()->isLayoutBlockFlow() && !toLayoutBlock(m_node
->layoutObject())->size().height() && !isHTMLBodyElement(*m_node))) |
| 878 return false; | 878 return false; |
| 879 | 879 |
| 880 // The startPos.isNotNull() check is needed because the start could be befor
e the body, | 880 // The startPos.isNotNull() check is needed because the start could be befor
e the body, |
| 881 // and in that case we'll get null. We don't want to put in newlines at the
start in that case. | 881 // and in that case we'll get null. We don't want to put in newlines at the
start in that case. |
| 882 // The currPos.isNotNull() check is needed because positions in non-HTML con
tent | 882 // The currPos.isNotNull() check is needed because positions in non-HTML con
tent |
| 883 // (like SVG) do not have visible positions, and we don't want to emit for t
hem either. | 883 // (like SVG) do not have visible positions, and we don't want to emit for t
hem either. |
| 884 VisiblePosition startPos = VisiblePosition(Position(m_startContainer, m_star
tOffset)); | 884 VisiblePosition startPos = createVisiblePosition(Position(m_startContainer,
m_startOffset)); |
| 885 VisiblePosition currPos = VisiblePosition(positionBeforeNode(m_node)); | 885 VisiblePosition currPos = createVisiblePosition(positionBeforeNode(m_node)); |
| 886 return startPos.isNotNull() && currPos.isNotNull() && !inSameLine(startPos,
currPos); | 886 return startPos.isNotNull() && currPos.isNotNull() && !inSameLine(startPos,
currPos); |
| 887 } | 887 } |
| 888 | 888 |
| 889 template<typename Strategy> | 889 template<typename Strategy> |
| 890 bool TextIteratorAlgorithm<Strategy>::shouldEmitSpaceBeforeAndAfterNode(Node* no
de) | 890 bool TextIteratorAlgorithm<Strategy>::shouldEmitSpaceBeforeAndAfterNode(Node* no
de) |
| 891 { | 891 { |
| 892 return isRenderedTableElement(node) && (node->layoutObject()->isInline() ||
emitsCharactersBetweenAllVisiblePositions()); | 892 return isRenderedTableElement(node) && (node->layoutObject()->isInline() ||
emitsCharactersBetweenAllVisiblePositions()); |
| 893 } | 893 } |
| 894 | 894 |
| 895 template<typename Strategy> | 895 template<typename Strategy> |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 | 1119 |
| 1120 String plainText(const EphemeralRangeInComposedTree& range, TextIteratorBehavior
Flags behavior) | 1120 String plainText(const EphemeralRangeInComposedTree& range, TextIteratorBehavior
Flags behavior) |
| 1121 { | 1121 { |
| 1122 return createPlainText<EditingInComposedTreeStrategy>(range, behavior); | 1122 return createPlainText<EditingInComposedTreeStrategy>(range, behavior); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>; | 1125 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>; |
| 1126 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS
trategy>; | 1126 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS
trategy>; |
| 1127 | 1127 |
| 1128 } // namespace blink | 1128 } // namespace blink |
| OLD | NEW |