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

Side by Side Diff: Source/core/editing/InsertNodeBeforeCommand.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 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 15 matching lines...) Expand all
26 #include "config.h" 26 #include "config.h"
27 #include "core/editing/InsertNodeBeforeCommand.h" 27 #include "core/editing/InsertNodeBeforeCommand.h"
28 28
29 #include "bindings/v8/ExceptionStatePlaceholder.h" 29 #include "bindings/v8/ExceptionStatePlaceholder.h"
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 31
32 namespace WebCore { 32 namespace WebCore {
33 33
34 InsertNodeBeforeCommand::InsertNodeBeforeCommand(PassRefPtr<Node> insertChild, P assRefPtr<Node> refChild, 34 InsertNodeBeforeCommand::InsertNodeBeforeCommand(PassRefPtr<Node> insertChild, P assRefPtr<Node> refChild,
35 ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) 35 ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
36 : SimpleEditCommand(refChild->document()) 36 : SimpleEditCommand(&refChild->document())
37 , m_insertChild(insertChild) 37 , m_insertChild(insertChild)
38 , m_refChild(refChild) 38 , m_refChild(refChild)
39 , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) 39 , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable)
40 { 40 {
41 ASSERT(m_insertChild); 41 ASSERT(m_insertChild);
42 ASSERT(!m_insertChild->parentNode()); 42 ASSERT(!m_insertChild->parentNode());
43 ASSERT(m_refChild); 43 ASSERT(m_refChild);
44 ASSERT(m_refChild->parentNode()); 44 ASSERT(m_refChild->parentNode());
45 45
46 ASSERT(m_refChild->parentNode()->rendererIsEditable() || !m_refChild->parent Node()->attached()); 46 ASSERT(m_refChild->parentNode()->rendererIsEditable() || !m_refChild->parent Node()->attached());
(...skipping 19 matching lines...) Expand all
66 66
67 #ifndef NDEBUG 67 #ifndef NDEBUG
68 void InsertNodeBeforeCommand::getNodesInCommand(HashSet<Node*>& nodes) 68 void InsertNodeBeforeCommand::getNodesInCommand(HashSet<Node*>& nodes)
69 { 69 {
70 addNodeAndDescendants(m_insertChild.get(), nodes); 70 addNodeAndDescendants(m_insertChild.get(), nodes);
71 addNodeAndDescendants(m_refChild.get(), nodes); 71 addNodeAndDescendants(m_refChild.get(), nodes);
72 } 72 }
73 #endif 73 #endif
74 74
75 } 75 }
OLDNEW
« no previous file with comments | « Source/core/editing/InsertListCommand.cpp ('k') | Source/core/editing/InsertParagraphSeparatorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698