- Revision
- 140666
- Author
- [email protected]
- Date
- 2013-01-24 01:20:21 -0800 (Thu, 24 Jan 2013)
Log Message
Web Inspector: breakpoints are not restored upon reload for scripts with script mapping.
https://bugs.webkit.org/show_bug.cgi?id=107799
Source/WebCore:
The problem is that source mapping is set after UISourceCode gets into the workspace.
Breakpoint manager will now only restore breakpoints upon setting the source maps.
Reviewed by Alexander Pavlov.
* inspector/front-end/BreakpointManager.js:
(WebInspector.BreakpointManager.prototype._uiSourceCodeAdded):
(WebInspector.BreakpointManager.prototype._uiSourceCodeMappingChanged):
* inspector/front-end/CompilerScriptMapping.js:
(WebInspector.CompilerScriptMapping.prototype.get addScript.get this):
(WebInspector.CompilerScriptMapping.prototype.get addScript):
LayoutTests:
Reviewed by Alexander Pavlov.
* inspector/debugger/breakpoint-manager.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (140665 => 140666)
--- trunk/LayoutTests/ChangeLog 2013-01-24 09:07:36 UTC (rev 140665)
+++ trunk/LayoutTests/ChangeLog 2013-01-24 09:20:21 UTC (rev 140666)
@@ -1,3 +1,12 @@
+2013-01-24 Pavel Feldman <[email protected]>
+
+ Web Inspector: breakpoints are not restored upon reload for scripts with script mapping.
+ https://bugs.webkit.org/show_bug.cgi?id=107799
+
+ Reviewed by Alexander Pavlov.
+
+ * inspector/debugger/breakpoint-manager.html:
+
2013-01-24 Mihnea Ovidenie <[email protected]>
[CSSRegions] Add test cases for auto-size regions and window resize
Modified: trunk/LayoutTests/inspector/debugger/breakpoint-manager.html (140665 => 140666)
--- trunk/LayoutTests/inspector/debugger/breakpoint-manager.html 2013-01-24 09:07:36 UTC (rev 140665)
+++ trunk/LayoutTests/inspector/debugger/breakpoint-manager.html 2013-01-24 09:20:21 UTC (rev 140666)
@@ -119,19 +119,19 @@
_addUISourceCode: function(url)
{
var uiSourceCode = new WebInspector.UISourceCode(this, url, url, url, WebInspector.resourceTypes.Script, false);
- uiSourceCode.setSourceMapping(defaultMapping);
uiSourceCodes[url] = uiSourceCode;
this.dispatchEventToListeners(WebInspector.UISourceCodeProvider.Events.UISourceCodeAdded, uiSourceCode);
+ uiSourceCode.setSourceMapping(defaultMapping);
return uiSourceCode;
},
_addTemporaryUISourceCode: function(url)
{
var uiSourceCode = new WebInspector.UISourceCode(this, "temporary:" + url, url, url, WebInspector.resourceTypes.Script, false);
- uiSourceCode.setSourceMapping(defaultMapping);
uiSourceCodes[url] = uiSourceCode;
temporaryUISourceCodes[url] = uiSourceCode;
this.dispatchEventToListeners(WebInspector.UISourceCodeProvider.Events.TemporaryUISourceCodeAdded, uiSourceCode);
+ uiSourceCode.setSourceMapping(defaultMapping);
return uiSourceCode;
},
Modified: trunk/Source/WebCore/ChangeLog (140665 => 140666)
--- trunk/Source/WebCore/ChangeLog 2013-01-24 09:07:36 UTC (rev 140665)
+++ trunk/Source/WebCore/ChangeLog 2013-01-24 09:20:21 UTC (rev 140666)
@@ -1,3 +1,20 @@
+2013-01-24 Pavel Feldman <[email protected]>
+
+ Web Inspector: breakpoints are not restored upon reload for scripts with script mapping.
+ https://bugs.webkit.org/show_bug.cgi?id=107799
+
+ The problem is that source mapping is set after UISourceCode gets into the workspace.
+ Breakpoint manager will now only restore breakpoints upon setting the source maps.
+
+ Reviewed by Alexander Pavlov.
+
+ * inspector/front-end/BreakpointManager.js:
+ (WebInspector.BreakpointManager.prototype._uiSourceCodeAdded):
+ (WebInspector.BreakpointManager.prototype._uiSourceCodeMappingChanged):
+ * inspector/front-end/CompilerScriptMapping.js:
+ (WebInspector.CompilerScriptMapping.prototype.get addScript.get this):
+ (WebInspector.CompilerScriptMapping.prototype.get addScript):
+
2013-01-24 Kent Tamura <[email protected]>
Refactoring: Use AtomicString for an InputType::create argument
Modified: trunk/Source/WebCore/inspector/front-end/BreakpointManager.js (140665 => 140666)
--- trunk/Source/WebCore/inspector/front-end/BreakpointManager.js 2013-01-24 09:07:36 UTC (rev 140665)
+++ trunk/Source/WebCore/inspector/front-end/BreakpointManager.js 2013-01-24 09:20:21 UTC (rev 140666)
@@ -94,7 +94,7 @@
{
var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
if (uiSourceCode.contentType() === WebInspector.resourceTypes.Script || uiSourceCode.contentType() === WebInspector.resourceTypes.Document) {
- this._restoreBreakpoints(uiSourceCode);
+ uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this);
uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.FormattedChanged, this._uiSourceCodeFormatted, this);
}
},
@@ -109,6 +109,15 @@
},
/**
+ * @param {WebInspector.Event} event
+ */
+ _uiSourceCodeMappingChanged: function(event)
+ {
+ var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.target);
+ this._restoreBreakpoints(uiSourceCode);
+ },
+
+ /**
* @param {WebInspector.UISourceCode} uiSourceCode
* @param {number} lineNumber
* @param {string} condition
Modified: trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js (140665 => 140666)
--- trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js 2013-01-24 09:07:36 UTC (rev 140665)
+++ trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js 2013-01-24 09:20:21 UTC (rev 140666)
@@ -101,6 +101,9 @@
return;
}
+ this._sourceMapForScriptId[script.scriptId] = sourceMap;
+ this._scriptForSourceMap.put(sourceMap, script);
+
var sourceURLs = sourceMap.sources();
for (var i = 0; i < sourceURLs.length; ++i) {
var sourceURL = sourceURLs[i];
@@ -123,8 +126,6 @@
uiSourceCode.isContentScript = script.isContentScript;
}
}
- this._sourceMapForScriptId[script.scriptId] = sourceMap;
- this._scriptForSourceMap.put(sourceMap, script);
script.pushSourceMapping(this);
},