mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Expose PageTransitionEvent only in Window
This commit is contained in:
parent
ba0bf3a066
commit
bd5ffd2833
5 changed files with 10 additions and 13 deletions
|
@ -2622,7 +2622,7 @@ impl DocumentMethods for Document {
|
|||
"mouseevent" | "mouseevents" =>
|
||||
Ok(Root::upcast(MouseEvent::new_uninitialized(&self.window))),
|
||||
"pagetransitionevent" =>
|
||||
Ok(Root::upcast(PageTransitionEvent::new_uninitialized(self.window.upcast()))),
|
||||
Ok(Root::upcast(PageTransitionEvent::new_uninitialized(&self.window))),
|
||||
"popstateevent" =>
|
||||
Ok(Root::upcast(PopStateEvent::new_uninitialized(self.window.upcast()))),
|
||||
"progressevent" =>
|
||||
|
|
|
@ -11,7 +11,7 @@ use dom::bindings::js::Root;
|
|||
use dom::bindings::reflector::reflect_dom_object;
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::event::Event;
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::window::Window;
|
||||
use servo_atoms::Atom;
|
||||
use std::cell::Cell;
|
||||
|
||||
|
@ -30,19 +30,19 @@ impl PageTransitionEvent {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_uninitialized(global: &GlobalScope) -> Root<PageTransitionEvent> {
|
||||
pub fn new_uninitialized(window: &Window) -> Root<PageTransitionEvent> {
|
||||
reflect_dom_object(box PageTransitionEvent::new_inherited(),
|
||||
global,
|
||||
window,
|
||||
PageTransitionEventBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn new(global: &GlobalScope,
|
||||
pub fn new(window: &Window,
|
||||
type_: Atom,
|
||||
bubbles: bool,
|
||||
cancelable: bool,
|
||||
persisted: bool)
|
||||
-> Root<PageTransitionEvent> {
|
||||
let ev = PageTransitionEvent::new_uninitialized(global);
|
||||
let ev = PageTransitionEvent::new_uninitialized(window);
|
||||
ev.persisted.set(persisted);
|
||||
{
|
||||
let event = ev.upcast::<Event>();
|
||||
|
@ -51,11 +51,11 @@ impl PageTransitionEvent {
|
|||
ev
|
||||
}
|
||||
|
||||
pub fn Constructor(global: &GlobalScope,
|
||||
pub fn Constructor(window: &Window,
|
||||
type_: DOMString,
|
||||
init: &PageTransitionEventBinding::PageTransitionEventInit)
|
||||
-> Fallible<Root<PageTransitionEvent>> {
|
||||
Ok(PageTransitionEvent::new(global,
|
||||
Ok(PageTransitionEvent::new(window,
|
||||
Atom::from(type_),
|
||||
init.parent.bubbles,
|
||||
init.parent.cancelable,
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#the-pagetransitionevent-interface
|
||||
[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict), Exposed=(Window,Worker)]
|
||||
[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict),
|
||||
Exposed=Window]
|
||||
interface PageTransitionEvent : Event {
|
||||
readonly attribute boolean persisted;
|
||||
};
|
||||
|
|
|
@ -6,6 +6,3 @@
|
|||
[The PopStateEvent interface object should not be exposed.]
|
||||
expected: FAIL
|
||||
|
||||
[The PageTransitionEvent interface object should not be exposed.]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ test_interfaces([
|
|||
"MessageEvent",
|
||||
"MimeType",
|
||||
"MimeTypeArray",
|
||||
"PageTransitionEvent",
|
||||
"Performance",
|
||||
"PerformanceTiming",
|
||||
"Plugin",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue