Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for inline event handlers #1238

Closed
jdm opened this issue Nov 13, 2013 · 4 comments · Fixed by #2204
Closed

Add support for inline event handlers #1238

jdm opened this issue Nov 13, 2013 · 4 comments · Fixed by #2204
Labels
A-content/bindings The DOM bindings A-content/dom Interacting with the DOM from web content

Comments

@jdm
Copy link
Member

jdm commented Nov 13, 2013

Stuff like window.onload = function() { ... } and <body onload="...">. Needed for #1233.

@jdm
Copy link
Member Author

jdm commented Mar 18, 2014

Relevant Gecko prior art:
NS_IMPL_EVENT_HANDLER
http://mxr.mozilla.org/mozilla-central/source/dom/events/DOMEventTargetHelper.h#174 - nsDOMEventTargetHelper::SetEventHandler
http://mxr.mozilla.org/mozilla-central/source/dom/events/EventListenerManager.cpp#651 -
EventListenerManaged::SetEventHandler
http://mxr.mozilla.org/mozilla-central/source/dom/events/EventListenerManager.cpp#790 - EventListenerManager::CompileEventHandlerInternal

@jdm
Copy link
Member Author

jdm commented Apr 21, 2014

  • Steal Gecko's EventHandler.webidl (http://mxr.mozilla.org/mozilla-central/source/dom/webidl/EventHandler.webidl) and make Window and Document implement GlobalEventHandlers, and Window implement WindowEventHandlers.
  • Easy case for setting - check for a callable and take the same path as addEventListener
  • Harder case for setting - compile the string provider, stash it in a WebIDL callback type, and proceed along the same addEventListener path
  • Write macros for implementing common event handler setter and getter behaviour
  • Implement special window forwarding behaviour for things like body.onload

@jdm
Copy link
Member Author

jdm commented Apr 22, 2014

I'm puttering away at this at https://github.com/jdm/servo/tree/inlineev

@Manishearth
Copy link
Member

Blocks #2282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/bindings The DOM bindings A-content/dom Interacting with the DOM from web content
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants