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

Side by Side Diff: Source/core/xml/XMLErrors.cpp

Issue 49153006: Have ContainerNodeAlgorithms deal with references instead of pointers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true); 122 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true);
123 RefPtr<Element> body = m_document->createElement(bodyTag, true); 123 RefPtr<Element> body = m_document->createElement(bodyTag, true);
124 rootElement->parserAppendChild(body); 124 rootElement->parserAppendChild(body);
125 m_document->parserAppendChild(rootElement); 125 m_document->parserAppendChild(rootElement);
126 documentElement = body.get(); 126 documentElement = body.get();
127 } else if (documentElement->namespaceURI() == SVGNames::svgNamespaceURI) { 127 } else if (documentElement->namespaceURI() == SVGNames::svgNamespaceURI) {
128 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true); 128 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true);
129 RefPtr<Element> body = m_document->createElement(bodyTag, true); 129 RefPtr<Element> body = m_document->createElement(bodyTag, true);
130 rootElement->parserAppendChild(body); 130 rootElement->parserAppendChild(body);
131 131
132 m_document->parserRemoveChild(documentElement.get()); 132 m_document->parserRemoveChild(*documentElement);
133 133
134 body->parserAppendChild(documentElement); 134 body->parserAppendChild(documentElement);
135 m_document->parserAppendChild(rootElement); 135 m_document->parserAppendChild(rootElement);
136 136
137 documentElement = body.get(); 137 documentElement = body.get();
138 } 138 }
139 139
140 String errorMessages = m_errorMessages.toString(); 140 String errorMessages = m_errorMessages.toString();
141 RefPtr<Element> reportElement = createXHTMLParserErrorHeader(m_document, err orMessages); 141 RefPtr<Element> reportElement = createXHTMLParserErrorHeader(m_document, err orMessages);
142 142
(...skipping 10 matching lines...) Expand all
153 if (firstChild) 153 if (firstChild)
154 documentElement->parserInsertBefore(reportElement, documentElement->firs tChild()); 154 documentElement->parserInsertBefore(reportElement, documentElement->firs tChild());
155 else 155 else
156 documentElement->parserAppendChild(reportElement); 156 documentElement->parserAppendChild(reportElement);
157 157
158 // FIXME: Why do we need to call this manually? 158 // FIXME: Why do we need to call this manually?
159 m_document->updateStyleIfNeeded(); 159 m_document->updateStyleIfNeeded();
160 } 160 }
161 161
162 } // namespace WebCore 162 } // namespace WebCore
OLDNEW
« Source/core/dom/ContainerNode.cpp ('K') | « Source/core/svg/SVGElementInstance.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698