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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 2885203006: [DevTools] inline modules should have correct text offset (Closed)
Patch Set: a Created 3 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
Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
index 6672d5d0cc23d3f61e605fe55bdf69b9e22c5ed3..35b734f7455c942c54753d7821bad3e3a62b50a0 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -479,6 +479,9 @@ bool ScriptLoader::PrepareScript(const TextPosition& script_start_position,
// base URL."
KURL base_url = element_document.BaseURL();
+ TextPosition position = element_document.IsInDocumentWrite()
+ ? TextPosition()
+ : script_start_position;
// 2. "Let script be the result of creating a module script using
// source text, settings, base URL, cryptographic nonce,
// parser state, and module script credentials mode."
@@ -486,7 +489,7 @@ bool ScriptLoader::PrepareScript(const TextPosition& script_start_position,
ToScriptStateForMainWorld(element_document.GetFrame()));
ModuleScript* module_script = ModuleScript::Create(
ScriptContent(), modulator, base_url, nonce, parser_state,
- credentials_mode, kSharableCrossOrigin);
+ credentials_mode, kSharableCrossOrigin, position);
// 3. "If this returns null, set the script's script to null and abort
// these substeps; the script is ready."

Powered by Google App Engine
This is Rietveld 408576698