[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
pfeldman at chromium.org
pfeldman at chromium.org
Wed Apr 7 23:18:10 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 01c47789870fa88f07d2bef9b618cca60b647980
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 2 09:37:27 2009 +0000
2009-11-01 Kelly Norton <knorton at google.com>
Reviewed by Timothy Hatcher.
Adds window event dispatches to InspectorTimelineAgent.
https://bugs.webkit.org/show_bug.cgi?id=31002
* English.lproj/localizedStrings.js:
* dom/Node.cpp: Updated call site to willDispatchEvent and didDispatchEvent.
(WebCore::Node::dispatchGenericEvent):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willDispatchEvent): Renamed.
(WebCore::InspectorTimelineAgent::didDispatchEvent): Renamed.
* inspector/InspectorTimelineAgent.h:
(WebCore::):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createEventDispatchRecord): Renamed.
* inspector/TimelineRecordFactory.h:
* inspector/front-end/TimelineAgent.js:
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._formatRecord):
(WebInspector.TimelinePanel.prototype._getRecordDetails):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchEvent):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c9355bb..4ce4f28 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2009-11-01 Kelly Norton <knorton at google.com>
+
+ Reviewed by Timothy Hatcher.
+
+ Adds window event dispatches to InspectorTimelineAgent.
+ https://bugs.webkit.org/show_bug.cgi?id=31002
+
+ * English.lproj/localizedStrings.js:
+ * dom/Node.cpp: Updated call site to willDispatchEvent and didDispatchEvent.
+ (WebCore::Node::dispatchGenericEvent):
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::willDispatchEvent): Renamed.
+ (WebCore::InspectorTimelineAgent::didDispatchEvent): Renamed.
+ * inspector/InspectorTimelineAgent.h:
+ (WebCore::):
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createEventDispatchRecord): Renamed.
+ * inspector/TimelineRecordFactory.h:
+ * inspector/front-end/TimelineAgent.js:
+ * inspector/front-end/TimelinePanel.js:
+ (WebInspector.TimelinePanel.prototype._formatRecord):
+ (WebInspector.TimelinePanel.prototype._getRecordDetails):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::dispatchEvent):
+
2009-11-01 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Timothy Hatcher.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 9442931..89556b4 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index effa00e..cbfde30 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -2479,7 +2479,7 @@ bool Node::dispatchGenericEvent(PassRefPtr<Event> prpEvent)
InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent();
bool timelineAgentIsActive = timelineAgent && eventHasListeners(event->type(), this, ancestors);
if (timelineAgentIsActive)
- timelineAgent->willDispatchDOMEvent(*event);
+ timelineAgent->willDispatchEvent(*event);
#endif
// Set up a pointer to indicate whether / where to dispatch window events.
@@ -2574,7 +2574,7 @@ doneDispatching:
doneWithDefault:
#if ENABLE(INSPECTOR)
if (timelineAgentIsActive)
- timelineAgent->didDispatchDOMEvent();
+ timelineAgent->didDispatchEvent();
#endif
Document::updateStyleForAllDocuments();
diff --git a/WebCore/inspector/InspectorTimelineAgent.cpp b/WebCore/inspector/InspectorTimelineAgent.cpp
index 237e34e..8b1fcb8 100644
--- a/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -51,14 +51,15 @@ InspectorTimelineAgent::~InspectorTimelineAgent()
{
}
-void InspectorTimelineAgent::willDispatchDOMEvent(const Event& event)
+void InspectorTimelineAgent::willDispatchEvent(const Event& event)
{
- pushCurrentRecord(TimelineRecordFactory::createDOMDispatchRecord(m_frontend, currentTimeInMilliseconds(), event), DOMDispatchTimelineRecordType);
+ pushCurrentRecord(TimelineRecordFactory::createEventDispatchRecord(m_frontend, currentTimeInMilliseconds(), event),
+ EventDispatchTimelineRecordType);
}
-void InspectorTimelineAgent::didDispatchDOMEvent()
+void InspectorTimelineAgent::didDispatchEvent()
{
- didCompleteCurrentRecord(DOMDispatchTimelineRecordType);
+ didCompleteCurrentRecord(EventDispatchTimelineRecordType);
}
void InspectorTimelineAgent::willLayout()
diff --git a/WebCore/inspector/InspectorTimelineAgent.h b/WebCore/inspector/InspectorTimelineAgent.h
index 66f5601..5cfa9af 100644
--- a/WebCore/inspector/InspectorTimelineAgent.h
+++ b/WebCore/inspector/InspectorTimelineAgent.h
@@ -43,7 +43,7 @@ namespace WebCore {
// Must be kept in sync with TimelineAgent.js
enum TimelineRecordType {
- DOMDispatchTimelineRecordType = 0,
+ EventDispatchTimelineRecordType = 0,
LayoutTimelineRecordType = 1,
RecalculateStylesTimelineRecordType = 2,
PaintTimelineRecordType = 3,
@@ -65,8 +65,8 @@ namespace WebCore {
void resetFrontendProxyObject(InspectorFrontend*);
// Methods called from WebCore.
- void willDispatchDOMEvent(const Event&);
- void didDispatchDOMEvent();
+ void willDispatchEvent(const Event&);
+ void didDispatchEvent();
void willLayout();
void didLayout();
diff --git a/WebCore/inspector/TimelineRecordFactory.cpp b/WebCore/inspector/TimelineRecordFactory.cpp
index 9a0a584..278e7fb 100644
--- a/WebCore/inspector/TimelineRecordFactory.cpp
+++ b/WebCore/inspector/TimelineRecordFactory.cpp
@@ -39,7 +39,6 @@
#include "ScriptObject.h"
namespace WebCore {
-// static
ScriptObject TimelineRecordFactory::createGenericRecord(InspectorFrontend* frontend, double startTime)
{
ScriptObject record = frontend->newScriptObject();
@@ -47,8 +46,7 @@ ScriptObject TimelineRecordFactory::createGenericRecord(InspectorFrontend* front
return record;
}
-// static
-ScriptObject TimelineRecordFactory::createDOMDispatchRecord(InspectorFrontend* frontend, double startTime, const Event& event)
+ScriptObject TimelineRecordFactory::createEventDispatchRecord(InspectorFrontend* frontend, double startTime, const Event& event)
{
ScriptObject record = createGenericRecord(frontend, startTime);
ScriptObject data = frontend->newScriptObject();
@@ -57,7 +55,6 @@ ScriptObject TimelineRecordFactory::createDOMDispatchRecord(InspectorFrontend* f
return record;
}
-// static
ScriptObject TimelineRecordFactory::createGenericTimerRecord(InspectorFrontend* frontend, double startTime, int timerId)
{
ScriptObject record = createGenericRecord(frontend, startTime);
@@ -67,7 +64,6 @@ ScriptObject TimelineRecordFactory::createGenericTimerRecord(InspectorFrontend*
return record;
}
-// static
ScriptObject TimelineRecordFactory::createTimerInstallRecord(InspectorFrontend* frontend, double startTime, int timerId, int timeout, bool singleShot)
{
ScriptObject record = createGenericRecord(frontend, startTime);
@@ -79,7 +75,6 @@ ScriptObject TimelineRecordFactory::createTimerInstallRecord(InspectorFrontend*
return record;
}
-// static
ScriptObject TimelineRecordFactory::createXHRReadyStateChangeTimelineRecord(InspectorFrontend* frontend, double startTime, const String& url, int readyState)
{
ScriptObject record = createGenericRecord(frontend, startTime);
@@ -90,7 +85,6 @@ ScriptObject TimelineRecordFactory::createXHRReadyStateChangeTimelineRecord(Insp
return record;
}
-// static
ScriptObject TimelineRecordFactory::createXHRLoadTimelineRecord(InspectorFrontend* frontend, double startTime, const String& url)
{
ScriptObject record = createGenericRecord(frontend, startTime);
@@ -100,7 +94,6 @@ ScriptObject TimelineRecordFactory::createXHRLoadTimelineRecord(InspectorFronten
return record;
}
-// static
ScriptObject TimelineRecordFactory::createEvaluateScriptTimelineRecord(InspectorFrontend* frontend, double startTime, const String& url, double lineNumber)
{
ScriptObject item = createGenericRecord(frontend, startTime);
diff --git a/WebCore/inspector/TimelineRecordFactory.h b/WebCore/inspector/TimelineRecordFactory.h
index a43758e..2d2b882 100644
--- a/WebCore/inspector/TimelineRecordFactory.h
+++ b/WebCore/inspector/TimelineRecordFactory.h
@@ -43,7 +43,7 @@ namespace WebCore {
public:
static ScriptObject createGenericRecord(InspectorFrontend*, double startTime);
- static ScriptObject createDOMDispatchRecord(InspectorFrontend*, double startTime, const Event&);
+ static ScriptObject createEventDispatchRecord(InspectorFrontend*, double startTime, const Event&);
static ScriptObject createGenericTimerRecord(InspectorFrontend*, double startTime, int timerId);
diff --git a/WebCore/inspector/front-end/TimelineAgent.js b/WebCore/inspector/front-end/TimelineAgent.js
index b309f01..3ed1d7d 100644
--- a/WebCore/inspector/front-end/TimelineAgent.js
+++ b/WebCore/inspector/front-end/TimelineAgent.js
@@ -34,7 +34,7 @@ WebInspector.TimelineAgent = function() {
// Must be kept in sync with TimelineItem.h
WebInspector.TimelineAgent.RecordType = {
- DOMDispatch : 0,
+ EventDispatch : 0,
Layout : 1,
RecalculateStyles : 2,
Paint : 3,
diff --git a/WebCore/inspector/front-end/TimelinePanel.js b/WebCore/inspector/front-end/TimelinePanel.js
index 8160766..af3af24 100644
--- a/WebCore/inspector/front-end/TimelinePanel.js
+++ b/WebCore/inspector/front-end/TimelinePanel.js
@@ -141,7 +141,7 @@ WebInspector.TimelinePanel.prototype = {
if (!this._recordStyles) {
this._recordStyles = {};
var recordTypes = WebInspector.TimelineAgent.RecordType;
- this._recordStyles[recordTypes.DOMDispatch] = { title: WebInspector.UIString("DOM Event"), category: this.categories.scripting };
+ this._recordStyles[recordTypes.EventDispatch] = { title: WebInspector.UIString("Event"), category: this.categories.scripting };
this._recordStyles[recordTypes.Layout] = { title: WebInspector.UIString("Layout"), category: this.categories.rendering };
this._recordStyles[recordTypes.RecalculateStyles] = { title: WebInspector.UIString("Recalculate Style"), category: this.categories.rendering };
this._recordStyles[recordTypes.Paint] = { title: WebInspector.UIString("Paint"), category: this.categories.rendering };
@@ -174,7 +174,7 @@ WebInspector.TimelinePanel.prototype = {
_getRecordDetails: function(record)
{
switch (record.type) {
- case WebInspector.TimelineAgent.RecordType.DOMDispatch:
+ case WebInspector.TimelineAgent.RecordType.EventDispatch:
return record.data.type;
case WebInspector.TimelineAgent.RecordType.TimerInstall:
case WebInspector.TimelineAgent.RecordType.TimerRemove:
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 2c1ba2b..b33602c 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -53,6 +53,7 @@
#include "HTMLFrameOwnerElement.h"
#include "History.h"
#include "InspectorController.h"
+#include "InspectorTimelineAgent.h"
#include "Location.h"
#include "Media.h"
#include "MessageEvent.h"
@@ -1310,7 +1311,23 @@ bool DOMWindow::dispatchEvent(PassRefPtr<Event> prpEvent, PassRefPtr<EventTarget
event->setCurrentTarget(this);
event->setEventPhase(Event::AT_TARGET);
- return fireEventListeners(event.get());
+#if ENABLE(INSPECTOR)
+ InspectorTimelineAgent* timelineAgent = 0;
+ if (frame() && frame()->page())
+ timelineAgent = frame()->page()->inspectorTimelineAgent();
+ bool timelineAgentIsActive = timelineAgent && hasEventListeners(event->type());
+ if (timelineAgentIsActive)
+ timelineAgent->willDispatchEvent(*event);
+#endif
+
+ bool result = fireEventListeners(event.get());
+
+#if ENABLE(INSPECTOR)
+ if (timelineAgentIsActive)
+ timelineAgent->didDispatchEvent();
+#endif
+
+ return result;
}
void DOMWindow::removeAllEventListeners()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list