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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 | 344 |
345 Range* range = Range::create(*taggedDocument, | 345 Range* range = Range::create(*taggedDocument, |
346 Position::afterNode(nodeBeforeContext).parentAnchoredEquivalent(), | 346 Position::afterNode(nodeBeforeContext).parentAnchoredEquivalent(), |
347 Position::beforeNode(nodeAfterContext).parentAnchoredEquivalent()); | 347 Position::beforeNode(nodeAfterContext).parentAnchoredEquivalent()); |
348 | 348 |
349 Node* commonAncestor = range->commonAncestorContainer(); | 349 Node* commonAncestor = range->commonAncestorContainer(); |
350 HTMLElement* specialCommonAncestor = ancestorToRetainStructureAndAppearanceW ithNoLayoutObject(commonAncestor); | 350 HTMLElement* specialCommonAncestor = ancestorToRetainStructureAndAppearanceW ithNoLayoutObject(commonAncestor); |
351 | 351 |
352 // When there's a special common ancestor outside of the fragment, we must i nclude it as well to | 352 // When there's a special common ancestor outside of the fragment, we must i nclude it as well to |
353 // preserve the structure and appearance of the fragment. For example, if th e fragment contains | 353 // preserve the structure and appearance of the fragment. For example, if th e fragment contains |
354 // TD, we need to include the enclosing TABLE tag as well. | 354 // TD, we need to include the enclosing EDisplay::Table tag as well. |
alancutter (OOO until 2018)
2016/09/26 04:23:46
This should not change.
| |
355 DocumentFragment* fragment = DocumentFragment::create(document); | 355 DocumentFragment* fragment = DocumentFragment::create(document); |
356 if (specialCommonAncestor) | 356 if (specialCommonAncestor) |
357 fragment->appendChild(specialCommonAncestor); | 357 fragment->appendChild(specialCommonAncestor); |
358 else | 358 else |
359 fragment->parserTakeAllChildrenFrom(toContainerNode(*commonAncestor)); | 359 fragment->parserTakeAllChildrenFrom(toContainerNode(*commonAncestor)); |
360 | 360 |
361 trimFragment(fragment, nodeBeforeContext, nodeAfterContext); | 361 trimFragment(fragment, nodeBeforeContext, nodeAfterContext); |
362 | 362 |
363 return fragment; | 363 return fragment; |
364 } | 364 } |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
674 Text* textNext = toText(next); | 674 Text* textNext = toText(next); |
675 textNode->appendData(textNext->data()); | 675 textNode->appendData(textNext->data()); |
676 if (textNext->parentNode()) // Might have been removed by mutation event. | 676 if (textNext->parentNode()) // Might have been removed by mutation event. |
677 textNext->remove(exceptionState); | 677 textNext->remove(exceptionState); |
678 } | 678 } |
679 | 679 |
680 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; | 680 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; |
681 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingInFlatTreeStrat egy>; | 681 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingInFlatTreeStrat egy>; |
682 | 682 |
683 } // namespace blink | 683 } // namespace blink |
OLD | NEW |