New issue
Advanced search Search tips

Issue 612829 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Use counters are incremented even if an event listener didn't actually fire

Project Member Reported by dtapu...@chromium.org, May 18 2016

Issue description

There are some Use counters in Event::fireEventListeners.

If an event listener was added for an event that doesn't bubble the Use counter might increase even though the event wasn't fired at the target.

For example:

addEventListener("mousewheel", function(e) { }, false);

dispatchEvent( new WheelEvent("wheel", {bubbles: false}) );

Will likely report a UMA metric.

There are a few other scenarios as well.

We should just likely use the result of whether we dispatched at least one listener or not.
 
Components: Blink>DOM Blink>Input
Labels: Hotlist-Input-Dev
Project Member

Comment 2 by bugdroid1@chromium.org, Sep 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4908e484c88c0de62483404d6d6a63515acf67af

commit 4908e484c88c0de62483404d6d6a63515acf67af
Author: dtapuska <dtapuska@chromium.org>
Date: Thu Sep 29 15:27:08 2016

Adjust use counters for editing and legacy events.

Editing events incorrectly counted all the time even if there wasn't a
listener. Only that the target had rareData on the element. I've
re-enumerated the use counter values because they were completely wrong.

For legacy events, fix the semantics but it is really a minor issue
that I don't think deserves new enumeration values.

BUG= 612829 

Review-Url: https://codereview.chromium.org/2380703002
Cr-Commit-Position: refs/heads/master@{#421825}

[modify] https://crrev.com/4908e484c88c0de62483404d6d6a63515acf67af/third_party/WebKit/Source/core/events/EventTarget.cpp
[modify] https://crrev.com/4908e484c88c0de62483404d6d6a63515acf67af/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/4908e484c88c0de62483404d6d6a63515acf67af/tools/metrics/histograms/histograms.xml

Status: Fixed (was: Assigned)

Sign in to add a comment