| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 if (result.isNull() || result.deprecatedNode()->rootEditableElement() != pos
.deprecatedNode()->rootEditableElement()) | 479 if (result.isNull() || result.deprecatedNode()->rootEditableElement() != pos
.deprecatedNode()->rootEditableElement()) |
| 480 return pos; | 480 return pos; |
| 481 if (containingSpecialElement) | 481 if (containingSpecialElement) |
| 482 *containingSpecialElement = n; | 482 *containingSpecialElement = n; |
| 483 return result; | 483 return result; |
| 484 } | 484 } |
| 485 | 485 |
| 486 Node* isFirstPositionAfterTable(const VisiblePosition& visiblePosition) | 486 Node* isFirstPositionAfterTable(const VisiblePosition& visiblePosition) |
| 487 { | 487 { |
| 488 Position upstream(visiblePosition.deepEquivalent().upstream()); | 488 Position upstream(visiblePosition.deepEquivalent().upstream()); |
| 489 if (upstream.deprecatedNode() && upstream.deprecatedNode()->renderer() && up
stream.deprecatedNode()->renderer()->isTable() && upstream.atLastEditingPosition
ForNode()) | 489 if (isRenderedTable(upstream.deprecatedNode()) && upstream.atLastEditingPosi
tionForNode()) |
| 490 return upstream.deprecatedNode(); | 490 return upstream.deprecatedNode(); |
| 491 | 491 |
| 492 return 0; | 492 return 0; |
| 493 } | 493 } |
| 494 | 494 |
| 495 Node* isLastPositionBeforeTable(const VisiblePosition& visiblePosition) | 495 Node* isLastPositionBeforeTable(const VisiblePosition& visiblePosition) |
| 496 { | 496 { |
| 497 Position downstream(visiblePosition.deepEquivalent().downstream()); | 497 Position downstream(visiblePosition.deepEquivalent().downstream()); |
| 498 if (downstream.deprecatedNode() && downstream.deprecatedNode()->renderer() &
& downstream.deprecatedNode()->renderer()->isTable() && downstream.atFirstEditin
gPositionForNode()) | 498 if (isRenderedTable(downstream.deprecatedNode()) && downstream.atFirstEditin
gPositionForNode()) |
| 499 return downstream.deprecatedNode(); | 499 return downstream.deprecatedNode(); |
| 500 | 500 |
| 501 return 0; | 501 return 0; |
| 502 } | 502 } |
| 503 | 503 |
| 504 // Returns the visible position at the beginning of a node | 504 // Returns the visible position at the beginning of a node |
| 505 VisiblePosition visiblePositionBeforeNode(Node* node) | 505 VisiblePosition visiblePositionBeforeNode(Node* node) |
| 506 { | 506 { |
| 507 ASSERT(node); | 507 ASSERT(node); |
| 508 if (node->childNodeCount()) | 508 if (node->childNodeCount()) |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 // if the selection starts just before a paragraph break, skip over it | 1161 // if the selection starts just before a paragraph break, skip over it |
| 1162 if (isEndOfParagraph(visiblePosition)) | 1162 if (isEndOfParagraph(visiblePosition)) |
| 1163 return visiblePosition.next().deepEquivalent().downstream(); | 1163 return visiblePosition.next().deepEquivalent().downstream(); |
| 1164 | 1164 |
| 1165 // otherwise, make sure to be at the start of the first selected node, | 1165 // otherwise, make sure to be at the start of the first selected node, |
| 1166 // instead of possibly at the end of the last node before the selection | 1166 // instead of possibly at the end of the last node before the selection |
| 1167 return visiblePosition.deepEquivalent().downstream(); | 1167 return visiblePosition.deepEquivalent().downstream(); |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 } // namespace WebCore | 1170 } // namespace WebCore |
| OLD | NEW |