mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Auto merge of #25159 - garasubo:fix-composition-event, r=jdm
implement composition event creation in Document.createEvent Solved the problem mentioned in https://github.com/servo/servo/issues/24724#issuecomment-562326328 Add logic to create composition event for Document.createEvent. This resolved some WPT test failure, so updated the metadata as well Ref: https://developer.mozilla.org/en-US/docs/Web/API/Document/createEvent --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
82fd8d1daf
4 changed files with 18 additions and 42 deletions
|
@ -21,6 +21,21 @@ pub struct CompositionEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl 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(
|
pub fn new(
|
||||||
window: &Window,
|
window: &Window,
|
||||||
type_: DOMString,
|
type_: DOMString,
|
||||||
|
|
|
@ -3811,6 +3811,9 @@ impl DocumentMethods for Document {
|
||||||
"beforeunloadevent" => Ok(DomRoot::upcast(BeforeUnloadEvent::new_uninitialized(
|
"beforeunloadevent" => Ok(DomRoot::upcast(BeforeUnloadEvent::new_uninitialized(
|
||||||
&self.window,
|
&self.window,
|
||||||
))),
|
))),
|
||||||
|
"compositionevent" | "textevent" => Ok(DomRoot::upcast(
|
||||||
|
CompositionEvent::new_uninitialized(&self.window),
|
||||||
|
)),
|
||||||
"closeevent" => Ok(DomRoot::upcast(CloseEvent::new_uninitialized(
|
"closeevent" => Ok(DomRoot::upcast(CloseEvent::new_uninitialized(
|
||||||
self.window.upcast(),
|
self.window.upcast(),
|
||||||
))),
|
))),
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
[If the event's initialized flag is not set, an InvalidStateError must be thrown (AnimationEvent).]
|
[If the event's initialized flag is not set, an InvalidStateError must be thrown (AnimationEvent).]
|
||||||
expected: FAIL
|
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).]
|
[If the event's initialized flag is not set, an InvalidStateError must be thrown (DeviceMotionEvent).]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -24,9 +21,6 @@
|
||||||
[If the event's initialized flag is not set, an InvalidStateError must be thrown (SVGZoomEvents).]
|
[If the event's initialized flag is not set, an InvalidStateError must be thrown (SVGZoomEvents).]
|
||||||
expected: FAIL
|
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).]
|
[If the event's initialized flag is not set, an InvalidStateError must be thrown (TrackEvent).]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
[Document-createEvent.https.html]
|
[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.]
|
[createEvent('DRAGEVENT') should be initialized correctly.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -20,12 +14,6 @@
|
||||||
[Should throw NOT_SUPPORTED_ERR for non-legacy event interface "ProgressEvent"]
|
[Should throw NOT_SUPPORTED_ERR for non-legacy event interface "ProgressEvent"]
|
||||||
expected: FAIL
|
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.]
|
[devicemotionevent should be an alias for DeviceMotionEvent.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -38,24 +26,12 @@
|
||||||
[DRAGEVENT should be an alias for DragEvent.]
|
[DRAGEVENT should be an alias for DragEvent.]
|
||||||
expected: FAIL
|
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.]
|
[DEVICEORIENTATIONEVENT should be an alias for DeviceOrientationEvent.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[createEvent('dragevent') should be initialized correctly.]
|
[createEvent('dragevent') should be initialized correctly.]
|
||||||
expected: FAIL
|
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.]
|
[createEvent('DEVICEMOTIONEVENT') should be initialized correctly.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -68,15 +44,9 @@
|
||||||
[dragevent should be an alias for DragEvent.]
|
[dragevent should be an alias for DragEvent.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[textevent should be an alias for CompositionEvent.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Should throw NOT_SUPPORTED_ERR for non-legacy event interface "PopStateEvent"]
|
[Should throw NOT_SUPPORTED_ERR for non-legacy event interface "PopStateEvent"]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[createEvent('CompositionEvent') should be initialized correctly.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[deviceorientationevent should be an alias for DeviceOrientationEvent.]
|
[deviceorientationevent should be an alias for DeviceOrientationEvent.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -89,18 +59,12 @@
|
||||||
[createEvent('DEVICEORIENTATIONEVENT') should be initialized correctly.]
|
[createEvent('DEVICEORIENTATIONEVENT') should be initialized correctly.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[createEvent('TEXTEVENT') should be initialized correctly.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[createEvent('DragEvent') should be initialized correctly.]
|
[createEvent('DragEvent') should be initialized correctly.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Should throw NOT_SUPPORTED_ERR for non-legacy event interface "ErrorEvent"]
|
[Should throw NOT_SUPPORTED_ERR for non-legacy event interface "ErrorEvent"]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[COMPOSITIONEVENT should be an alias for CompositionEvent.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[createEvent('deviceorientationevent') should be initialized correctly.]
|
[createEvent('deviceorientationevent') should be initialized correctly.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue