| 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 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 if (!r) { | 1184 if (!r) { |
| 1185 n = NodeTraversal::previousPostOrder(*n, startBlock); | 1185 n = NodeTraversal::previousPostOrder(*n, startBlock); |
| 1186 continue; | 1186 continue; |
| 1187 } | 1187 } |
| 1188 const ComputedStyle& style = r->styleRef(); | 1188 const ComputedStyle& style = r->styleRef(); |
| 1189 if (style.visibility() != VISIBLE) { | 1189 if (style.visibility() != VISIBLE) { |
| 1190 n = NodeTraversal::previousPostOrder(*n, startBlock); | 1190 n = NodeTraversal::previousPostOrder(*n, startBlock); |
| 1191 continue; | 1191 continue; |
| 1192 } | 1192 } |
| 1193 | 1193 |
| 1194 if (r->isBR() || isBlock(n)) | 1194 if (r->isBR() || isEnclosingBlock(n)) |
| 1195 break; | 1195 break; |
| 1196 | 1196 |
| 1197 if (r->isText() && toLayoutText(r)->resolvedTextLength()) { | 1197 if (r->isText() && toLayoutText(r)->resolvedTextLength()) { |
| 1198 ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode()); | 1198 ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode()); |
| 1199 type = PositionAnchorType::OffsetInAnchor; | 1199 type = PositionAnchorType::OffsetInAnchor; |
| 1200 if (style.preserveNewline()) { | 1200 if (style.preserveNewline()) { |
| 1201 LayoutText* text = toLayoutText(r); | 1201 LayoutText* text = toLayoutText(r); |
| 1202 int i = text->textLength(); | 1202 int i = text->textLength(); |
| 1203 int o = offset; | 1203 int o = offset; |
| 1204 if (n == startNode && o < i) | 1204 if (n == startNode && o < i) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 if (!r) { | 1261 if (!r) { |
| 1262 n = NodeTraversal::next(*n, stayInsideBlock); | 1262 n = NodeTraversal::next(*n, stayInsideBlock); |
| 1263 continue; | 1263 continue; |
| 1264 } | 1264 } |
| 1265 const ComputedStyle& style = r->styleRef(); | 1265 const ComputedStyle& style = r->styleRef(); |
| 1266 if (style.visibility() != VISIBLE) { | 1266 if (style.visibility() != VISIBLE) { |
| 1267 n = NodeTraversal::next(*n, stayInsideBlock); | 1267 n = NodeTraversal::next(*n, stayInsideBlock); |
| 1268 continue; | 1268 continue; |
| 1269 } | 1269 } |
| 1270 | 1270 |
| 1271 if (r->isBR() || isBlock(n)) | 1271 if (r->isBR() || isEnclosingBlock(n)) |
| 1272 break; | 1272 break; |
| 1273 | 1273 |
| 1274 // FIXME: We avoid returning a position where the layoutObject can't acc
ept the caret. | 1274 // FIXME: We avoid returning a position where the layoutObject can't acc
ept the caret. |
| 1275 if (r->isText() && toLayoutText(r)->resolvedTextLength()) { | 1275 if (r->isText() && toLayoutText(r)->resolvedTextLength()) { |
| 1276 ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode()); | 1276 ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode()); |
| 1277 int length = toLayoutText(r)->textLength(); | 1277 int length = toLayoutText(r)->textLength(); |
| 1278 type = PositionAnchorType::OffsetInAnchor; | 1278 type = PositionAnchorType::OffsetInAnchor; |
| 1279 if (style.preserveNewline()) { | 1279 if (style.preserveNewline()) { |
| 1280 LayoutText* text = toLayoutText(r); | 1280 LayoutText* text = toLayoutText(r); |
| 1281 int o = n == startNode ? offset : 0; | 1281 int o = n == startNode ? offset : 0; |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2331 { | 2331 { |
| 2332 return isVisuallyEquivalentCandidateAlgorithm<EditingStrategy>(position); | 2332 return isVisuallyEquivalentCandidateAlgorithm<EditingStrategy>(position); |
| 2333 } | 2333 } |
| 2334 | 2334 |
| 2335 bool isVisuallyEquivalentCandidate(const PositionInComposedTree& position) | 2335 bool isVisuallyEquivalentCandidate(const PositionInComposedTree& position) |
| 2336 { | 2336 { |
| 2337 return isVisuallyEquivalentCandidateAlgorithm<EditingInComposedTreeStrategy>
(position); | 2337 return isVisuallyEquivalentCandidateAlgorithm<EditingInComposedTreeStrategy>
(position); |
| 2338 } | 2338 } |
| 2339 | 2339 |
| 2340 } // namespace blink | 2340 } // namespace blink |
| OLD | NEW |