OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. |
4 * Copyright (C) 2011 Igalia S.L. | 4 * Copyright (C) 2011 Igalia S.L. |
5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 #include "CSSPropertyNames.h" | 32 #include "CSSPropertyNames.h" |
33 #include "CSSValueKeywords.h" | 33 #include "CSSValueKeywords.h" |
34 #include "HTMLNames.h" | 34 #include "HTMLNames.h" |
35 #include "core/css/CSSPrimitiveValue.h" | 35 #include "core/css/CSSPrimitiveValue.h" |
36 #include "core/css/CSSValue.h" | 36 #include "core/css/CSSValue.h" |
37 #include "core/css/StylePropertySet.h" | 37 #include "core/css/StylePropertySet.h" |
38 #include "core/dom/CDATASection.h" | 38 #include "core/dom/CDATASection.h" |
39 #include "core/dom/ChildListMutationScope.h" | 39 #include "core/dom/ChildListMutationScope.h" |
40 #include "core/dom/ContextFeatures.h" | 40 #include "core/dom/ContextFeatures.h" |
| 41 #include "core/dom/CustomElementRegistrationContextualizer.h" |
41 #include "core/dom/DocumentFragment.h" | 42 #include "core/dom/DocumentFragment.h" |
42 #include "core/dom/ExceptionCode.h" | 43 #include "core/dom/ExceptionCode.h" |
43 #include "core/dom/ExceptionCodePlaceholder.h" | 44 #include "core/dom/ExceptionCodePlaceholder.h" |
44 #include "core/dom/NodeTraversal.h" | 45 #include "core/dom/NodeTraversal.h" |
45 #include "core/dom/Range.h" | 46 #include "core/dom/Range.h" |
46 #include "core/editing/Editor.h" | 47 #include "core/editing/Editor.h" |
47 #include "core/editing/MarkupAccumulator.h" | 48 #include "core/editing/MarkupAccumulator.h" |
48 #include "core/editing/TextIterator.h" | 49 #include "core/editing/TextIterator.h" |
49 #include "core/editing/VisibleSelection.h" | 50 #include "core/editing/VisibleSelection.h" |
50 #include "core/editing/VisibleUnits.h" | 51 #include "core/editing/VisibleUnits.h" |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 | 703 |
703 StringBuilder taggedMarkup; | 704 StringBuilder taggedMarkup; |
704 taggedMarkup.append(markup.left(fragmentStart)); | 705 taggedMarkup.append(markup.left(fragmentStart)); |
705 MarkupAccumulator::appendComment(taggedMarkup, fragmentMarkerTag); | 706 MarkupAccumulator::appendComment(taggedMarkup, fragmentMarkerTag); |
706 taggedMarkup.append(markup.substring(fragmentStart, fragmentEnd - fragmentSt
art)); | 707 taggedMarkup.append(markup.substring(fragmentStart, fragmentEnd - fragmentSt
art)); |
707 MarkupAccumulator::appendComment(taggedMarkup, fragmentMarkerTag); | 708 MarkupAccumulator::appendComment(taggedMarkup, fragmentMarkerTag); |
708 taggedMarkup.append(markup.substring(fragmentEnd)); | 709 taggedMarkup.append(markup.substring(fragmentEnd)); |
709 | 710 |
710 RefPtr<DocumentFragment> taggedFragment = createFragmentFromMarkup(document,
taggedMarkup.toString(), baseURL, parserContentPolicy); | 711 RefPtr<DocumentFragment> taggedFragment = createFragmentFromMarkup(document,
taggedMarkup.toString(), baseURL, parserContentPolicy); |
711 RefPtr<Document> taggedDocument = Document::create(0, KURL()); | 712 RefPtr<Document> taggedDocument = Document::create(0, KURL()); |
| 713 CustomElementRegistrationContextualizer::didCreateRelatedDocument(document->
registrationContext(), CustomElementRegistrationContextualizer::PasteboardFragme
nt, taggedDocument.get()); |
712 taggedDocument->setContextFeatures(document->contextFeatures()); | 714 taggedDocument->setContextFeatures(document->contextFeatures()); |
713 taggedDocument->takeAllChildrenFrom(taggedFragment.get()); | 715 taggedDocument->takeAllChildrenFrom(taggedFragment.get()); |
714 | 716 |
715 RefPtr<Node> nodeBeforeContext; | 717 RefPtr<Node> nodeBeforeContext; |
716 RefPtr<Node> nodeAfterContext; | 718 RefPtr<Node> nodeAfterContext; |
717 if (!findNodesSurroundingContext(taggedDocument.get(), nodeBeforeContext, no
deAfterContext)) | 719 if (!findNodesSurroundingContext(taggedDocument.get(), nodeBeforeContext, no
deAfterContext)) |
718 return 0; | 720 return 0; |
719 | 721 |
720 RefPtr<Range> range = Range::create(taggedDocument.get(), | 722 RefPtr<Range> range = Range::create(taggedDocument.get(), |
721 positionAfterNode(nodeBeforeContext.get()).parentAnchoredEquivalent(), | 723 positionAfterNode(nodeBeforeContext.get()).parentAnchoredEquivalent(), |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 if (hasOneChild(containerNode.get())) { | 1086 if (hasOneChild(containerNode.get())) { |
1085 containerNode->replaceChild(textNode.release(), containerNode->firstChil
d(), ec); | 1087 containerNode->replaceChild(textNode.release(), containerNode->firstChil
d(), ec); |
1086 return; | 1088 return; |
1087 } | 1089 } |
1088 | 1090 |
1089 containerNode->removeChildren(); | 1091 containerNode->removeChildren(); |
1090 containerNode->appendChild(textNode.release(), ec); | 1092 containerNode->appendChild(textNode.release(), ec); |
1091 } | 1093 } |
1092 | 1094 |
1093 } | 1095 } |
OLD | NEW |