| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 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 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2175 { | 2175 { |
| 2176 for (node = nextAtomicLeafNode(*node); node; node = nextAtomicLeafNode(*node
)) { | 2176 for (node = nextAtomicLeafNode(*node); node; node = nextAtomicLeafNode(*node
)) { |
| 2177 LayoutObject* layoutObject = node->layoutObject(); | 2177 LayoutObject* layoutObject = node->layoutObject(); |
| 2178 if (!layoutObject) | 2178 if (!layoutObject) |
| 2179 continue; | 2179 continue; |
| 2180 if (!node->hasEditableStyle()) | 2180 if (!node->hasEditableStyle()) |
| 2181 continue; | 2181 continue; |
| 2182 // TODO(yosin) We should have a function to check |InlineBox| types | 2182 // TODO(yosin) We should have a function to check |InlineBox| types |
| 2183 // in layout rather than using |InlineBox| here. See also | 2183 // in layout rather than using |InlineBox| here. See also |
| 2184 // |previousRenderedEditable()| which has a same condition. | 2184 // |previousRenderedEditable()| which has a same condition. |
| 2185 if ((layoutObject->isBox() && toLayoutBox(layoutObject)->inlineBoxWrappe
r()) || (layoutObject->isText() && toLayoutText(layoutObject)->firstTextBox())) | 2185 if ((layoutObject->isBox() && toLayoutBox(layoutObject)->inlineBoxWrappe
r()) || (layoutObject->isText() && toLayoutText(layoutObject)->hasTextBoxes())) |
| 2186 return node; | 2186 return node; |
| 2187 } | 2187 } |
| 2188 return 0; | 2188 return 0; |
| 2189 } | 2189 } |
| 2190 | 2190 |
| 2191 static Node* previousRenderedEditable(Node* node) | 2191 static Node* previousRenderedEditable(Node* node) |
| 2192 { | 2192 { |
| 2193 for (node = previousAtomicLeafNode(*node); node; node = previousAtomicLeafNo
de(*node)) { | 2193 for (node = previousAtomicLeafNode(*node); node; node = previousAtomicLeafNo
de(*node)) { |
| 2194 LayoutObject* layoutObject = node->layoutObject(); | 2194 LayoutObject* layoutObject = node->layoutObject(); |
| 2195 if (!layoutObject) | 2195 if (!layoutObject) |
| 2196 continue; | 2196 continue; |
| 2197 if (!node->hasEditableStyle()) | 2197 if (!node->hasEditableStyle()) |
| 2198 continue; | 2198 continue; |
| 2199 // TODO(yosin) We should have a function to check |InlineBox| types | 2199 // TODO(yosin) We should have a function to check |InlineBox| types |
| 2200 // in layout rather than using |InlineBox| here. See also | 2200 // in layout rather than using |InlineBox| here. See also |
| 2201 // |nextRenderedEditable()| which has a same condition. | 2201 // |nextRenderedEditable()| which has a same condition. |
| 2202 if ((layoutObject->isBox() && toLayoutBox(layoutObject)->inlineBoxWrappe
r()) || (layoutObject->isText() && toLayoutText(layoutObject)->firstTextBox())) | 2202 if ((layoutObject->isBox() && toLayoutBox(layoutObject)->inlineBoxWrappe
r()) || (layoutObject->isText() && toLayoutText(layoutObject)->hasTextBoxes())) |
| 2203 return node; | 2203 return node; |
| 2204 } | 2204 } |
| 2205 return 0; | 2205 return 0; |
| 2206 } | 2206 } |
| 2207 | 2207 |
| 2208 static int renderedOffsetOf(const Position& position) | 2208 static int renderedOffsetOf(const Position& position) |
| 2209 { | 2209 { |
| 2210 const int offset = position.computeEditingOffset(); | 2210 const int offset = position.computeEditingOffset(); |
| 2211 Node* const anchorNode = position.anchorNode(); | 2211 Node* const anchorNode = position.anchorNode(); |
| 2212 if (!anchorNode->isTextNode() || !anchorNode->layoutObject()) | 2212 if (!anchorNode->isTextNode() || !anchorNode->layoutObject()) |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3239 { | 3239 { |
| 3240 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); | 3240 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); |
| 3241 } | 3241 } |
| 3242 | 3242 |
| 3243 VisiblePositionInComposedTree previousPositionOf(const VisiblePositionInComposed
Tree& visiblePosition, EditingBoundaryCrossingRule rule) | 3243 VisiblePositionInComposedTree previousPositionOf(const VisiblePositionInComposed
Tree& visiblePosition, EditingBoundaryCrossingRule rule) |
| 3244 { | 3244 { |
| 3245 return previousPositionOfAlgorithm<EditingInComposedTreeStrategy>(visiblePos
ition, rule); | 3245 return previousPositionOfAlgorithm<EditingInComposedTreeStrategy>(visiblePos
ition, rule); |
| 3246 } | 3246 } |
| 3247 | 3247 |
| 3248 } // namespace blink | 3248 } // namespace blink |
| OLD | NEW |