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

Unified Diff: sky/engine/core/html/parser/HTMLConstructionSite.cpp

Issue 680583003: Delete ScriptableDocumentParser (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Sort headers Created 6 years, 2 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: sky/engine/core/html/parser/HTMLConstructionSite.cpp
diff --git a/sky/engine/core/html/parser/HTMLConstructionSite.cpp b/sky/engine/core/html/parser/HTMLConstructionSite.cpp
index 882ebcee9437744ed9f28e375187a46fb462bfaa..ecf0785589380874a461587ea38ee751147d083f 100644
--- a/sky/engine/core/html/parser/HTMLConstructionSite.cpp
+++ b/sky/engine/core/html/parser/HTMLConstructionSite.cpp
@@ -46,10 +46,9 @@ namespace blink {
static const unsigned maximumHTMLParserDOMTreeDepth = 512;
-static inline void setAttributes(Element* element, AtomicHTMLToken* token, ParserContentPolicy parserContentPolicy)
+static inline void setAttributes(Element* element, AtomicHTMLToken* token)
{
- if (!scriptingContentIsAllowed(parserContentPolicy))
- element->stripScriptingAttributes(token->attributes());
+ element->stripScriptingAttributes(token->attributes());
element->parserSetAttributes(token->attributes());
}
@@ -211,8 +210,6 @@ void HTMLConstructionSite::queueTask(const HTMLConstructionSiteTask& task)
void HTMLConstructionSite::attachLater(ContainerNode* parent, PassRefPtrWillBeRawPtr<Node> prpChild, bool selfClosing)
{
- ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !prpChild.get()->isElementNode());
-
HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert);
task.parent = parent;
task.child = prpChild;
@@ -245,17 +242,15 @@ void HTMLConstructionSite::executeQueuedTasks()
// We might be detached now.
}
-HTMLConstructionSite::HTMLConstructionSite(Document* document, ParserContentPolicy parserContentPolicy)
+HTMLConstructionSite::HTMLConstructionSite(Document* document)
: m_document(document)
, m_attachmentRoot(document)
- , m_parserContentPolicy(parserContentPolicy)
{
}
-HTMLConstructionSite::HTMLConstructionSite(DocumentFragment* fragment, ParserContentPolicy parserContentPolicy)
+HTMLConstructionSite::HTMLConstructionSite(DocumentFragment* fragment)
: m_document(&fragment->document())
, m_attachmentRoot(fragment)
- , m_parserContentPolicy(parserContentPolicy)
{
}
@@ -322,9 +317,8 @@ void HTMLConstructionSite::insertSelfClosingHTMLElement(AtomicHTMLToken* token)
void HTMLConstructionSite::insertScriptElement(AtomicHTMLToken* token)
{
RefPtrWillBeRawPtr<HTMLScriptElement> element = HTMLScriptElement::create(ownerDocumentForCurrentNode());
- setAttributes(element.get(), token, m_parserContentPolicy);
- if (scriptingContentIsAllowed(m_parserContentPolicy))
- attachLater(currentNode(), element);
+ setAttributes(element.get(), token);
+ attachLater(currentNode(), element);
m_openElements.push(element.release());
}
@@ -349,7 +343,7 @@ PassRefPtrWillBeRawPtr<Element> HTMLConstructionSite::createElement(AtomicHTMLTo
{
QualifiedName tagName(token->name());
RefPtrWillBeRawPtr<Element> element = ownerDocumentForCurrentNode().createElement(tagName, true);
- setAttributes(element.get(), token, m_parserContentPolicy);
+ setAttributes(element.get(), token);
return element.release();
}
@@ -364,7 +358,7 @@ PassRefPtrWillBeRawPtr<HTMLElement> HTMLConstructionSite::createHTMLElement(Atom
{
Document& document = ownerDocumentForCurrentNode();
RefPtrWillBeRawPtr<HTMLElement> element = HTMLElementFactory::createHTMLElement(token->name(), document, true);
- setAttributes(element.get(), token, m_parserContentPolicy);
+ setAttributes(element.get(), token);
return element.release();
}
« no previous file with comments | « sky/engine/core/html/parser/HTMLConstructionSite.h ('k') | sky/engine/core/html/parser/HTMLDocumentParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698