Bug 107004

Summary: Monitor usage of unprefixed and prefixed DOM events for CSS Transitions.
Product: WebKit Reporter: Alexis Menard (darktears) <menard>
Component: DOMAssignee: Alexis Menard (darktears) <menard>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ojan.autocc, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Alexis Menard (darktears) 2013-01-16 05:12:05 PST
Monitor usage of unprefixed and prefixed DOM event for CSS Transitions.
Comment 1 Alexis Menard (darktears) 2013-01-16 05:17:01 PST
Created attachment 182964 [details]
Patch
Comment 2 Alexis Menard (darktears) 2013-01-16 05:19:10 PST
Created attachment 182965 [details]
Patch
Comment 3 Adam Barth 2013-01-16 09:37:28 PST
Comment on attachment 182965 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=182965&action=review

> Source/WebCore/dom/EventTarget.cpp:174
> +        if (document->domWindow()) {
> +            if (event->type() == eventNames().transitionendEvent)
> +                FeatureObserver::observe(document->domWindow(), FeatureObserver::UnprefixedTransitionEndEvent);
> +            if (event->type() == eventNames().webkitTransitionEndEvent)
> +                FeatureObserver::observe(document->domWindow(), FeatureObserver::PrefixedTransitionEndEvent);
> +        }

This is fine, but you won't be able to correlate the two.  You might want to also observe when both are registered.
Comment 4 Adam Barth 2013-01-16 09:38:48 PST
Comment on attachment 182965 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=182965&action=review

> Source/WebCore/dom/EventTarget.cpp:164
> +static void observeEvent(const Event* event, const EventTarget* target)

Isn't the common case that event isn't for transitions?  If so, we might want to check for whether the event is transitionendEvent or webkitTransitionEndEvent early in this function.
Comment 5 Alexis Menard (darktears) 2013-01-16 09:41:16 PST
(In reply to comment #4)
> (From update of attachment 182965 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=182965&action=review
> 
> > Source/WebCore/dom/EventTarget.cpp:164
> > +static void observeEvent(const Event* event, const EventTarget* target)
> 
> Isn't the common case that event isn't for transitions?  If so, we might want to check for whether the event is transitionendEvent or webkitTransitionEndEvent early in this function.

Well in that function later I'll put the animation DOM events :).
Comment 6 Alexis Menard (darktears) 2013-01-16 09:43:08 PST
Comment on attachment 182965 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=182965&action=review

>>> Source/WebCore/dom/EventTarget.cpp:164
>>> +static void observeEvent(const Event* event, const EventTarget* target)
>> 
>> Isn't the common case that event isn't for transitions?  If so, we might want to check for whether the event is transitionendEvent or webkitTransitionEndEvent early in this function.
> 
> Well in that function later I'll put the animation DOM events :).

Well in fact before observeEvent is called I check (!prefixedTypeName.isEmpty()) which already filter regular events. You'll be in that function only if the event had a prefixed version.

>> Source/WebCore/dom/EventTarget.cpp:174
>> +        }
> 
> This is fine, but you won't be able to correlate the two.  You might want to also observe when both are registered.

I'm not sure to understand here.
Comment 7 Adam Barth 2013-01-16 10:46:23 PST
> >> Source/WebCore/dom/EventTarget.cpp:174
> >> +        }
> > 
> > This is fine, but you won't be able to correlate the two.  You might want to also observe when both are registered.
> 
> I'm not sure to understand here.

My understanding is that you're interested in knowing how often web pages are listening for both the prefixed and unprefixed versions of the same event.  The way you've written this patch, you'll learn how often they listening for each type of event, but you won't be able to figure out how often they're listening for *both* at the same time.
Comment 8 Alexis Menard (darktears) 2013-01-16 12:50:16 PST
Created attachment 183021 [details]
Patch
Comment 9 Alexis Menard (darktears) 2013-01-16 13:30:13 PST
Created attachment 183026 [details]
Patch
Comment 10 WebKit Review Bot 2013-01-16 14:00:10 PST
Comment on attachment 183026 [details]
Patch

Clearing flags on attachment: 183026

Committed r139922: <http://trac.webkit.org/changeset/139922>
Comment 11 WebKit Review Bot 2013-01-16 14:00:14 PST
All reviewed patches have been landed.  Closing bug.
Comment 12 Lucas Forschler 2019-02-06 09:19:04 PST
Mass move bugs into the DOM component.