| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2010 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 RefPtrWillBeRawPtr<HTMLElement> listElement = nullptr; | 374 RefPtrWillBeRawPtr<HTMLElement> listElement = nullptr; |
| 375 if (previousList) { | 375 if (previousList) { |
| 376 appendNode(listItemElement, previousList); | 376 appendNode(listItemElement, previousList); |
| 377 } else if (nextList) { | 377 } else if (nextList) { |
| 378 insertNodeAt(listItemElement, positionBeforeNode(nextList)); | 378 insertNodeAt(listItemElement, positionBeforeNode(nextList)); |
| 379 } else { | 379 } else { |
| 380 // Create the list. | 380 // Create the list. |
| 381 listElement = createHTMLElement(document(), listTag); | 381 listElement = createHTMLElement(document(), listTag); |
| 382 appendNode(listItemElement, listElement); | 382 appendNode(listItemElement, listElement); |
| 383 | 383 |
| 384 if (start.deepEquivalent() == end.deepEquivalent() && isBlock(start.deep
Equivalent().anchorNode())) { | 384 if (start.deepEquivalent() == end.deepEquivalent() && isEnclosingBlock(s
tart.deepEquivalent().anchorNode())) { |
| 385 // Inserting the list into an empty paragraph that isn't held open | 385 // Inserting the list into an empty paragraph that isn't held open |
| 386 // by a br or a '\n', will invalidate start and end. Insert | 386 // by a br or a '\n', will invalidate start and end. Insert |
| 387 // a placeholder and then recompute start and end. | 387 // a placeholder and then recompute start and end. |
| 388 RefPtrWillBeRawPtr<HTMLBRElement> placeholder = insertBlockPlacehold
er(start.deepEquivalent()); | 388 RefPtrWillBeRawPtr<HTMLBRElement> placeholder = insertBlockPlacehold
er(start.deepEquivalent()); |
| 389 start = VisiblePosition(positionBeforeNode(placeholder.get())); | 389 start = VisiblePosition(positionBeforeNode(placeholder.get())); |
| 390 end = start; | 390 end = start; |
| 391 } | 391 } |
| 392 | 392 |
| 393 // Insert the list at a position visually equivalent to start of the | 393 // Insert the list at a position visually equivalent to start of the |
| 394 // paragraph that is being moved into the list. | 394 // paragraph that is being moved into the list. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 return listElement; | 427 return listElement; |
| 428 } | 428 } |
| 429 | 429 |
| 430 DEFINE_TRACE(InsertListCommand) | 430 DEFINE_TRACE(InsertListCommand) |
| 431 { | 431 { |
| 432 visitor->trace(m_listElement); | 432 visitor->trace(m_listElement); |
| 433 CompositeEditCommand::trace(visitor); | 433 CompositeEditCommand::trace(visitor); |
| 434 } | 434 } |
| 435 | 435 |
| 436 } | 436 } |
| OLD | NEW |