Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp |
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp |
| index cc5344d24e8ff07e7371e4340fbfbfc544fc5005..40cf78811c80de51a07504e3d886bf9c766bcc12 100644 |
| --- a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp |
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp |
| @@ -652,7 +652,13 @@ void HTMLConstructionSite::insertScriptElement(AtomicHTMLToken* token) |
| // those flags or effects thereof. |
| const bool parserInserted = m_parserContentPolicy != AllowScriptingContentAndDoNotMarkAlreadyStarted; |
| const bool alreadyStarted = m_isParsingFragment && parserInserted; |
| - RefPtrWillBeRawPtr<HTMLScriptElement> element = HTMLScriptElement::create(ownerDocumentForCurrentNode(), parserInserted, alreadyStarted); |
| + // TODO(csharrison): This logic only works if the tokenizer/parser was not |
| + // blocked waiting for scripts when the element was inserted. This usually |
| + // fails for instance, on second document.write if a script writes twice in |
| + // a row. To fix this, the parser might have to keep track of raw string |
| + // position. |
| + const bool createdDuringDocumentWrite = ownerDocumentForCurrentNode().isInDocumentWrite(); |
| + RefPtrWillBeRawPtr<HTMLScriptElement> element = HTMLScriptElement::create(ownerDocumentForCurrentNode(), parserInserted, alreadyStarted, createdDuringDocumentWrite); |
|
kouhei (in TOK)
2016/03/18 02:24:26
I think this is ok in this CL, but I'd appreciate
Charlie Harrison
2016/03/18 14:10:47
I'll do this refactor in this CL, but I'm hitting
kouhei (in TOK)
2016/03/22 04:18:39
See make_element_factory.py
https://code.google.co
|
| setAttributes(element.get(), token, m_parserContentPolicy); |
| if (scriptingContentIsAllowed(m_parserContentPolicy)) |
| attachLater(currentNode(), element); |