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

implement composition event creation in Document.createEvent #25159

Merged
merged 1 commit into from Dec 12, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

implement composition event creation in Document.createEvent

  • Loading branch information
garasubo committed Dec 12, 2019
commit de939eb96d11ae56f6d92bde929f5177e3ba5d8f
@@ -21,6 +21,21 @@ pub struct CompositionEvent {
}

impl CompositionEvent {
pub fn new_inherited() -> CompositionEvent {
CompositionEvent {
uievent: UIEvent::new_inherited(),
data: DOMString::new(),
}
}

pub fn new_uninitialized(window: &Window) -> DomRoot<CompositionEvent> {
reflect_dom_object(
Box::new(CompositionEvent::new_inherited()),
window,
CompositionEventBinding::Wrap,
)
}

pub fn new(
window: &Window,
type_: DOMString,
@@ -3811,6 +3811,9 @@ impl DocumentMethods for Document {
"beforeunloadevent" => Ok(DomRoot::upcast(BeforeUnloadEvent::new_uninitialized(
&self.window,
))),
"compositionevent" | "textevent" => Ok(DomRoot::upcast(
CompositionEvent::new_uninitialized(&self.window),
)),
"closeevent" => Ok(DomRoot::upcast(CloseEvent::new_uninitialized(
self.window.upcast(),
))),
@@ -3,9 +3,6 @@
[If the event's initialized flag is not set, an InvalidStateError must be thrown (AnimationEvent).]
expected: FAIL
[If the event's initialized flag is not set, an InvalidStateError must be thrown (CompositionEvent).]
expected: FAIL

[If the event's initialized flag is not set, an InvalidStateError must be thrown (DeviceMotionEvent).]
expected: FAIL

@@ -24,9 +21,6 @@
[If the event's initialized flag is not set, an InvalidStateError must be thrown (SVGZoomEvents).]
expected: FAIL
[If the event's initialized flag is not set, an InvalidStateError must be thrown (TextEvent).]
expected: FAIL
[If the event's initialized flag is not set, an InvalidStateError must be thrown (TrackEvent).]
expected: FAIL

@@ -1,10 +1,4 @@
[Document-createEvent.https.html]
[createEvent('TextEvent') should be initialized correctly.]
expected: FAIL

[compositionevent should be an alias for CompositionEvent.]
expected: FAIL

[createEvent('DRAGEVENT') should be initialized correctly.]
expected: FAIL

@@ -20,12 +14,6 @@
[Should throw NOT_SUPPORTED_ERR for non-legacy event interface "ProgressEvent"]
expected: FAIL

[TEXTEVENT should be an alias for CompositionEvent.]
expected: FAIL

[createEvent('compositionevent') should be initialized correctly.]
expected: FAIL

[devicemotionevent should be an alias for DeviceMotionEvent.]
expected: FAIL

@@ -38,24 +26,12 @@
[DRAGEVENT should be an alias for DragEvent.]
expected: FAIL

[TextEvent should be an alias for CompositionEvent.]
expected: FAIL

[createEvent('COMPOSITIONEVENT') should be initialized correctly.]
expected: FAIL

[DEVICEORIENTATIONEVENT should be an alias for DeviceOrientationEvent.]
expected: FAIL

[createEvent('dragevent') should be initialized correctly.]
expected: FAIL

[createEvent('textevent') should be initialized correctly.]
expected: FAIL

[CompositionEvent should be an alias for CompositionEvent.]
expected: FAIL

[createEvent('DEVICEMOTIONEVENT') should be initialized correctly.]
expected: FAIL

@@ -68,15 +44,9 @@
[dragevent should be an alias for DragEvent.]
expected: FAIL

[textevent should be an alias for CompositionEvent.]
expected: FAIL

[Should throw NOT_SUPPORTED_ERR for non-legacy event interface "PopStateEvent"]
expected: FAIL

[createEvent('CompositionEvent') should be initialized correctly.]
expected: FAIL

[deviceorientationevent should be an alias for DeviceOrientationEvent.]
expected: FAIL

@@ -89,18 +59,12 @@
[createEvent('DEVICEORIENTATIONEVENT') should be initialized correctly.]
expected: FAIL

[createEvent('TEXTEVENT') should be initialized correctly.]
expected: FAIL

[createEvent('DragEvent') should be initialized correctly.]
expected: FAIL

[Should throw NOT_SUPPORTED_ERR for non-legacy event interface "ErrorEvent"]
expected: FAIL

[COMPOSITIONEVENT should be an alias for CompositionEvent.]
expected: FAIL

[createEvent('deviceorientationevent') should be initialized correctly.]
expected: FAIL

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.