mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #10831 - mskrzypkows:storageevent, r=Ms2ger
"storageevent" argument for Document::createEvent Fixes #10736 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10831) <!-- Reviewable:end -->
This commit is contained in:
commit
8bf732e633
3 changed files with 11 additions and 24 deletions
|
@ -70,6 +70,7 @@ use dom::nodelist::NodeList;
|
|||
use dom::processinginstruction::ProcessingInstruction;
|
||||
use dom::range::Range;
|
||||
use dom::servohtmlparser::{ParserRoot, ParserRef, MutNullableParserField};
|
||||
use dom::storageevent::StorageEvent;
|
||||
use dom::stylesheetlist::StyleSheetList;
|
||||
use dom::text::Text;
|
||||
use dom::touch::Touch;
|
||||
|
@ -2171,6 +2172,8 @@ impl DocumentMethods for Document {
|
|||
)),
|
||||
"webglcontextevent" =>
|
||||
Ok(Root::upcast(WebGLContextEvent::new_uninitialized(GlobalRef::Window(&self.window)))),
|
||||
"storageevent" =>
|
||||
Ok(Root::upcast(StorageEvent::new_uninitialized(&self.window, self.URL()))),
|
||||
_ =>
|
||||
Err(Error::NotSupported),
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference};
|
|||
use dom::bindings::reflector::reflect_dom_object;
|
||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||
use dom::storage::Storage;
|
||||
use dom::window::Window;
|
||||
use string_cache::Atom;
|
||||
use util::str::DOMString;
|
||||
|
||||
|
@ -42,6 +43,13 @@ impl StorageEvent {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_uninitialized(window: &Window,
|
||||
url: DOMString) -> Root<StorageEvent> {
|
||||
reflect_dom_object(box StorageEvent::new_inherited(None, None, None, url, None),
|
||||
GlobalRef::Window(window),
|
||||
StorageEventBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn new(global: GlobalRef,
|
||||
type_: Atom,
|
||||
bubbles: EventBubbles,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue