mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add onresize handler to GlobalEventHandlers
Refs: https://github.com/servo/servo/issues/7996 Rebased: https://github.com/servo/servo/pull/8006
This commit is contained in:
parent
5e1f0495a9
commit
d4fe40089b
7 changed files with 64 additions and 15 deletions
|
@ -162,6 +162,24 @@ impl HTMLElementMethods for HTMLElement {
|
|||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#handler-onresize
|
||||
fn GetOnresize(&self) -> Option<Rc<EventHandlerNonNull>> {
|
||||
if self.is_body_or_frameset() {
|
||||
window_from_node(self).GetOnload()
|
||||
} else {
|
||||
self.upcast::<EventTarget>().get_event_handler_common("resize")
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#handler-onresize
|
||||
fn SetOnresize(&self, listener: Option<Rc<EventHandlerNonNull>>) {
|
||||
if self.is_body_or_frameset() {
|
||||
window_from_node(self).SetOnresize(listener);
|
||||
} else {
|
||||
self.upcast::<EventTarget>().set_event_handler_common("resize", listener)
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-click
|
||||
fn Click(&self) {
|
||||
if let Some(i) = self.downcast::<HTMLInputElement>() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue