Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 329e42fff238f8f575efeef32904cbb6d49ba9c3
      
https://github.com/WebKit/WebKit/commit/329e42fff238f8f575efeef32904cbb6d49ba9c3
  Author: Devin Rousso <[email protected]>
  Date:   2024-10-21 (Mon, 21 Oct 2024)

  Changed paths:
    M Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
    M Source/WebInspectorUI/UserInterface/Base/URLUtilities.js
    M Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
    M Source/WebInspectorUI/UserInterface/Models/SourceMap.js

  Log Message:
  -----------
  Web Inspector: add error cases to match new source map spec
https://bugs.webkit.org/show_bug.cgi?id=281034

Reviewed by Anne van Kesteren.

Spec: <https://tc39.es/source-map/>
Tests: <https://github.com/tc39/source-map-tests>

* Source/WebInspectorUI/UserInterface/Models/SourceMap.js:
(WI.SourceMap.prototype.calculateBlackboxSourceRangesForProtocol):
(WI.SourceMap.prototype._parseMappingPayload):
(WI.SourceMap.prototype._parseMap):
(WI.SourceMap.prototype._decodeVLQ):
(WI.SourceMap.prototype._invalidPropertyError): Added.
Add checks that each property is the right type/shape, as well as if linked 
propoties are valid (e.g. the indexes in `ignoreList` are keys in `sources`).
Reimplement the logic for parsing `mappings` and decoding VLQ values to more 
closely match the spec (e.g. the spec specifically handles VLQ integer 
overflow).

* Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.isSourceMapURL):
(WI.NetworkManager.prototype._loadAndParseSourceMap):
(WI.NetworkManager.prototype._sourceMapParseFailed): Added.
(WI.NetworkManager.prototype._sourceMapLoadAndParseFailed): Deleted.
Also include successfully loaded source map URLs when checking if a URL is a 
source map URL.
Drive-by: Show a console warning if the source map cannot be parsed.

* Source/WebInspectorUI/UserInterface/Base/URLUtilities.js:
(parseDataURL):
(WI.displayNameForURL):
(WI.truncateURL):
Drive-by: Don't assume that the given `url` is a string.

* Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:

Canonical link: https://commits.webkit.org/285541@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to