Summary: | Window object missing Animation/Transition event setter | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dean Jackson <dino> | ||||
Component: | DOM | Assignee: | Dean Jackson <dino> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | simon.fraser | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Mac | ||||||
OS: | OS X 10.5 | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 20361, 20572 | ||||||
Attachments: |
|
Description
Dean Jackson
2008-08-29 19:02:57 PDT
Created attachment 23078 [details]
patch with testcases
This patch also includes a code cleanup since a lot of this file violated the coding guidelines and hence offended my eyes. Check the next comment for the "real" patch.
Also, not all the tests included here are directly relevant to the fix in the patch, but are the tests that should have been landed with the events in the first place.
Lastly, there is an outstanding bug that makes using window pretty annoying. The event dispatch code only fires a transition event if the document was notified of a listener. If you attach only to Window then the Document doesn't know, and hence nothing happens. I'll file a separate bug on that. The workaround is to attach a transition event listener anywhere on the document (even if it isn't in the right place and is empty).
Here is the real meat of the patch (without coding style fixes): diff --git a/WebCore/bindings/js/JSDOMWindowBase.cpp b/WebCore/bindings/js/JSDOMWindowBase.cpp index 60ac671..7c3e4b2 100644 --- a/WebCore/bindings/js/JSDOMWindowBase.cpp +++ b/WebCore/bindings/js/JSDOMWindowBase.cpp @@ -749,6 +761,22 @@ void JSDOMWindowBase::put(ExecState* exec, const Identifier& propertyName, JSVal if (allowsAccessFrom(exec)) setListener(exec, unloadEvent, value); return; + case OnWebKitAnimationStart: + if (allowsAccessFrom(exec)) + setListener(exec, webkitAnimationStartEvent, value); + return; + case OnWebKitAnimationIteration: + if (allowsAccessFrom(exec)) + setListener(exec, webkitAnimationIterationEvent, value); + return; + case OnWebKitAnimationEnd: + if (allowsAccessFrom(exec)) + setListener(exec, webkitAnimationEndEvent, value); + return; + case OnWebKitTransitionEnd: + if (allowsAccessFrom(exec)) + setListener(exec, webkitTransitionEndEvent, value); + return; default: Comment on attachment 23078 [details]
patch with testcases
It'd be better to clean up the whitespace in a separate check-in first.
Comment on attachment 23078 [details]
patch with testcases
In general, we prefer if the test cases JS try and match our coding styles, but it is just something to think about in the future.
Code cleanup commit Committed r36020 M WebCore/bindings/js/JSDOMWindowBase.cpp M WebCore/ChangeLog Committed r36021 M WebCore/bindings/js/JSDOMWindowBase.cpp M WebCore/ChangeLog M LayoutTests/ChangeLog A LayoutTests/transitions/transition-end-event-all-properties.html A LayoutTests/transitions/transition-end-event-left-expected.txt A LayoutTests/transitions/transition-end-event-window.html A LayoutTests/transitions/transition-end-event-multiple-01.html A LayoutTests/transitions/transition-end-event-multiple-02.html A LayoutTests/transitions/transition-end-event-transform.html A LayoutTests/transitions/transition-end-event-multiple-03.html A LayoutTests/transitions/transition-end-event-multiple-04.html A LayoutTests/transitions/transition-end-event-all-properties-expected.txt A LayoutTests/transitions/transition-end-event-window-expected.txt A LayoutTests/transitions/end-event-helpers.js A LayoutTests/transitions/transition-end-event-container.html A LayoutTests/transitions/transition-end-event-nested.html A LayoutTests/transitions/transition-end-event-multiple-01-expected.txt A LayoutTests/transitions/transition-end-event-multiple-02-expected.txt A LayoutTests/transitions/transition-end-event-multiple-03-expected.txt A LayoutTests/transitions/transition-end-event-transform-expected.txt A LayoutTests/transitions/transition-end-event-attributes.html A LayoutTests/transitions/transition-end-event-multiple-04-expected.txt A LayoutTests/transitions/transition-end-event-left.html A LayoutTests/transitions/transition-end-event-container-expected.txt A LayoutTests/transitions/transition-end-event-nested-expected.txt A LayoutTests/transitions/transition-end-event-attributes-expected.txt |