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

Unified Diff: Source/WebCore/dom/XMLDocumentParserLibxml2.cpp

Issue 7064010: Merge 87098 - 2011-05-23 James Simonsen <simonjam@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 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 | « no previous file | Source/WebCore/dom/XMLDocumentParserQt.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/XMLDocumentParserLibxml2.cpp
===================================================================
--- Source/WebCore/dom/XMLDocumentParserLibxml2.cpp (revision 87099)
+++ Source/WebCore/dom/XMLDocumentParserLibxml2.cpp (working copy)
@@ -847,12 +847,16 @@
return;
}
+ // JavaScript can detach the parser. Make sure this is not released
+ // before the end of this method.
+ RefPtr<XMLDocumentParser> protect(this);
+
exitText();
- Node* n = m_currentNode;
+ RefPtr<ContainerNode> n = m_currentNode;
n->finishParsingChildren();
- if (m_scriptingPermission == FragmentScriptingNotAllowed && n->isElementNode() && toScriptElement(static_cast<Element*>(n))) {
+ if (m_scriptingPermission == FragmentScriptingNotAllowed && n->isElementNode() && toScriptElement(static_cast<Element*>(n.get()))) {
popCurrentNode();
ExceptionCode ec;
n->remove(ec);
@@ -864,7 +868,7 @@
return;
}
- Element* element = static_cast<Element*>(n);
+ Element* element = static_cast<Element*>(n.get());
// The element's parent may have already been removed from document.
// Parsing continues in this case, but scripts aren't executed.
@@ -893,10 +897,6 @@
// FIXME: Script execution should be shared between
// the libxml2 and Qt XMLDocumentParser implementations.
- // JavaScript can detach the parser. Make sure this is not released
- // before the end of this method.
- RefPtr<XMLDocumentParser> protect(this);
-
if (scriptElement->readyToBeParserExecuted())
scriptElement->executeScript(ScriptSourceCode(scriptElement->scriptContent(), document()->url(), m_scriptStartPosition));
else if (scriptElement->willBeParserExecuted()) {
« no previous file with comments | « no previous file | Source/WebCore/dom/XMLDocumentParserQt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698