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

Side by Side Diff: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp

Issue 2781713003: Enable module scripts in ScriptLoader (Closed)
Patch Set: Rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2008 Holger Hans Peter Freyther 7 * Copyright (C) 2008 Holger Hans Peter Freyther
8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 // Don't load external scripts for standalone documents (for now). 1111 // Don't load external scripts for standalone documents (for now).
1112 DCHECK(!pending_script_); 1112 DCHECK(!pending_script_);
1113 requesting_script_ = true; 1113 requesting_script_ = true;
1114 1114
1115 if (script_loader->PrepareScript( 1115 if (script_loader->PrepareScript(
1116 script_start_position_, 1116 script_start_position_,
1117 ScriptLoader::kAllowLegacyTypeInTypeAttribute)) { 1117 ScriptLoader::kAllowLegacyTypeInTypeAttribute)) {
1118 // FIXME: Script execution should be shared between 1118 // FIXME: Script execution should be shared between
1119 // the libxml2 and Qt XMLDocumentParser implementations. 1119 // the libxml2 and Qt XMLDocumentParser implementations.
1120 1120
1121 // XMLDocumentParser does not support module scripts.
1122 CHECK_EQ(script_loader->GetScriptType(), ScriptType::kClassic);
1123
1121 if (script_loader->ReadyToBeParserExecuted()) { 1124 if (script_loader->ReadyToBeParserExecuted()) {
1122 if (!script_loader->ExecuteScript(ClassicScript::Create(ScriptSourceCode( 1125 if (!script_loader->ExecuteScript(ClassicScript::Create(ScriptSourceCode(
1123 script_loader->ScriptContent(), GetDocument()->Url(), 1126 script_loader->ScriptContent(), GetDocument()->Url(),
1124 script_start_position_)))) { 1127 script_start_position_)))) {
1125 script_loader->DispatchErrorEvent(); 1128 script_loader->DispatchErrorEvent();
1126 return; 1129 return;
1127 } 1130 }
1128 } else if (script_loader->WillBeParserExecuted()) { 1131 } else if (script_loader->WillBeParserExecuted()) {
1129 pending_script_ = script_loader->GetResource(); 1132 pending_script_ = script_loader->GetResource();
1130 DCHECK_EQ(parser_blocking_pending_script_load_start_time_, 0.0); 1133 DCHECK_EQ(parser_blocking_pending_script_load_start_time_, 0.0);
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 RefPtr<XMLParserContext> parser = 1722 RefPtr<XMLParserContext> parser =
1720 XMLParserContext::CreateStringParser(&sax, &state); 1723 XMLParserContext::CreateStringParser(&sax, &state);
1721 String parse_string = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1724 String parse_string = "<?xml version=\"1.0\"?><attrs " + string + " />";
1722 ParseChunk(parser->Context(), parse_string); 1725 ParseChunk(parser->Context(), parse_string);
1723 FinishParsing(parser->Context()); 1726 FinishParsing(parser->Context());
1724 attrs_ok = state.got_attributes; 1727 attrs_ok = state.got_attributes;
1725 return state.attributes; 1728 return state.attributes;
1726 } 1729 }
1727 1730
1728 } // namespace blink 1731 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698