Bug 818976 - Part 1: Add supplement code and new tree op to support generated code in HTML5 parser. r=hsivonen

This commit is contained in:
William Chen
2013-03-26 00:15:23 -07:00
parent 53acfb50a8
commit 43d16f6276
5 changed files with 28 additions and 0 deletions

View File

@@ -31,6 +31,7 @@
#include "nsIServiceManager.h"
#include "nsEscape.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLTemplateElement.h"
#include "nsHtml5SVGLoadDispatcher.h"
#include "nsIURI.h"
#include "nsIProtocolHandler.h"
@@ -558,6 +559,13 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
nsCOMPtr<nsIContent> asContent = do_QueryInterface(docType);
return AppendToDocument(asContent, aBuilder);
}
case eTreeOpGetDocumentFragmentForTemplate: {
dom::HTMLTemplateElement* tempElem =
static_cast<dom::HTMLTemplateElement*>(*mOne.node);
nsRefPtr<dom::DocumentFragment> frag = tempElem->Content();
*mTwo.node = frag.get();
return rv;
}
case eTreeOpMarkAsBroken: {
aBuilder->MarkAsBroken(NS_ERROR_OUT_OF_MEMORY);
return rv;
@@ -811,3 +819,4 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
}
return rv; // keep compiler happy
}