diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-25 22:00:24 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-25 22:00:24 -0700 |
commit | 09b2efc7061337593d948c7fb11b9d80ba42df5a (patch) | |
tree | db3e2547a9be0dc0fbe4e678f89b31d74e59ca4e | |
parent | b99e794e6158dc7e7491079865aae7cb180842dd (diff) | |
parent | 889579c6ded1e019576a9203fd933466a2bced1c (diff) | |
download | servo-09b2efc7061337593d948c7fb11b9d80ba42df5a.tar.gz servo-09b2efc7061337593d948c7fb11b9d80ba42df5a.zip |
Auto merge of #10844 - sliz1:10740, r=frewsxcv
Implement the "progressevent" argument to Document::createEvent
Fixes https://github.com/servo/servo/issues/10740
<!-- 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/10844)
<!-- Reviewable:end -->
-rw-r--r-- | components/script/dom/document.rs | 3 | ||||
-rw-r--r-- | components/script/dom/progressevent.rs | 6 | ||||
-rw-r--r-- | tests/wpt/metadata/dom/events/ProgressEvent.html.ini | 5 | ||||
-rw-r--r-- | tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini | 24 |
4 files changed, 14 insertions, 24 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 9488c0bdc41..7d25e484aa3 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -68,6 +68,7 @@ use dom::node::{self, CloneChildrenFlag, Node, NodeDamage, window_from_node}; use dom::nodeiterator::NodeIterator; use dom::nodelist::NodeList; use dom::processinginstruction::ProcessingInstruction; +use dom::progressevent::ProgressEvent; use dom::range::Range; use dom::servohtmlparser::{ParserRoot, ParserRef, MutNullableParserField}; use dom::storageevent::StorageEvent; @@ -2183,6 +2184,8 @@ impl DocumentMethods for Document { Ok(Root::upcast(WebGLContextEvent::new_uninitialized(GlobalRef::Window(&self.window)))), "storageevent" => Ok(Root::upcast(StorageEvent::new_uninitialized(&self.window, self.URL()))), + "progressevent" => + Ok(Root::upcast(ProgressEvent::new_uninitialized(&self.window))), _ => Err(Error::NotSupported), } diff --git a/components/script/dom/progressevent.rs b/components/script/dom/progressevent.rs index 215bcdd3db4..4a3d3f3da7d 100644 --- a/components/script/dom/progressevent.rs +++ b/components/script/dom/progressevent.rs @@ -11,6 +11,7 @@ use dom::bindings::inheritance::Castable; use dom::bindings::js::Root; use dom::bindings::reflector::reflect_dom_object; use dom::event::{Event, EventBubbles, EventCancelable}; +use dom::window::Window; use string_cache::Atom; use util::str::DOMString; @@ -31,6 +32,11 @@ impl ProgressEvent { total: total } } + pub fn new_uninitialized(window: &Window) -> Root<ProgressEvent> { + reflect_dom_object(box ProgressEvent::new_inherited(false, 0, 0), + GlobalRef::Window(window), + ProgressEventBinding::Wrap) + } pub fn new(global: GlobalRef, type_: Atom, can_bubble: EventBubbles, cancelable: EventCancelable, length_computable: bool, loaded: u64, total: u64) -> Root<ProgressEvent> { diff --git a/tests/wpt/metadata/dom/events/ProgressEvent.html.ini b/tests/wpt/metadata/dom/events/ProgressEvent.html.ini new file mode 100644 index 00000000000..a9c5bc758d6 --- /dev/null +++ b/tests/wpt/metadata/dom/events/ProgressEvent.html.ini @@ -0,0 +1,5 @@ +[ProgressEvent.html] + type: testharness + bug: https://github.com/servo/servo/issues/10740 + [document.createEvent() should not work with ProgressEvent.] + expected: FAIL diff --git a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini index f740c29439b..b44b16fa3a2 100644 --- a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini +++ b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini @@ -253,30 +253,6 @@ [createEvent('POPSTATEEVENT') should be initialized correctly.] expected: FAIL - [ProgressEvent should be an alias for ProgressEvent.] - bug: https://github.com/servo/servo/issues/10740 - expected: FAIL - - [createEvent('ProgressEvent') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10740 - expected: FAIL - - [progressevent should be an alias for ProgressEvent.] - bug: https://github.com/servo/servo/issues/10740 - expected: FAIL - - [createEvent('progressevent') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10740 - expected: FAIL - - [PROGRESSEVENT should be an alias for ProgressEvent.] - bug: https://github.com/servo/servo/issues/10740 - expected: FAIL - - [createEvent('PROGRESSEVENT') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10740 - expected: FAIL - [SVGZoomEvent should be an alias for SVGZoomEvent.] expected: FAIL |