| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2005 Apple Computer, 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "core/layout/LayoutTableCell.h" | 42 #include "core/layout/LayoutTableCell.h" |
| 43 #include "core/layout/LayoutText.h" | 43 #include "core/layout/LayoutText.h" |
| 44 | 44 |
| 45 namespace blink { | 45 namespace blink { |
| 46 | 46 |
| 47 using namespace HTMLNames; | 47 using namespace HTMLNames; |
| 48 | 48 |
| 49 static bool isTableCellEmpty(Node* cell) | 49 static bool isTableCellEmpty(Node* cell) |
| 50 { | 50 { |
| 51 DCHECK(isTableCell(cell)) << cell; | 51 DCHECK(isTableCell(cell)) << cell; |
| 52 return VisiblePosition::firstPositionInNode(cell).deepEquivalent() == create
VisiblePosition(lastPositionInNode(cell)).deepEquivalent(); | 52 return VisiblePosition::firstPositionInNode(cell).deepEquivalent() == create
VisiblePosition(Position::lastPositionInNode(cell)).deepEquivalent(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 static bool isTableRowEmpty(Node* row) | 55 static bool isTableRowEmpty(Node* row) |
| 56 { | 56 { |
| 57 if (!isHTMLTableRowElement(row)) | 57 if (!isHTMLTableRowElement(row)) |
| 58 return false; | 58 return false; |
| 59 | 59 |
| 60 for (Node* child = row->firstChild(); child; child = child->nextSibling()) { | 60 for (Node* child = row->firstChild(); child; child = child->nextSibling()) { |
| 61 if (isTableCell(child) && !isTableCellEmpty(child)) | 61 if (isTableCell(child) && !isTableCellEmpty(child)) |
| 62 return false; | 62 return false; |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 } | 392 } |
| 393 return; | 393 return; |
| 394 } | 394 } |
| 395 | 395 |
| 396 if (node == m_startBlock) { | 396 if (node == m_startBlock) { |
| 397 VisiblePosition previous = previousPositionOf(VisiblePosition::firstPosi
tionInNode(m_startBlock.get())); | 397 VisiblePosition previous = previousPositionOf(VisiblePosition::firstPosi
tionInNode(m_startBlock.get())); |
| 398 if (previous.isNotNull() && !isEndOfBlock(previous)) | 398 if (previous.isNotNull() && !isEndOfBlock(previous)) |
| 399 m_needPlaceholder = true; | 399 m_needPlaceholder = true; |
| 400 } | 400 } |
| 401 if (node == m_endBlock) { | 401 if (node == m_endBlock) { |
| 402 VisiblePosition next = nextPositionOf(createVisiblePosition(lastPosition
InNode(m_endBlock.get()))); | 402 VisiblePosition next = nextPositionOf(createVisiblePosition(Position::la
stPositionInNode(m_endBlock.get()))); |
| 403 if (next.isNotNull() && !isStartOfBlock(next)) | 403 if (next.isNotNull() && !isStartOfBlock(next)) |
| 404 m_needPlaceholder = true; | 404 m_needPlaceholder = true; |
| 405 } | 405 } |
| 406 | 406 |
| 407 // FIXME: Update the endpoints of the range being deleted. | 407 // FIXME: Update the endpoints of the range being deleted. |
| 408 updatePositionForNodeRemoval(m_endingPosition, *node); | 408 updatePositionForNodeRemoval(m_endingPosition, *node); |
| 409 updatePositionForNodeRemoval(m_leadingWhitespace, *node); | 409 updatePositionForNodeRemoval(m_leadingWhitespace, *node); |
| 410 updatePositionForNodeRemoval(m_trailingWhitespace, *node); | 410 updatePositionForNodeRemoval(m_trailingWhitespace, *node); |
| 411 | 411 |
| 412 CompositeEditCommand::removeNode(node, editingState, shouldAssumeContentIsAl
waysEditable); | 412 CompositeEditCommand::removeNode(node, editingState, shouldAssumeContentIsAl
waysEditable); |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 visitor->trace(m_deleteIntoBlockquoteStyle); | 962 visitor->trace(m_deleteIntoBlockquoteStyle); |
| 963 visitor->trace(m_startRoot); | 963 visitor->trace(m_startRoot); |
| 964 visitor->trace(m_endRoot); | 964 visitor->trace(m_endRoot); |
| 965 visitor->trace(m_startTableRow); | 965 visitor->trace(m_startTableRow); |
| 966 visitor->trace(m_endTableRow); | 966 visitor->trace(m_endTableRow); |
| 967 visitor->trace(m_temporaryPlaceholder); | 967 visitor->trace(m_temporaryPlaceholder); |
| 968 CompositeEditCommand::trace(visitor); | 968 CompositeEditCommand::trace(visitor); |
| 969 } | 969 } |
| 970 | 970 |
| 971 } // namespace blink | 971 } // namespace blink |
| OLD | NEW |