| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 n = NodeTraversal::nextSkippingChildren(n, node); | 646 n = NodeTraversal::nextSkippingChildren(n, node); |
| 647 continue; | 647 continue; |
| 648 } | 648 } |
| 649 if (n->renderer()) | 649 if (n->renderer()) |
| 650 return true; | 650 return true; |
| 651 n = NodeTraversal::next(n, node); | 651 n = NodeTraversal::next(n, node); |
| 652 } | 652 } |
| 653 return false; | 653 return false; |
| 654 } | 654 } |
| 655 | 655 |
| 656 Node* highestNodeToRemoveInPruning(Node* node) | 656 Node* highestNodeToRemoveInPruning(Node* node, Node* excludeNode) |
| 657 { | 657 { |
| 658 Node* previousNode = 0; | 658 Node* previousNode = 0; |
| 659 Node* rootEditableElement = node ? node->rootEditableElement() : 0; | 659 Node* rootEditableElement = node ? node->rootEditableElement() : 0; |
| 660 for (; node; node = node->parentNode()) { | 660 for (; node; node = node->parentNode()) { |
| 661 if (RenderObject* renderer = node->renderer()) { | 661 if (RenderObject* renderer = node->renderer()) { |
| 662 if (!renderer->canHaveChildren() || hasARenderedDescendant(node, pre
viousNode) || rootEditableElement == node) | 662 if (!renderer->canHaveChildren() || hasARenderedDescendant(node, pre
viousNode) || rootEditableElement == node || excludeNode == node) |
| 663 return previousNode; | 663 return previousNode; |
| 664 } | 664 } |
| 665 previousNode = node; | 665 previousNode = node; |
| 666 } | 666 } |
| 667 return 0; | 667 return 0; |
| 668 } | 668 } |
| 669 | 669 |
| 670 Node* enclosingTableCell(const Position& p) | 670 Node* enclosingTableCell(const Position& p) |
| 671 { | 671 { |
| 672 return toElement(enclosingNodeOfType(p, isTableCell)); | 672 return toElement(enclosingNodeOfType(p, isTableCell)); |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 // if the selection starts just before a paragraph break, skip over it | 1199 // if the selection starts just before a paragraph break, skip over it |
| 1200 if (isEndOfParagraph(visiblePosition)) | 1200 if (isEndOfParagraph(visiblePosition)) |
| 1201 return visiblePosition.next().deepEquivalent().downstream(); | 1201 return visiblePosition.next().deepEquivalent().downstream(); |
| 1202 | 1202 |
| 1203 // otherwise, make sure to be at the start of the first selected node, | 1203 // otherwise, make sure to be at the start of the first selected node, |
| 1204 // instead of possibly at the end of the last node before the selection | 1204 // instead of possibly at the end of the last node before the selection |
| 1205 return visiblePosition.deepEquivalent().downstream(); | 1205 return visiblePosition.deepEquivalent().downstream(); |
| 1206 } | 1206 } |
| 1207 | 1207 |
| 1208 } // namespace WebCore | 1208 } // namespace WebCore |
| OLD | NEW |