Web Inspector: Refactor SourceMapParser to enable range-based sourcemap
authorapavlov@chromium.org <apavlov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Dec 2012 14:13:53 +0000 (14:13 +0000)
committerapavlov@chromium.org <apavlov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Dec 2012 14:13:53 +0000 (14:13 +0000)
commitf0a29a73fbd7580c86890342ac2079f311de2d24
treef477095615b59b68b2315c8bf365c411416cbe69
parent13ae7bba07cf96adea444433fe34e1d3be4db991
Web Inspector: Refactor SourceMapParser to enable range-based sourcemap
https://bugs.webkit.org/show_bug.cgi?id=105764

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Test: inspector/styles/range-based-mapping.html

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/compile-front-end.py:
* inspector/front-end/CompilerScriptMapping.js:
(WebInspector.CompilerScriptMapping):
(WebInspector.CompilerScriptMapping.prototype.loadSourceMapForScript):
* inspector/front-end/SourceMap.js: Copied from Source/WebCore/inspector/front-end/CompilerScriptMapping.js.
(WebInspector.SourceMap):
  Abstract. Renamed from SourceMapParser and supports only direct (generated -> originating source) mapping via findEntry()
(WebInspector.SourceMap.prototype.sources):
(WebInspector.SourceMap.prototype.sourceContent):
(WebInspector.SourceMap.prototype._parseMappingPayload):
(WebInspector.SourceMap.prototype._parseSections):
(WebInspector.SourceMap.prototype._parseMap):
(WebInspector.SourceMap.prototype._isSeparator):
(WebInspector.SourceMap.prototype._decodeVLQ):
(WebInspector.SourceMap.prototype._canonicalizeURL):
(WebInspector.SourceMap.StringCharIterator):
(WebInspector.SourceMap.StringCharIterator.prototype.next):
(WebInspector.SourceMap.StringCharIterator.prototype.peek):
(WebInspector.SourceMap.StringCharIterator.prototype.hasNext):
(WebInspector.PositionBasedSourceMap):
  Extends SourceMap and provides direct (compiled -> original source)
  and reverse (original -> compiled source) position mapping via findEntryReversed().
(WebInspector.PositionBasedSourceMap.prototype.findEntry):
(WebInspector.PositionBasedSourceMap.prototype.findEntryReversed):
(WebInspector.PositionBasedSourceMap.prototype._parseMap):
(WebInspector.RangeBasedSourceMap):
  Extends SourceMap and provides direct range mapping
  (compiled source position -> original source range) via findSourceRange().
(WebInspector.RangeBasedSourceMap.MappingComparator):
(WebInspector.RangeBasedSourceMap.prototype.findSourceRange):
(WebInspector.RangeBasedSourceMap.prototype._rangeForStartIndex):
(WebInspector.SourceRange):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/inspector.html:

LayoutTests:

* http/tests/inspector/compiler-script-mapping-expected.txt:
* http/tests/inspector/compiler-script-mapping.html:
* inspector/styles/range-based-mapping-expected.txt: Added.
* inspector/styles/range-based-mapping.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138500 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/compiler-script-mapping-expected.txt
LayoutTests/http/tests/inspector/compiler-script-mapping.html
LayoutTests/inspector/styles/range-based-mapping-expected.txt [new file with mode: 0644]
LayoutTests/inspector/styles/range-based-mapping.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/inspector/compile-front-end.py
Source/WebCore/inspector/front-end/CompilerScriptMapping.js
Source/WebCore/inspector/front-end/SourceMap.js [new file with mode: 0644]
Source/WebCore/inspector/front-end/WebKit.qrc
Source/WebCore/inspector/front-end/inspector.html