RESOLVED FIXED 107630
Implement MouseEvent constructor
https://bugs.webkit.org/show_bug.cgi?id=107630
Summary Implement MouseEvent constructor
Kentaro Hara
Reported 2013-01-22 22:06:08 PST
Spec: https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm The MouseEvent constructor should be implemented under a DOM4_EVENTS_CONSTRUCTOR flag.
Attachments
Patch (52.45 KB, patch)
2013-01-22 22:26 PST, Kentaro Hara
no flags
Patch (51.04 KB, patch)
2013-01-22 22:35 PST, Kentaro Hara
no flags
Fixed mac failures. Review? (50.87 KB, patch)
2013-01-22 23:41 PST, Kentaro Hara
no flags
Patch (84.37 KB, patch)
2013-01-23 17:50 PST, Kentaro Hara
no flags
patch for landing (84.29 KB, patch)
2013-01-23 21:31 PST, Kentaro Hara
no flags
Kentaro Hara
Comment 1 2013-01-22 22:26:31 PST
Kentaro Hara
Comment 2 2013-01-22 22:27:34 PST
Comment on attachment 184141 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184141&action=review > LayoutTests/fast/events/constructors/mouse-event-constructor-expected.txt:96 > +FAIL new MouseEvent('eventType', { clientX: 2147483647 }).clientX should be 2147483647. Was -1. > +PASS new MouseEvent('eventType', { clientX: -1 }).clientX is -1 > +FAIL new MouseEvent('eventType', { clientX: -2147483648 }).clientX should be -2147483648. Was 0. These two failures are binding issues. I'll file a bug. > LayoutTests/fast/events/constructors/mouse-event-constructor-expected.txt:117 > +FAIL new MouseEvent('eventType', { clientY: 2147483647 }).clientY should be 2147483647. Was -1. > +PASS new MouseEvent('eventType', { clientY: -1 }).clientY is -1 > +FAIL new MouseEvent('eventType', { clientY: -2147483648 }).clientY should be -2147483648. Was 0. Ditto.
Kentaro Hara
Comment 3 2013-01-22 22:29:06 PST
(In reply to comment #2) > > LayoutTests/fast/events/constructors/mouse-event-constructor-expected.txt:96 > > +FAIL new MouseEvent('eventType', { clientX: 2147483647 }).clientX should be 2147483647. Was -1. > > +PASS new MouseEvent('eventType', { clientX: -1 }).clientX is -1 > > +FAIL new MouseEvent('eventType', { clientX: -2147483648 }).clientX should be -2147483648. Was 0. > > These two failures are binding issues. I'll file a bug. s/are/are not/.
Early Warning System Bot
Comment 4 2013-01-22 22:33:50 PST
Early Warning System Bot
Comment 5 2013-01-22 22:34:55 PST
Kentaro Hara
Comment 6 2013-01-22 22:35:38 PST
Kentaro Hara
Comment 7 2013-01-22 23:41:52 PST
Created attachment 184158 [details] Fixed mac failures. Review?
Kentaro Hara
Comment 8 2013-01-23 01:28:49 PST
now bots are green:)
Adam Barth
Comment 9 2013-01-23 11:38:45 PST
Comment on attachment 184158 [details] Fixed mac failures. Review? View in context: https://bugs.webkit.org/attachment.cgi?id=184158&action=review > Source/WebCore/bindings/v8/Dictionary.cpp:473 > + // FIXME: When EventTarget is an interface and not a mixin, fix V8Node to V8EventTarget. > + v8::Handle<v8::Object> error = wrapper->FindInstanceInPrototypeChain(V8Node::GetTemplate()); So this only works with Nodes? Maybe we need a toEventTarget function in WrapperTypeInfo similar to the toActiveDOMObject function. > Source/WebCore/dom/MouseEvent.idl:35 > + [Conditional=POINTER_LOCK] readonly attribute long webkitMovementX; > + [Conditional=POINTER_LOCK] readonly attribute long webkitMovementY; These don't get InitializedByEventConstructor ? Nor do the "extensions" below?
Kentaro Hara
Comment 10 2013-01-23 17:50:14 PST
Kentaro Hara
Comment 11 2013-01-23 17:54:39 PST
(In reply to comment #9) > > Source/WebCore/bindings/v8/Dictionary.cpp:473 > > + // FIXME: When EventTarget is an interface and not a mixin, fix V8Node to V8EventTarget. > > + v8::Handle<v8::Object> error = wrapper->FindInstanceInPrototypeChain(V8Node::GetTemplate()); > > So this only works with Nodes? Maybe we need a toEventTarget function in WrapperTypeInfo similar to the toActiveDOMObject function. Done. Implemented WrapperTypeInfo::toEventTarget(). If you want to split the patch, I'd be happy to. Added a test case for this: shouldBe("new MouseEvent('eventType', { relatedTarget: xhr }).relatedTarget", "xhr"); > > Source/WebCore/dom/MouseEvent.idl:35 > > + [Conditional=POINTER_LOCK] readonly attribute long webkitMovementX; > > + [Conditional=POINTER_LOCK] readonly attribute long webkitMovementY; > > These don't get InitializedByEventConstructor ? Nor do the "extensions" below? I'm not sure if we should do that. They are not yet speced. In particular, for 'extensions' attributes, there is no straightforward way to initialize WebCore values from constructor.
Adam Barth
Comment 12 2013-01-23 21:27:59 PST
Comment on attachment 184367 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184367&action=review > Source/WebCore/bindings/scripts/CodeGenerator.pm:735 > +# FIXME: Rename to IsInheritInterface IsInheritedInterface ? I guess we can work out the proper name when we do the renaming. > Source/WebCore/bindings/scripts/CodeGenerator.pm:755 > +sub IsInheritExtendedAttribute IsInheritedExtendedAttribute ? DoesInheritExtendedAttribute? InheritsExtendedAttribute ? > Source/WebCore/bindings/v8/Dictionary.cpp:470 > + fprintf(stderr, "V8DOMWrapper::isDOMWrapper(v8Value)\n"); We should probably remove this line before landing.
Kentaro Hara
Comment 13 2013-01-23 21:31:37 PST
Created attachment 184397 [details] patch for landing
Kentaro Hara
Comment 14 2013-01-23 21:31:59 PST
(In reply to comment #12) > (From update of attachment 184367 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=184367&action=review > > > Source/WebCore/bindings/scripts/CodeGenerator.pm:735 > > +# FIXME: Rename to IsInheritInterface > > IsInheritedInterface ? I guess we can work out the proper name when we do the renaming. > > > Source/WebCore/bindings/scripts/CodeGenerator.pm:755 > > +sub IsInheritExtendedAttribute > > IsInheritedExtendedAttribute ? DoesInheritExtendedAttribute? InheritsExtendedAttribute ? > > > Source/WebCore/bindings/v8/Dictionary.cpp:470 > > + fprintf(stderr, "V8DOMWrapper::isDOMWrapper(v8Value)\n"); > > We should probably remove this line before landing. All fixed. Thanks!
WebKit Review Bot
Comment 15 2013-01-23 23:43:37 PST
Comment on attachment 184397 [details] patch for landing Clearing flags on attachment: 184397 Committed r140657: <http://trac.webkit.org/changeset/140657>
WebKit Review Bot
Comment 16 2013-01-23 23:43:44 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.