Support "SourceMap" header (along with" X-SourceMap")

RESOLVED FIXED in Firefox 55

Status

()

Core
JavaScript Engine
RESOLVED FIXED
a year ago
10 months ago

People

(Reporter: fscholz, Assigned: tromey)

Tracking

(Blocks: 1 bug, {dev-doc-complete})

unspecified
mozilla55
dev-doc-complete
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

a year ago
It looks like bug 765993 introduced the X-SourceMap header.

WebKit also supports just "SourceMap", https://bugs.webkit.org/show_bug.cgi?id=114888

Unsure what Chrome does, but maybe we want to support the unprefixed version, too.
(Assignee)

Updated

a year ago
Blocks: 1339970
(Assignee)

Comment 1

a year ago
I think we do want to support it.
X-SourceMap is deprecated:
https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/
Assignee: nobody → ttromey
Comment hidden (mozreview-request)

Comment 3

a year ago
mozreview-review
Comment on attachment 8867810 [details]
Bug 1346936 - support SourceMap header in addition to X-SourceMap;

https://reviewboard.mozilla.org/r/139326/#review142712

Code-wise, looks great!

Can you please send an intent to ship for this to dev-platform as per https://wiki.mozilla.org/WebAPI/ExposureGuidelines?  Thanks!

::: dom/script/ScriptLoader.cpp:2736
(Diff revision 1)
>  
>      nsAutoCString sourceMapURL;
> +    rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("SourceMap"), sourceMapURL);
> +    if (NS_FAILED(rv)) {
> -    rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("X-SourceMap"), sourceMapURL);
> +      rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("X-SourceMap"), sourceMapURL);
> +    }

Do other UAs have this exact behavior (using SourceMap header and ignoring X-SourceMap if that exists, and otherwise falling back to X-SourceMap)?  I'm r+ing based on this assumption.

I'd appreciate if you can please clarify the specifcs in the intent to ship thread.
Attachment #8867810 - Flags: review?(ehsan) → review+
(Assignee)

Comment 4

a year ago
> Do other UAs have this exact behavior (using SourceMap header and ignoring X-SourceMap if that exists, and otherwise falling back to X-SourceMap)?  I'm r+ing based on this assumption.

I found this in chromium:

https://chromium.googlesource.com/chromium/src/third_party/+/master/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp#57

Still cloning webkit to dig in there, but given the path name, I would assume it does the same.

Comment 5

a year ago
(In reply to Tom Tromey :tromey from comment #4)
> > Do other UAs have this exact behavior (using SourceMap header and ignoring X-SourceMap if that exists, and otherwise falling back to X-SourceMap)?  I'm r+ing based on this assumption.
> 
> I found this in chromium:
> 
> https://chromium.googlesource.com/chromium/src/third_party/+/master/WebKit/
> Source/bindings/core/v8/ScriptSourceCode.cpp#57

Thanks for checking!

> Still cloning webkit to dig in there, but given the path name, I would
> assume it does the same.

If you mean the /WebKit/ in the path name, that doesn't mean much of anything any more after Blink forked WebKit.  Not much more than "ns" in our class names meaning NetScape.  :-)
(Assignee)

Comment 6

a year ago
> If you mean the /WebKit/ in the path name, that doesn't mean much of anything any more after Blink forked WebKit

Thanks.  I didn't know how much overlap there might still be.

Webkit does the same, see:

https://github.com/WebKit/webkit/blob/master/Source/WebCore/inspector/PageDebuggerAgent.cpp#L82-L88

I'll send the intent email soon.

Updated

a year ago
See Also: → bug 1365623

Comment 7

a year ago
Awesome, thanks for checking!

Comment 8

a year ago
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5ea7440b56ab
support SourceMap header in addition to X-SourceMap; r=Ehsan

Comment 9

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/5ea7440b56ab
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.