OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. |
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 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 if (startOffset) | 1260 if (startOffset) |
1261 return false; | 1261 return false; |
1262 | 1262 |
1263 if (isAtomicNode(startNode)) { | 1263 if (isAtomicNode(startNode)) { |
1264 // note: prior siblings could be unrendered elements. it's silly to miss
the | 1264 // note: prior siblings could be unrendered elements. it's silly to miss
the |
1265 // merge opportunity just for that. | 1265 // merge opportunity just for that. |
1266 if (startNode->previousSibling()) | 1266 if (startNode->previousSibling()) |
1267 return false; | 1267 return false; |
1268 | 1268 |
1269 startNode = startNode->parentNode(); | 1269 startNode = startNode->parentNode(); |
1270 startOffset = 0; | |
1271 } | 1270 } |
1272 | 1271 |
1273 if (!startNode->isElementNode()) | 1272 if (!startNode->isElementNode()) |
1274 return false; | 1273 return false; |
1275 | 1274 |
1276 Node* previousSibling = startNode->previousSibling(); | 1275 Node* previousSibling = startNode->previousSibling(); |
1277 | 1276 |
1278 if (previousSibling && areIdenticalElements(startNode, previousSibling)) { | 1277 if (previousSibling && areIdenticalElements(startNode, previousSibling)) { |
1279 Element* previousElement = toElement(previousSibling); | 1278 Element* previousElement = toElement(previousSibling); |
1280 Element* element = toElement(startNode); | 1279 Element* element = toElement(startNode); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 String textToMove = nextText->data(); | 1542 String textToMove = nextText->data(); |
1544 insertTextIntoNode(childText, childText->length(), textToMove); | 1543 insertTextIntoNode(childText, childText->length(), textToMove); |
1545 removeNode(next); | 1544 removeNode(next); |
1546 // don't move child node pointer. it may want to merge with more text no
des. | 1545 // don't move child node pointer. it may want to merge with more text no
des. |
1547 } | 1546 } |
1548 | 1547 |
1549 updateStartEnd(newStart, newEnd); | 1548 updateStartEnd(newStart, newEnd); |
1550 } | 1549 } |
1551 | 1550 |
1552 } | 1551 } |
OLD | NEW |