| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 346 |
| 347 Document* taggedDocument = Document::create(); | 347 Document* taggedDocument = Document::create(); |
| 348 taggedDocument->setContextFeatures(document.contextFeatures()); | 348 taggedDocument->setContextFeatures(document.contextFeatures()); |
| 349 | 349 |
| 350 Element* root = Element::create(QualifiedName::null(), taggedDocument); | 350 Element* root = Element::create(QualifiedName::null(), taggedDocument); |
| 351 root->appendChild(taggedFragment); | 351 root->appendChild(taggedFragment); |
| 352 taggedDocument->appendChild(root); | 352 taggedDocument->appendChild(root); |
| 353 | 353 |
| 354 Range* range = Range::create(*taggedDocument, | 354 Range* range = Range::create(*taggedDocument, |
| 355 Position::afterNode(nodeBeforeContext).parentAnchoredEquivalent(), | 355 Position::afterNode(nodeBeforeContext).parentAnchoredEquivalent(), |
| 356 positionBeforeNode(nodeAfterContext).parentAnchoredEquivalent()); | 356 Position::beforeNode(nodeAfterContext).parentAnchoredEquivalent()); |
| 357 | 357 |
| 358 Node* commonAncestor = range->commonAncestorContainer(); | 358 Node* commonAncestor = range->commonAncestorContainer(); |
| 359 HTMLElement* specialCommonAncestor = ancestorToRetainStructureAndAppearanceW
ithNoLayoutObject(commonAncestor); | 359 HTMLElement* specialCommonAncestor = ancestorToRetainStructureAndAppearanceW
ithNoLayoutObject(commonAncestor); |
| 360 | 360 |
| 361 // When there's a special common ancestor outside of the fragment, we must i
nclude it as well to | 361 // When there's a special common ancestor outside of the fragment, we must i
nclude it as well to |
| 362 // preserve the structure and appearance of the fragment. For example, if th
e fragment contains | 362 // preserve the structure and appearance of the fragment. For example, if th
e fragment contains |
| 363 // TD, we need to include the enclosing TABLE tag as well. | 363 // TD, we need to include the enclosing TABLE tag as well. |
| 364 DocumentFragment* fragment = DocumentFragment::create(document); | 364 DocumentFragment* fragment = DocumentFragment::create(document); |
| 365 if (specialCommonAncestor) | 365 if (specialCommonAncestor) |
| 366 fragment->appendChild(specialCommonAncestor); | 366 fragment->appendChild(specialCommonAncestor); |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 Text* textNext = toText(next); | 683 Text* textNext = toText(next); |
| 684 textNode->appendData(textNext->data()); | 684 textNode->appendData(textNext->data()); |
| 685 if (textNext->parentNode()) // Might have been removed by mutation event. | 685 if (textNext->parentNode()) // Might have been removed by mutation event. |
| 686 textNext->remove(exceptionState); | 686 textNext->remove(exceptionState); |
| 687 } | 687 } |
| 688 | 688 |
| 689 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; | 689 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; |
| 690 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingInFlatTreeStrat
egy>; | 690 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingInFlatTreeStrat
egy>; |
| 691 | 691 |
| 692 } // namespace blink | 692 } // namespace blink |
| OLD | NEW |