Bug 19879 - Inspector should support monitorEvents/un monitorEvents() in the command line
Summary: Inspector should support monitorEvents/un monitorEvents() in the command line
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 30324
Blocks: 14355
  Show dependency treegraph
 
Reported: 2008-07-03 06:58 PDT by Keishi Hattori
Modified: 2009-10-22 08:45 PDT (History)
4 users (show)

See Also:


Attachments
proposed patch (4.20 KB, patch)
2009-10-12 23:55 PDT, Keishi Hattori
pfeldman: review-
Details | Formatted Diff | Diff
proposed patch 2 (4.37 KB, patch)
2009-10-20 20:30 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keishi Hattori 2008-07-03 06:58:29 PDT
Inspector should support monitorEvents/un monitorEvents() in the command line for Firebug parity.
Comment 1 Adam Roben (:aroben) 2008-07-11 14:08:51 PDT
<rdar://problem/6070235>
Comment 2 Keishi Hattori 2009-10-12 23:55:02 PDT
Created attachment 41089 [details]
proposed patch

Consecutive events are not shown because of bug #30324
https://bugs.webkit.org/show_bug.cgi?id=30324

Usage:
monitorEvent(el) will log all events to el
monitorEvent(el, "click") will log "click" events
monitorEvent(el, ["keydown", "keyup"]) will log "keyup" and "keydown" events
monitorEvent(el, "mouse") will log all mouse related events
monitorEvent(el, "key") will log all key related events
unmonitorEvent(el) will turn off logging for all events
Comment 3 Pavel Feldman 2009-10-20 15:39:18 PDT
Comment on attachment 41089 [details]
proposed patch

> +                if (t[i] == \"mouse\") \

Use ===


> +                    te = te.concat([\"mousedown\", \"mouseup\", \"click\", \"dblclick\", \

Use splice instead in order not to create new array instances.

> +                if (t[i] == \"key\") \

Use ===


> +                o.removeEventListener

Should you test for addEventListener / removeEvent listener on an object?
Does monitorEvent(null) provide meaningful feedback well?

Other than that r+.
Comment 4 Keishi Hattori 2009-10-20 20:30:07 PDT
Created attachment 41545 [details]
proposed patch 2

(In reply to comment #3)
> > +                if (t[i] == \"mouse\") \
Fixed.
> > +                    te = te.concat([\"mousedown\", \"mouseup\", \"click\", \"dblclick\", \
Fixed.
> > +                if (t[i] == \"key\") \
Fixed.
> Should you test for addEventListener / removeEvent listener on an object?
Added tests.
> Does monitorEvent(null) provide meaningful feedback well?
I wasn't sure what to do. Should it print usage help or an error?
Comment 5 Pavel Feldman 2009-10-22 07:29:18 PDT
Comment on attachment 41545 [details]
proposed patch 2

FYI: we are currently working on TimelineAgent that is getting information from the instrumentation all over WebCore. Including the events. So it is already getting all the data you are collecting here. It is not bound to any particular object though, so it is a bit different, but still close!
Comment 6 WebKit Commit Bot 2009-10-22 08:45:55 PDT
Comment on attachment 41545 [details]
proposed patch 2

Clearing flags on attachment: 41545

Committed r49940: <http://trac.webkit.org/changeset/49940>
Comment 7 WebKit Commit Bot 2009-10-22 08:45:58 PDT
All reviewed patches have been landed.  Closing bug.