aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/document.rs3
-rw-r--r--components/script/dom/webglcontextevent.rs11
-rw-r--r--tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini24
3 files changed, 14 insertions, 24 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 02d640f1715..f82188c7b86 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -77,6 +77,7 @@ use dom::touchevent::TouchEvent;
use dom::touchlist::TouchList;
use dom::treewalker::TreeWalker;
use dom::uievent::UIEvent;
+use dom::webglcontextevent::WebGLContextEvent;
use dom::window::{ReflowReason, Window};
use encoding::EncodingRef;
use encoding::all::UTF_8;
@@ -2168,6 +2169,8 @@ impl DocumentMethods for Document {
&TouchList::new(&self.window, &[]),
)
)),
+ "webglcontextevent" =>
+ Ok(Root::upcast(WebGLContextEvent::new_uninitialized(GlobalRef::Window(&self.window)))),
_ =>
Err(Error::NotSupported),
}
diff --git a/components/script/dom/webglcontextevent.rs b/components/script/dom/webglcontextevent.rs
index ac93727eb7c..fa785146499 100644
--- a/components/script/dom/webglcontextevent.rs
+++ b/components/script/dom/webglcontextevent.rs
@@ -41,6 +41,17 @@ impl WebGLContextEvent {
}
}
+ pub fn new_uninitialized(global_ref: GlobalRef) -> Root<WebGLContextEvent> {
+ // according to https://www.khronos.org/registry/webgl/specs/1.0/#5.15 this is
+ // additional information or the empty string if no additional information is
+ // available.
+ let status_message = DOMString::new();
+ reflect_dom_object(
+ box WebGLContextEvent::new_inherited(status_message),
+ global_ref,
+ WebGLContextEventBinding::Wrap)
+ }
+
pub fn new(global: GlobalRef,
type_: Atom,
bubbles: EventBubbles,
diff --git a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini
index dcf0da1cd09..a2f2eb8eda8 100644
--- a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini
+++ b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini
@@ -391,30 +391,6 @@
[createEvent('TRANSITIONEVENT') should be initialized correctly.]
expected: FAIL
- [WebGLContextEvent should be an alias for WebGLContextEvent.]
- bug: https://github.com/servo/servo/issues/10742
- expected: FAIL
-
- [createEvent('WebGLContextEvent') should be initialized correctly.]
- bug: https://github.com/servo/servo/issues/10742
- expected: FAIL
-
- [webglcontextevent should be an alias for WebGLContextEvent.]
- bug: https://github.com/servo/servo/issues/10742
- expected: FAIL
-
- [createEvent('webglcontextevent') should be initialized correctly.]
- bug: https://github.com/servo/servo/issues/10742
- expected: FAIL
-
- [WEBGLCONTEXTEVENT should be an alias for WebGLContextEvent.]
- bug: https://github.com/servo/servo/issues/10742
- expected: FAIL
-
- [createEvent('WEBGLCONTEXTEVENT') should be initialized correctly.]
- bug: https://github.com/servo/servo/issues/10742
- expected: FAIL
-
[WheelEvent should be an alias for WheelEvent.]
expected: FAIL