Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: third_party/WebKit/Source/core/editing/serializers/Serialization.cpp

Issue 2950053002: Make Position::BeforeNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-21T17:56:36 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved.
5 * Copyright (C) 2011 Igalia S.L. 5 * Copyright (C) 2011 Igalia S.L.
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 404
405 Document* tagged_document = Document::Create(); 405 Document* tagged_document = Document::Create();
406 tagged_document->SetContextFeatures(document.GetContextFeatures()); 406 tagged_document->SetContextFeatures(document.GetContextFeatures());
407 407
408 Element* root = Element::Create(QualifiedName::Null(), tagged_document); 408 Element* root = Element::Create(QualifiedName::Null(), tagged_document);
409 root->AppendChild(tagged_fragment); 409 root->AppendChild(tagged_fragment);
410 tagged_document->AppendChild(root); 410 tagged_document->AppendChild(root);
411 411
412 const EphemeralRange range( 412 const EphemeralRange range(
413 Position::AfterNode(node_before_context).ParentAnchoredEquivalent(), 413 Position::AfterNode(node_before_context).ParentAnchoredEquivalent(),
414 Position::BeforeNode(node_after_context).ParentAnchoredEquivalent()); 414 Position::BeforeNode(*node_after_context).ParentAnchoredEquivalent());
415 415
416 Node* common_ancestor = range.CommonAncestorContainer(); 416 Node* common_ancestor = range.CommonAncestorContainer();
417 HTMLElement* special_common_ancestor = 417 HTMLElement* special_common_ancestor =
418 AncestorToRetainStructureAndAppearanceWithNoLayoutObject(common_ancestor); 418 AncestorToRetainStructureAndAppearanceWithNoLayoutObject(common_ancestor);
419 419
420 // When there's a special common ancestor outside of the fragment, we must 420 // When there's a special common ancestor outside of the fragment, we must
421 // include it as well to preserve the structure and appearance of the 421 // include it as well to preserve the structure and appearance of the
422 // fragment. For example, if the fragment contains TD, we need to include the 422 // fragment. For example, if the fragment contains TD, we need to include the
423 // enclosing TABLE tag as well. 423 // enclosing TABLE tag as well.
424 DocumentFragment* fragment = DocumentFragment::Create(document); 424 DocumentFragment* fragment = DocumentFragment::Create(document);
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 text_node->appendData(text_next->data()); 757 text_node->appendData(text_next->data());
758 if (text_next->parentNode()) // Might have been removed by mutation event. 758 if (text_next->parentNode()) // Might have been removed by mutation event.
759 text_next->remove(exception_state); 759 text_next->remove(exception_state);
760 } 760 }
761 761
762 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; 762 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>;
763 template class CORE_TEMPLATE_EXPORT 763 template class CORE_TEMPLATE_EXPORT
764 CreateMarkupAlgorithm<EditingInFlatTreeStrategy>; 764 CreateMarkupAlgorithm<EditingInFlatTreeStrategy>;
765 765
766 } // namespace blink 766 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698