[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
eric at webkit.org
eric at webkit.org
Thu Oct 29 20:49:59 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 248ef835c18fb5fe844e44b33684a2d5a8bd9c40
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 22 15:45:47 2009 +0000
2009-10-22 Keishi Hattori <casey.hattori at gmail.com>
Reviewed by Pavel Feldman.
Inspector should support monitorEvents/un monitorEvents() in the command line
https://bugs.webkit.org/show_bug.cgi?id=19879
* inspector/front-end/EventListenersSidebarPane.js:
(WebInspector.EventListenersSidebarPane.prototype.update.callback): Ignores event listeners generated by monitorEvent
* inspector/front-end/InjectedScript.js:
(InjectedScript._ensureCommandLineAPIInstalled): Added _inspectorCommandLineAPI._logEvent, _allEventTypes,
_normalizeEventTypes, monitorEvent, unmonitorEvent.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ce34993..8bad288 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-22 Keishi Hattori <casey.hattori at gmail.com>
+
+ Reviewed by Pavel Feldman.
+
+ Inspector should support monitorEvents/un monitorEvents() in the command line
+ https://bugs.webkit.org/show_bug.cgi?id=19879
+
+ * inspector/front-end/EventListenersSidebarPane.js:
+ (WebInspector.EventListenersSidebarPane.prototype.update.callback): Ignores event listeners generated by monitorEvent
+ * inspector/front-end/InjectedScript.js:
+ (InjectedScript._ensureCommandLineAPIInstalled): Added _inspectorCommandLineAPI._logEvent, _allEventTypes,
+ _normalizeEventTypes, monitorEvent, unmonitorEvent.
+
2009-10-21 Joseph Pecoraro <joepeck at webkit.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/inspector/front-end/EventListenersSidebarPane.js b/WebCore/inspector/front-end/EventListenersSidebarPane.js
index 55b8e55..c776aa2 100644
--- a/WebCore/inspector/front-end/EventListenersSidebarPane.js
+++ b/WebCore/inspector/front-end/EventListenersSidebarPane.js
@@ -71,6 +71,8 @@ WebInspector.EventListenersSidebarPane.prototype = {
var eventListener = eventListeners[i];
eventListener.node = WebInspector.domAgent.nodeForId(eventListener.nodeId);
delete eventListener.nodeId; // no longer needed
+ if (/^function _inspectorCommandLineAPI_logEvent\(/.test(eventListener.listener.toString()))
+ continue; // ignore event listeners generated by monitorEvent
var type = eventListener.type;
var section = sectionMap[type];
if (!section) {
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 3ce96d0..e7c8530 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -922,6 +922,44 @@ InjectedScript._ensureCommandLineAPIInstalled = function(evalFunction, evalObjec
values: function(o) { var a = []; for (var k in o) a.push(o[k]); return a; }, \
profile: function() { return console.profile.apply(console, arguments) }, \
profileEnd: function() { return console.profileEnd.apply(console, arguments) }, \
+ _logEvent: function _inspectorCommandLineAPI_logEvent(e) { console.log(e.type, e); }, \
+ _allEventTypes: [\"mouse\", \"key\", \"load\", \"unload\", \"abort\", \"error\", \
+ \"select\", \"change\", \"submit\", \"reset\", \"focus\", \"blur\", \
+ \"resize\", \"scroll\"], \
+ _normalizeEventTypes: function(t) { \
+ if (typeof t === \"undefined\") \
+ t = _inspectorCommandLineAPI._allEventTypes; \
+ else if (typeof t === \"string\") \
+ t = [t]; \
+ var i, te = []; \
+ for (i = 0; i < t.length; i++) { \
+ if (t[i] === \"mouse\") \
+ te.splice(0, 0, \"mousedown\", \"mouseup\", \"click\", \"dblclick\", \
+ \"mousemove\", \"mouseover\", \"mouseout\"); \
+ else if (t[i] === \"key\") \
+ te.splice(0, 0, \"keydown\", \"keyup\", \"keypress\"); \
+ else \
+ te.push(t[i]); \
+ } \
+ return te; \
+ }, \
+ monitorEvent: function(o, t) { \
+ if (!o || !o.addEventListener || !o.removeEventListener) \
+ return; \
+ t = _inspectorCommandLineAPI._normalizeEventTypes(t); \
+ for (i = 0; i < t.length; i++) { \
+ o.removeEventListener(t[i], _inspectorCommandLineAPI._logEvent, false); \
+ o.addEventListener(t[i], _inspectorCommandLineAPI._logEvent, false); \
+ } \
+ }, \
+ unmonitorEvent: function(o, t) { \
+ if (!o || !o.removeEventListener) \
+ return; \
+ t = _inspectorCommandLineAPI._normalizeEventTypes(t); \
+ for (i = 0; i < t.length; i++) { \
+ o.removeEventListener(t[i], _inspectorCommandLineAPI._logEvent, false); \
+ } \
+ }, \
_inspectedNodes: [], \
get $0() { return _inspectorCommandLineAPI._inspectedNodes[0] }, \
get $1() { return _inspectorCommandLineAPI._inspectedNodes[1] }, \
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list