OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 | 987 |
988 VisiblePosition startOfInsertedContent, endOfInsertedContent; | 988 VisiblePosition startOfInsertedContent, endOfInsertedContent; |
989 | 989 |
990 RefPtr<Node> refNode = fragment.firstChild(); | 990 RefPtr<Node> refNode = fragment.firstChild(); |
991 RefPtr<Node> node = refNode->nextSibling(); | 991 RefPtr<Node> node = refNode->nextSibling(); |
992 | 992 |
993 fragment.removeNode(refNode); | 993 fragment.removeNode(refNode); |
994 | 994 |
995 Node* blockStart = enclosingBlock(insertionPos.deprecatedNode()); | 995 Node* blockStart = enclosingBlock(insertionPos.deprecatedNode()); |
996 if ((isListElement(refNode.get()) || (isLegacyAppleStyleSpan(refNode.get())
&& isListElement(refNode->firstChild()))) | 996 if ((isListElement(refNode.get()) || (isLegacyAppleStyleSpan(refNode.get())
&& isListElement(refNode->firstChild()))) |
997 && blockStart->renderer()->isListItem()) | 997 && blockStart && blockStart->renderer()->isListItem()) |
998 refNode = insertAsListItems(refNode, blockStart, insertionPos); | 998 refNode = insertAsListItems(refNode, blockStart, insertionPos); |
999 else | 999 else |
1000 insertNodeAtAndUpdateNodesInserted(refNode, insertionPos); | 1000 insertNodeAtAndUpdateNodesInserted(refNode, insertionPos); |
1001 | 1001 |
1002 // Mutation events (bug 22634) may have already removed the inserted content | 1002 // Mutation events (bug 22634) may have already removed the inserted content |
1003 if (!refNode->inDocument()) | 1003 if (!refNode->inDocument()) |
1004 return; | 1004 return; |
1005 | 1005 |
1006 bool plainTextFragment = isPlainTextMarkup(refNode.get()); | 1006 bool plainTextFragment = isPlainTextMarkup(refNode.get()); |
1007 | 1007 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 return false; | 1327 return false; |
1328 | 1328 |
1329 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en
d); | 1329 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en
d); |
1330 | 1330 |
1331 setEndingSelection(selectionAfterReplace); | 1331 setEndingSelection(selectionAfterReplace); |
1332 | 1332 |
1333 return true; | 1333 return true; |
1334 } | 1334 } |
1335 | 1335 |
1336 } // namespace WebCore | 1336 } // namespace WebCore |
OLD | NEW |