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

Unified Diff: Source/core/editing/MarkupAccumulator.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, 4 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
Index: Source/core/editing/MarkupAccumulator.cpp
diff --git a/Source/core/editing/MarkupAccumulator.cpp b/Source/core/editing/MarkupAccumulator.cpp
index cd5b7cf853720b2aae48ae7752776f50b440080a..e619430fa3c8aca7296fe6df2a86584503543494 100644
--- a/Source/core/editing/MarkupAccumulator.cpp
+++ b/Source/core/editing/MarkupAccumulator.cpp
@@ -138,7 +138,7 @@ void MarkupAccumulator::serializeNodesWithNamespaces(Node* targetNode, EChildren
if (!childrenOnly)
appendStartTag(targetNode, &namespaceHash);
- if (!(targetNode->document()->isHTMLDocument() && elementCannotHaveEndTag(targetNode))) {
+ if (!(targetNode->document().isHTMLDocument() && elementCannotHaveEndTag(targetNode))) {
Node* current = targetNode->hasTagName(templateTag) ? toHTMLTemplateElement(targetNode)->content()->firstChild() : targetNode->firstChild();
for ( ; current; current = current->nextSibling())
serializeNodesWithNamespaces(current, IncludeNode, &namespaceHash, tagNamesToSkip);
@@ -152,11 +152,11 @@ String MarkupAccumulator::resolveURLIfNeeded(const Element* element, const Strin
{
switch (m_resolveURLsMethod) {
case ResolveAllURLs:
- return element->document()->completeURL(urlString).string();
+ return element->document().completeURL(urlString).string();
case ResolveNonLocalURLs:
- if (!element->document()->url().isLocalFile())
- return element->document()->completeURL(urlString).string();
+ if (!element->document().url().isLocalFile())
+ return element->document().completeURL(urlString).string();
break;
case DoNotResolveURLs:
@@ -310,7 +310,7 @@ EntityMask MarkupAccumulator::entityMaskForText(Text* text) const
if (parentName && (*parentName == scriptTag || *parentName == styleTag || *parentName == xmpTag))
return EntityMaskInCDATA;
- return text->document()->isHTMLDocument() ? EntityMaskInHTMLPCDATA : EntityMaskInPCDATA;
+ return text->document().isHTMLDocument() ? EntityMaskInHTMLPCDATA : EntityMaskInPCDATA;
}
void MarkupAccumulator::appendText(StringBuilder& result, Text* text)
@@ -412,7 +412,7 @@ void MarkupAccumulator::appendOpenTag(StringBuilder& result, Element* element, N
{
result.append('<');
result.append(element->nodeNamePreservingCase());
- if (!element->document()->isHTMLDocument() && namespaces && shouldAddNamespaceElement(element))
+ if (!element->document().isHTMLDocument() && namespaces && shouldAddNamespaceElement(element))
appendNamespace(result, element->prefix(), element->namespaceURI(), *namespaces);
}
@@ -435,7 +435,7 @@ static inline bool attributeIsInSerializedNamespace(const Attribute& attribute)
void MarkupAccumulator::appendAttribute(StringBuilder& result, Element* element, const Attribute& attribute, Namespaces* namespaces)
{
- bool documentIsHTML = element->document()->isHTMLDocument();
+ bool documentIsHTML = element->document().isHTMLDocument();
result.append(' ');
@@ -520,7 +520,7 @@ void MarkupAccumulator::appendStartMarkup(StringBuilder& result, const Node* nod
// 4. Other elements self-close.
bool MarkupAccumulator::shouldSelfClose(const Node* node)
{
- if (node->document()->isHTMLDocument())
+ if (node->document().isHTMLDocument())
return false;
if (node->hasChildNodes())
return false;
« no previous file with comments | « Source/core/editing/InsertParagraphSeparatorCommand.cpp ('k') | Source/core/editing/MergeIdenticalElementsCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698