[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
pfeldman at chromium.org
pfeldman at chromium.org
Wed Mar 17 17:59:24 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit a0f5c8ee765ac56f995b6998a94fb6b9fe6ec4d6
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 25 17:55:45 2010 +0000
2010-02-25 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Dimitri Glazkov.
Web Inspector: make script lines count calculation lazy.
https://bugs.webkit.org/show_bug.cgi?id=35392
* inspector/front-end/Script.js:
(WebInspector.Script):
(WebInspector.Script.prototype.get linesCount):
* inspector/front-end/ScriptsPanel.js:
* inspector/front-end/SourceView.js:
(WebInspector.SourceView.prototype._addBreakpoint):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b111da5..bf290c0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-25 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Web Inspector: make script lines count calculation lazy.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35392
+
+ * inspector/front-end/Script.js:
+ (WebInspector.Script):
+ (WebInspector.Script.prototype.get linesCount):
+ * inspector/front-end/ScriptsPanel.js:
+ * inspector/front-end/SourceView.js:
+ (WebInspector.SourceView.prototype._addBreakpoint):
+
2010-02-25 James Choi <jchoi42 at pha.jhu.edu>
Reviewed by David Levin.
diff --git a/WebCore/inspector/front-end/Script.js b/WebCore/inspector/front-end/Script.js
index 58268d9..9be624a 100644
--- a/WebCore/inspector/front-end/Script.js
+++ b/WebCore/inspector/front-end/Script.js
@@ -32,13 +32,6 @@ WebInspector.Script = function(sourceID, sourceURL, source, startingLine, errorL
this.errorLine = errorLine;
this.errorMessage = errorMessage;
- this.linesCount = 0;
- var lastIndex = source.indexOf("\n");
- while (lastIndex !== -1) {
- lastIndex = source.indexOf("\n", lastIndex + 1)
- this.linesCount++;
- }
-
// if no URL, look for "//@ sourceURL=" decorator
// note that this sourceURL comment decorator is behavior that FireBug added
// in it's 1.1 release as noted in the release notes:
@@ -54,4 +47,15 @@ WebInspector.Script = function(sourceID, sourceURL, source, startingLine, errorL
}
WebInspector.Script.prototype = {
+ get linesCount()
+ {
+ if (!this.source)
+ return 0;
+ this._linesCount = 0;
+ var lastIndex = this.source.indexOf("\n");
+ while (lastIndex !== -1) {
+ lastIndex = this.source.indexOf("\n", lastIndex + 1)
+ this._linesCount++;
+ }
+ }
}
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 1ef709d..e2336ee 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -677,7 +677,7 @@ WebInspector.ScriptsPanel.prototype = {
option.representedObject = script.resource || script;
option.url = displayName;
option.startingLine = script.startingLine;
- option.text = script.resource ? displayName : String.sprintf("%s (%d - %d)", displayName, script.startingLine, script.startingLine + script.linesCount);
+ option.text = script.resource ? displayName : String.sprintf("%s:%d", displayName, script.startingLine);
function optionCompare(a, b)
{
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js
index 382d840..b401c12 100644
--- a/WebCore/inspector/front-end/SourceView.js
+++ b/WebCore/inspector/front-end/SourceView.js
@@ -92,12 +92,13 @@ WebInspector.SourceView.prototype = {
_addBreakpoint: function(line)
{
var sourceID = null;
+ var closestStartingLine = 0;
var scripts = this.resource.scripts;
for (var i = 0; i < scripts.length; ++i) {
var script = scripts[i];
- if (script.startingLine <= line && script.startingLine + script.linesCount > line) {
+ if (script.startingLine <= line && script.startingLine >= closestStartingLine) {
+ closestStartingLine = script.startingLine;
sourceID = script.sourceID;
- break;
}
}
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index a113875..9a90bfb 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,19 @@
+2010-02-25 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Web Inspector: make script lines count calculation lazy.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35392
+
+ * src/js/Tests.js:
+ (.TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh.waitUntilScriptIsParsed):
+ (.TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh.checkScriptsPanel):
+ (.TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh):
+ (.TestSuite.prototype.testNoScriptDuplicatesOnPanelSwitch.checkScriptsPanel):
+ (.TestSuite.prototype.testAutoContinueOnSyntaxError.checkScriptsList):
+ (.TestSuite.prototype._executeFunctionForStepTest):
+
2010-02-24 Darin Fisher <darin at chromium.org>
Reviewed by David Levin.
diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js
index fa0c99f..ce1ecbf 100644
--- a/WebKit/chromium/src/js/Tests.js
+++ b/WebKit/chromium/src/js/Tests.js
@@ -295,7 +295,7 @@ TestSuite.prototype.testResourceContentLength = function()
var resource = WebInspector.resources[identifier];
if (!resource || !resource.url)
return;
- if (resource.url.search("image.html$") !== -1) {
+ if (resource.url.search("image.html") !== -1) {
var expectedLength = 87;
test.assertTrue(
resource.contentLength <= expectedLength,
@@ -470,7 +470,7 @@ TestSuite.prototype.testShowScriptsTab = function()
this.showPanel("scripts");
var test = this;
// There should be at least main page script.
- this._waitUntilScriptsAreParsed(["debugger_test_page.html$"],
+ this._waitUntilScriptsAreParsed(["debugger_test_page.html"],
function() {
test.releaseControl();
});
@@ -502,7 +502,7 @@ TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh = function()
var parsed = devtools.tools.getDebuggerAgent().parsedScripts_;
for (var id in parsed) {
var url = parsed[id].getUrl();
- if (url && url.search("debugger_test_page.html$") !== -1) {
+ if (url && url.search("debugger_test_page.html") !== -1) {
checkScriptsPanel();
return;
}
@@ -512,7 +512,7 @@ TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh = function()
function checkScriptsPanel() {
test.showPanel("scripts");
- test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html$"]), "Inspected script not found in the scripts list");
+ test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]), "Inspected script not found in the scripts list");
test.releaseControl();
}
@@ -530,7 +530,7 @@ TestSuite.prototype.testContentScriptIsPresent = function()
var test = this;
test._waitUntilScriptsAreParsed(
- ["page_with_content_script.html$", "simple_content_script.js$"],
+ ["page_with_content_script.html", "simple_content_script.js"],
function() {
test.releaseControl();
});
@@ -568,7 +568,7 @@ TestSuite.prototype.testNoScriptDuplicatesOnPanelSwitch = function()
function checkScriptsPanel() {
test.assertTrue(!!WebInspector.panels.scripts.visibleView, "No visible script view.");
- test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html$"]), "Some scripts are missing.");
+ test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]), "Some scripts are missing.");
checkNoDuplicates();
test.releaseControl();
}
@@ -584,7 +584,7 @@ TestSuite.prototype.testNoScriptDuplicatesOnPanelSwitch = function()
}
test._waitUntilScriptsAreParsed(
- ["debugger_test_page.html$"],
+ ["debugger_test_page.html"],
function() {
checkNoDuplicates();
setTimeout(switchToElementsTab, 0);
@@ -643,7 +643,7 @@ TestSuite.prototype.testPauseOnException = function()
WebInspector.currentPanel.pauseOnExceptionButton.element.click();
}
- this._executeCodeWhenScriptsAreParsed("handleClick()", ["pause_on_exception.html$"]);
+ this._executeCodeWhenScriptsAreParsed("handleClick()", ["pause_on_exception.html"]);
this._waitForScriptPause(
{
@@ -913,7 +913,7 @@ TestSuite.prototype.testCompletionOnPause = function()
{
this.showPanel("scripts");
var test = this;
- this._executeCodeWhenScriptsAreParsed("handleClick()", ["completion_on_pause.html$"]);
+ this._executeCodeWhenScriptsAreParsed("handleClick()", ["completion_on_pause.html"]);
this._waitForScriptPause(
{
@@ -974,7 +974,7 @@ TestSuite.prototype.testAutoContinueOnSyntaxError = function()
// InjectedScript._ensureCommandLineAPIInstalled) since the page script
// contains a syntax error.
for (var i = 0 ; i < options.length; i++) {
- if (options[i].text.search("script_syntax_error.html$") !== -1)
+ if (options[i].text.search("script_syntax_error.html") !== -1)
test.fail("Script with syntax error should not be in the list of parsed scripts.");
}
}
@@ -1173,7 +1173,7 @@ TestSuite.prototype._waitUntilScriptsAreParsed = function(expectedScripts, callb
*/
TestSuite.prototype._executeFunctionForStepTest = function()
{
- this._executeCodeWhenScriptsAreParsed("a()", ["debugger_step.html$", "debugger_step.js$"]);
+ this._executeCodeWhenScriptsAreParsed("a()", ["debugger_step.html", "debugger_step.js"]);
};
@@ -1437,7 +1437,7 @@ TestSuite.prototype.testExpandScope = function()
this.showPanel("scripts");
var test = this;
- this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_closure.html$"]);
+ this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_closure.html"]);
this._waitForScriptPause(
{
@@ -1551,7 +1551,7 @@ TestSuite.prototype.testDebugIntrinsicProperties = function()
this.showPanel("scripts");
var test = this;
- this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_intrinsic_properties.html$"]);
+ this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_intrinsic_properties.html"]);
this._waitForScriptPause(
{
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list