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

Unified Diff: Source/core/editing/markup.cpp

Issue 23548010: Have htmlediting create functions take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/htmlediting.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/markup.cpp
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
index 2c7c3c0ac846e4281576cb5a03370f38d9ac63d1..c78c1fb50997b9602aa0964b1ada2cf646ef79d3 100644
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -752,7 +752,7 @@ static void fillContainerFromString(ContainerNode* paragraph, const String& stri
Document& document = paragraph->document();
if (string.isEmpty()) {
- paragraph->appendChild(createBlockPlaceholderElement(&document));
+ paragraph->appendChild(createBlockPlaceholderElement(document));
return;
}
@@ -769,7 +769,7 @@ static void fillContainerFromString(ContainerNode* paragraph, const String& stri
// append the non-tab textual part
if (!s.isEmpty()) {
if (!tabText.isEmpty()) {
- paragraph->appendChild(createTabSpanElement(&document, tabText));
+ paragraph->appendChild(createTabSpanElement(document, tabText));
tabText = emptyString();
}
RefPtr<Node> textNode = document.createTextNode(stringWithRebalancedWhitespace(s, first, i + 1 == numEntries));
@@ -781,7 +781,7 @@ static void fillContainerFromString(ContainerNode* paragraph, const String& stri
if (i + 1 != numEntries)
tabText.append('\t');
else if (!tabText.isEmpty())
- paragraph->appendChild(createTabSpanElement(&document, tabText));
+ paragraph->appendChild(createTabSpanElement(document, tabText));
first = false;
}
@@ -818,8 +818,8 @@ PassRefPtr<DocumentFragment> createFragmentFromText(Range* context, const String
if (!context)
return 0;
- Document* document = context->ownerDocument();
- RefPtr<DocumentFragment> fragment = document->createDocumentFragment();
+ Document& document = *context->ownerDocument();
+ RefPtr<DocumentFragment> fragment = document.createDocumentFragment();
if (text.isEmpty())
return fragment.release();
@@ -829,7 +829,7 @@ PassRefPtr<DocumentFragment> createFragmentFromText(Range* context, const String
string.replace('\r', '\n');
if (shouldPreserveNewline(*context)) {
- fragment->appendChild(document->createTextNode(string));
+ fragment->appendChild(document.createTextNode(string));
if (string.endsWith('\n')) {
RefPtr<Element> element = createBreakElement(document);
element->setAttribute(classAttr, AppleInterchangeNewline);
@@ -889,7 +889,7 @@ PassRefPtr<DocumentFragment> createFragmentFromNodes(Document *document, const V
size_t size = nodes.size();
for (size_t i = 0; i < size; ++i) {
- RefPtr<Element> element = createDefaultParagraphElement(document);
+ RefPtr<Element> element = createDefaultParagraphElement(*document);
element->appendChild(nodes[i]);
fragment->appendChild(element.release());
}
« no previous file with comments | « Source/core/editing/htmlediting.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698