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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 m_positionNode = nullptr; | 155 m_positionNode = nullptr; |
156 m_textLength = 0; | 156 m_textLength = 0; |
157 | 157 |
158 while (m_node && !m_havePassedStartNode) { | 158 while (m_node && !m_havePassedStartNode) { |
159 // Don't handle node if we start iterating at [node, 0]. | 159 // Don't handle node if we start iterating at [node, 0]. |
160 if (!m_handledNode && !(m_node == m_endNode && !m_endOffset)) { | 160 if (!m_handledNode && !(m_node == m_endNode && !m_endOffset)) { |
161 LayoutObject* layoutObject = m_node->layoutObject(); | 161 LayoutObject* layoutObject = m_node->layoutObject(); |
162 if (layoutObject && layoutObject->isText() && | 162 if (layoutObject && layoutObject->isText() && |
163 m_node->getNodeType() == Node::kTextNode) { | 163 m_node->getNodeType() == Node::kTextNode) { |
164 // FIXME: What about kCdataSectionNode? | 164 // FIXME: What about kCdataSectionNode? |
165 if (layoutObject->style()->visibility() == EVisibility::Visible && | 165 if (layoutObject->style()->visibility() == EVisibility::kVisible && |
166 m_offset > 0) | 166 m_offset > 0) |
167 m_handledNode = handleTextNode(); | 167 m_handledNode = handleTextNode(); |
168 } else if (layoutObject && (layoutObject->isLayoutPart() || | 168 } else if (layoutObject && (layoutObject->isLayoutPart() || |
169 TextIterator::supportsAltText(m_node))) { | 169 TextIterator::supportsAltText(m_node))) { |
170 if (layoutObject->style()->visibility() == EVisibility::Visible && | 170 if (layoutObject->style()->visibility() == EVisibility::kVisible && |
171 m_offset > 0) | 171 m_offset > 0) |
172 m_handledNode = handleReplacedElement(); | 172 m_handledNode = handleReplacedElement(); |
173 } else { | 173 } else { |
174 m_handledNode = handleNonTextNode(); | 174 m_handledNode = handleNonTextNode(); |
175 } | 175 } |
176 if (m_positionNode) | 176 if (m_positionNode) |
177 return; | 177 return; |
178 } | 178 } |
179 | 179 |
180 if (!m_handledChildren && Strategy::hasChildren(*m_node)) { | 180 if (!m_handledChildren && Strategy::hasChildren(*m_node)) { |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 else | 482 else |
483 output->pushRange(m_textContainer.characters16() + offset, copyLength); | 483 output->pushRange(m_textContainer.characters16() + offset, copyLength); |
484 } | 484 } |
485 | 485 |
486 template class CORE_TEMPLATE_EXPORT | 486 template class CORE_TEMPLATE_EXPORT |
487 SimplifiedBackwardsTextIteratorAlgorithm<EditingStrategy>; | 487 SimplifiedBackwardsTextIteratorAlgorithm<EditingStrategy>; |
488 template class CORE_TEMPLATE_EXPORT | 488 template class CORE_TEMPLATE_EXPORT |
489 SimplifiedBackwardsTextIteratorAlgorithm<EditingInFlatTreeStrategy>; | 489 SimplifiedBackwardsTextIteratorAlgorithm<EditingInFlatTreeStrategy>; |
490 | 490 |
491 } // namespace blink | 491 } // namespace blink |
OLD | NEW |