Bug 171111

Summary: Web Inspector: source maps in <style> tags are not taken into account
Product: WebKit Reporter: Michał Gołębiowski-Owczarek <m.goleb+bugzilla>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: inspector-bugzilla-changes, manian, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Test using <link rel="stylesheet">
none
Test using a static <style> tag
none
Test using a <style> tag inserted dynamically none

Description Michał Gołębiowski-Owczarek 2017-04-21 05:26:42 PDT
Created attachment 307722 [details]
Test using <link rel="stylesheet">

Safari (both stable, TP & WebKit Nightly) doesn't apply source maps when styles are loaded using inline <style> tags with a source map comment rather than via a <link rel=stylesheet> tag.

I'm attaching 3 files - one using the link-based approach (via blob URLs), the other two using <style>s; one with a static HTML and the other one where the <style> tag is loaded dynamically.

This simulates what Webpack's popular style-loader does. The link-based approach has drawbacks (e.g. it makes CSS get applied asynchronously which may influence page behavior) so the style-loader may turn into using <style> tags exclusively.

The <style>-based approach works in Chrome & Firefox (with one caveat in Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=714101).

To reproduce:
1. Open the attached HTML files (maybe via a local static HTTP server)
2. Inspect "Test div"
3. Try to find information about the source map mapping. You'll find it only in the <link>-based file.
Comment 1 Michał Gołębiowski-Owczarek 2017-04-21 05:27:08 PDT
Created attachment 307723 [details]
Test using a static <style> tag
Comment 2 Michał Gołębiowski-Owczarek 2017-04-21 05:27:24 PDT
Created attachment 307724 [details]
Test using a <style> tag inserted dynamically
Comment 3 Radar WebKit Bug Importer 2017-04-24 16:45:52 PDT
<rdar://problem/31800458>