OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008 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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 RefPtrWillBeRawPtr<Element> paragraphElement = createDefaultParagraphElement
(document()); | 890 RefPtrWillBeRawPtr<Element> paragraphElement = createDefaultParagraphElement
(document()); |
891 paragraphElement->appendChild(createBreakElement(document())); | 891 paragraphElement->appendChild(createBreakElement(document())); |
892 insertNodeAt(paragraphElement, position); | 892 insertNodeAt(paragraphElement, position); |
893 return paragraphElement.release(); | 893 return paragraphElement.release(); |
894 } | 894 } |
895 | 895 |
896 // If the paragraph is not entirely within it's own block, create one and move t
he paragraph into | 896 // If the paragraph is not entirely within it's own block, create one and move t
he paragraph into |
897 // it, and return that block. Otherwise return 0. | 897 // it, and return that block. Otherwise return 0. |
898 PassRefPtrWillBeRawPtr<Element> CompositeEditCommand::moveParagraphContentsToNew
BlockIfNecessary(const Position& pos) | 898 PassRefPtrWillBeRawPtr<Element> CompositeEditCommand::moveParagraphContentsToNew
BlockIfNecessary(const Position& pos) |
899 { | 899 { |
900 if (pos.isNull()) | 900 ASSERT(isEditablePosition(pos, ContentIsEditable, DoNotUpdateStyle)); |
901 return nullptr; | |
902 | |
903 document().updateLayoutIgnorePendingStylesheets(); | |
904 | 901 |
905 // It's strange that this function is responsible for verifying that pos has
not been invalidated | 902 // It's strange that this function is responsible for verifying that pos has
not been invalidated |
906 // by an earlier call to this function. The caller, applyBlockStyle, should
do this. | 903 // by an earlier call to this function. The caller, applyBlockStyle, should
do this. |
907 VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY); | 904 VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY); |
908 VisiblePosition visibleParagraphStart(startOfParagraph(visiblePos)); | 905 VisiblePosition visibleParagraphStart(startOfParagraph(visiblePos)); |
909 VisiblePosition visibleParagraphEnd = endOfParagraph(visiblePos); | 906 VisiblePosition visibleParagraphEnd = endOfParagraph(visiblePos); |
910 VisiblePosition next = visibleParagraphEnd.next(); | 907 VisiblePosition next = visibleParagraphEnd.next(); |
911 VisiblePosition visibleEnd = next.isNotNull() ? next : visibleParagraphEnd; | 908 VisiblePosition visibleEnd = next.isNotNull() ? next : visibleParagraphEnd; |
912 | 909 |
913 Position upstreamStart = visibleParagraphStart.deepEquivalent().upstream(); | 910 Position upstreamStart = visibleParagraphStart.deepEquivalent().upstream(); |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 } | 1494 } |
1498 | 1495 |
1499 void CompositeEditCommand::trace(Visitor* visitor) | 1496 void CompositeEditCommand::trace(Visitor* visitor) |
1500 { | 1497 { |
1501 visitor->trace(m_commands); | 1498 visitor->trace(m_commands); |
1502 visitor->trace(m_composition); | 1499 visitor->trace(m_composition); |
1503 EditCommand::trace(visitor); | 1500 EditCommand::trace(visitor); |
1504 } | 1501 } |
1505 | 1502 |
1506 } // namespace WebCore | 1503 } // namespace WebCore |
OLD | NEW |