[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
podivilov at chromium.org
podivilov at chromium.org
Sun Feb 20 22:57:32 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 7cc98b23ae2ea9ed92e61ccda7b563256ea9d2a4
Author: podivilov at chromium.org <podivilov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 14 15:49:20 2011 +0000
2011-01-14 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: provide script column offset to frontend.
https://bugs.webkit.org/show_bug.cgi?id=52377
* parser/SourceCode.h:
(JSC::SourceCode::SourceCode):
(JSC::SourceCode::firstColumn):
2011-01-14 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: provide script column offset to frontend.
https://bugs.webkit.org/show_bug.cgi?id=52377
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::dispatchDidParseSource):
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
* bindings/v8/DebuggerScript.js:
():
* bindings/v8/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::dispatchDidParseSource):
* inspector/Inspector.idl:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::didParseSource):
* inspector/InspectorDebuggerAgent.h:
* inspector/ScriptDebugListener.h:
* inspector/front-end/DebuggerModel.js:
(WebInspector.DebuggerModel.prototype.parsedScriptSource):
* inspector/front-end/Script.js:
(WebInspector.Script):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 2e03171..eb8c885 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,14 @@
+2011-01-14 Pavel Podivilov <podivilov at chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: provide script column offset to frontend.
+ https://bugs.webkit.org/show_bug.cgi?id=52377
+
+ * parser/SourceCode.h:
+ (JSC::SourceCode::SourceCode):
+ (JSC::SourceCode::firstColumn):
+
2011-01-13 Darin Adler <darin at apple.com>
Reviewed by Geoff Garen.
diff --git a/Source/JavaScriptCore/parser/SourceCode.h b/Source/JavaScriptCore/parser/SourceCode.h
index 9ba4da3..a3ce759 100644
--- a/Source/JavaScriptCore/parser/SourceCode.h
+++ b/Source/JavaScriptCore/parser/SourceCode.h
@@ -31,6 +31,7 @@
#include "SourceProvider.h"
#include <wtf/RefPtr.h>
+#include <wtf/text/TextPosition.h>
namespace JSC {
@@ -41,22 +42,34 @@ namespace JSC {
, m_startChar(0)
, m_endChar(0)
, m_firstLine(0)
+ , m_firstColumn(0)
{
}
- SourceCode(PassRefPtr<SourceProvider> provider, int firstLine = 1)
+ SourceCode(PassRefPtr<SourceProvider> provider, int firstLine = 1, int firstColumn = 1)
: m_provider(provider)
, m_startChar(0)
, m_endChar(m_provider->length())
, m_firstLine(std::max(firstLine, 1))
+ , m_firstColumn(std::max(firstColumn, 1))
{
}
- SourceCode(PassRefPtr<SourceProvider> provider, int start, int end, int firstLine)
+ SourceCode(PassRefPtr<SourceProvider> provider, int start, int end, int firstLine, int firstColumn = 1)
: m_provider(provider)
, m_startChar(start)
, m_endChar(end)
, m_firstLine(std::max(firstLine, 1))
+ , m_firstColumn(std::max(firstColumn, 1))
+ {
+ }
+
+ SourceCode(PassRefPtr<SourceProvider> provider, const TextPosition1& startPosition)
+ : m_provider(provider)
+ , m_startChar(0)
+ , m_endChar(m_provider->length())
+ , m_firstLine(startPosition.m_line.oneBasedInt())
+ , m_firstColumn(startPosition.m_column.oneBasedInt())
{
}
@@ -70,6 +83,7 @@ namespace JSC {
bool isNull() const { return !m_provider; }
SourceProvider* provider() const { return m_provider.get(); }
int firstLine() const { return m_firstLine; }
+ int firstColumn() const { return m_firstColumn; }
int startOffset() const { return m_startChar; }
int endOffset() const { return m_endChar; }
const UChar* data() const { return m_provider->data() + m_startChar; }
@@ -80,6 +94,7 @@ namespace JSC {
int m_startChar;
int m_endChar;
int m_firstLine;
+ int m_firstColumn;
};
inline SourceCode makeSource(const UString& source, const UString& url = UString(), int firstLine = 1)
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 54f6955..c8ccd35 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2011-01-14 Pavel Podivilov <podivilov at chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: provide script column offset to frontend.
+ https://bugs.webkit.org/show_bug.cgi?id=52377
+
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::dispatchDidParseSource):
+ * bindings/js/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ * bindings/v8/DebuggerScript.js:
+ ():
+ * bindings/v8/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::dispatchDidParseSource):
+ * inspector/Inspector.idl:
+ * inspector/InspectorDebuggerAgent.cpp:
+ (WebCore::InspectorDebuggerAgent::didParseSource):
+ * inspector/InspectorDebuggerAgent.h:
+ * inspector/ScriptDebugListener.h:
+ * inspector/front-end/DebuggerModel.js:
+ (WebInspector.DebuggerModel.prototype.parsedScriptSource):
+ * inspector/front-end/Script.js:
+ (WebInspector.Script):
+
2011-01-14 Ilya Tikhonovsky <loislo at chromium.org>
Unreviewed one line fix for console-xhr-logging test.
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.cpp b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
index 10df223..9845277 100644
--- a/Source/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -287,12 +287,11 @@ void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, con
String sourceID = ustringToString(JSC::UString::number(source.provider()->asID()));
String url = ustringToString(source.provider()->url());
String data = ustringToString(JSC::UString(source.data(), source.length()));
- int firstLine = source.firstLine();
Vector<ScriptDebugListener*> copy;
copyToVector(listeners, copy);
for (size_t i = 0; i < copy.size(); ++i)
- copy[i]->didParseSource(sourceID, url, data, firstLine, worldType);
+ copy[i]->didParseSource(sourceID, url, data, source.firstLine() - 1, source.firstColumn() - 1, worldType);
}
void ScriptDebugServer::dispatchFailedToParseSource(const ListenerSet& listeners, const SourceCode& source, int errorLine, const String& errorMessage)
diff --git a/Source/WebCore/bindings/js/ScriptSourceCode.h b/Source/WebCore/bindings/js/ScriptSourceCode.h
index 092eeb8..6cf3987 100644
--- a/Source/WebCore/bindings/js/ScriptSourceCode.h
+++ b/Source/WebCore/bindings/js/ScriptSourceCode.h
@@ -44,7 +44,7 @@ class ScriptSourceCode {
public:
ScriptSourceCode(const String& source, const KURL& url = KURL(), const TextPosition1& startPosition = TextPosition1::minimumPosition())
: m_provider(StringSourceProvider::create(source, url.isNull() ? String() : url.string()))
- , m_code(m_provider, startPosition.m_line.oneBasedInt())
+ , m_code(m_provider, startPosition)
, m_url(url)
{
}
diff --git a/Source/WebCore/bindings/v8/DebuggerScript.js b/Source/WebCore/bindings/v8/DebuggerScript.js
index 50f791d..8c9d98e 100644
--- a/Source/WebCore/bindings/v8/DebuggerScript.js
+++ b/Source/WebCore/bindings/v8/DebuggerScript.js
@@ -83,8 +83,8 @@ DebuggerScript._formatScript = function(script)
id: script.id,
name: script.nameOrSourceURL(),
source: script.source,
- lineOffset: DebuggerScript._v8ToWebkitLineNumber(script.line_offset),
- lineCount: script.lineCount(),
+ lineOffset: script.line_offset,
+ columnOffset: script.column_offset,
scriptWorldType: scriptWorldType
};
}
diff --git a/Source/WebCore/bindings/v8/ScriptDebugServer.cpp b/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
index 4b4611a..1c70a0e 100644
--- a/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
@@ -447,6 +447,7 @@ void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8
toWebCoreStringWithNullOrUndefinedCheck(object->Get(v8::String::New("name"))),
toWebCoreStringWithNullOrUndefinedCheck(object->Get(v8::String::New("source"))),
object->Get(v8::String::New("lineOffset"))->ToInteger()->Value(),
+ object->Get(v8::String::New("columnOffset"))->ToInteger()->Value(),
static_cast<ScriptWorldType>(object->Get(v8::String::New("scriptWorldType"))->Int32Value()));
}
diff --git a/Source/WebCore/inspector/Inspector.idl b/Source/WebCore/inspector/Inspector.idl
index 2d89b4a..05c8849 100644
--- a/Source/WebCore/inspector/Inspector.idl
+++ b/Source/WebCore/inspector/Inspector.idl
@@ -231,7 +231,7 @@ module core {
[notify, domain=Debugger] void attachDebuggerWhenShown(); // FIXME: do something with this eventually.
- [notify, domain=Debugger] void parsedScriptSource(out String sourceID, out String url, out String data, out int firstLine, out int scriptWorldType);
+ [notify, domain=Debugger] void parsedScriptSource(out String sourceID, out String url, out int lineOffset, out int columnOffset, out int scriptWorldType);
[notify, domain=Debugger] void failedToParseScriptSource(out String url, out String data, out int firstLine, out int errorLine, out String errorMessage);
[domain=Debugger] void activateBreakpoints();
diff --git a/Source/WebCore/inspector/InspectorDebuggerAgent.cpp b/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
index e999c75..82c250a 100644
--- a/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
@@ -199,10 +199,10 @@ PassRefPtr<InspectorValue> InspectorDebuggerAgent::currentCallFrames()
// JavaScriptDebugListener functions
-void InspectorDebuggerAgent::didParseSource(const String& sourceID, const String& url, const String& data, int firstLine, ScriptWorldType worldType)
+void InspectorDebuggerAgent::didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, ScriptWorldType worldType)
{
// Don't send script content to the front end until it's really needed.
- m_frontend->parsedScriptSource(sourceID, url, "", firstLine, worldType);
+ m_frontend->parsedScriptSource(sourceID, url, lineOffset, columnOffset, worldType);
m_scriptIDToContent.set(sourceID, data);
diff --git a/Source/WebCore/inspector/InspectorDebuggerAgent.h b/Source/WebCore/inspector/InspectorDebuggerAgent.h
index de530d2..07d2ab9 100644
--- a/Source/WebCore/inspector/InspectorDebuggerAgent.h
+++ b/Source/WebCore/inspector/InspectorDebuggerAgent.h
@@ -87,7 +87,7 @@ private:
PassRefPtr<InspectorValue> currentCallFrames();
- virtual void didParseSource(const String& sourceID, const String& url, const String& data, int firstLine, ScriptWorldType);
+ virtual void didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, ScriptWorldType);
virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage);
virtual void didPause(ScriptState*);
virtual void didContinue();
diff --git a/Source/WebCore/inspector/ScriptDebugListener.h b/Source/WebCore/inspector/ScriptDebugListener.h
index 5973402..a28cabb 100644
--- a/Source/WebCore/inspector/ScriptDebugListener.h
+++ b/Source/WebCore/inspector/ScriptDebugListener.h
@@ -46,7 +46,7 @@ class ScriptDebugListener {
public:
virtual ~ScriptDebugListener() { }
- virtual void didParseSource(const String& sourceID, const String& url, const String& data, int firstLine, ScriptWorldType) = 0;
+ virtual void didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, ScriptWorldType) = 0;
virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) = 0;
virtual void didPause(ScriptState*) = 0;
virtual void didContinue() = 0;
diff --git a/Source/WebCore/inspector/front-end/DebuggerModel.js b/Source/WebCore/inspector/front-end/DebuggerModel.js
index a1762cd..a02b544 100644
--- a/Source/WebCore/inspector/front-end/DebuggerModel.js
+++ b/Source/WebCore/inspector/front-end/DebuggerModel.js
@@ -191,9 +191,9 @@ WebInspector.DebuggerModel.prototype = {
delete this._lastHitBreakpoint;
},
- _parsedScriptSource: function(sourceID, sourceURL, source, startingLine, scriptWorldType)
+ _parsedScriptSource: function(sourceID, sourceURL, lineOffset, columnOffset, scriptWorldType)
{
- var script = new WebInspector.Script(sourceID, sourceURL, source, startingLine, undefined, undefined, scriptWorldType);
+ var script = new WebInspector.Script(sourceID, sourceURL, "", lineOffset, columnOffset, undefined, undefined, scriptWorldType);
this._scripts[sourceID] = script;
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, sourceID);
},
@@ -244,9 +244,9 @@ WebInspector.DebuggerDispatcher.prototype = {
WebInspector.panels.scripts.debuggerWasDisabled();
},
- parsedScriptSource: function(sourceID, sourceURL, source, startingLine, scriptWorldType)
+ parsedScriptSource: function(sourceID, sourceURL, lineOffset, columnOffset, scriptWorldType)
{
- this._debuggerModel._parsedScriptSource(sourceID, sourceURL, source, startingLine, scriptWorldType);
+ this._debuggerModel._parsedScriptSource(sourceID, sourceURL, lineOffset, columnOffset, scriptWorldType);
},
failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)
diff --git a/Source/WebCore/inspector/front-end/Script.js b/Source/WebCore/inspector/front-end/Script.js
index 527dd9d..d5f0243 100644
--- a/Source/WebCore/inspector/front-end/Script.js
+++ b/Source/WebCore/inspector/front-end/Script.js
@@ -23,12 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.Script = function(sourceID, sourceURL, source, startingLine, errorLine, errorMessage, worldType)
+WebInspector.Script = function(sourceID, sourceURL, source, lineOffset, columnOffset, errorLine, errorMessage, worldType)
{
this.sourceID = sourceID;
this.sourceURL = sourceURL;
this._source = source;
- this.startingLine = startingLine;
+ this.lineOffset = lineOffset;
+ this.columnOffset = columnOffset;
this.errorLine = errorLine;
this.errorMessage = errorMessage;
this.worldType = worldType;
@@ -58,6 +59,11 @@ WebInspector.Script.WorldType = {
}
WebInspector.Script.prototype = {
+ get startingLine()
+ {
+ return this.lineOffset + 1;
+ },
+
get linesCount()
{
if (!this.source)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list