Remove the unused window field from ValidityState.

It is only necessary if the ValidityState would create new objects, which it
doesn't.
This commit is contained in:
Ms2ger 2014-07-14 11:20:14 +02:00
parent 91de702edb
commit 9317ff137a

View file

@ -3,29 +3,26 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::ValidityStateBinding; use dom::bindings::codegen::Bindings::ValidityStateBinding;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::window::Window; use dom::window::Window;
use std::cell::Cell;
#[deriving(Encodable)] #[deriving(Encodable)]
pub struct ValidityState { pub struct ValidityState {
reflector_: Reflector, reflector_: Reflector,
window: Cell<JS<Window>>,
state: u8, state: u8,
} }
impl ValidityState { impl ValidityState {
pub fn new_inherited(window: &JSRef<Window>) -> ValidityState { pub fn new_inherited() -> ValidityState {
ValidityState { ValidityState {
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: Cell::new(JS::from_rooted(window)),
state: 0, state: 0,
} }
} }
pub fn new(window: &JSRef<Window>) -> Temporary<ValidityState> { pub fn new(window: &JSRef<Window>) -> Temporary<ValidityState> {
reflect_dom_object(box ValidityState::new_inherited(window), reflect_dom_object(box ValidityState::new_inherited(),
window, window,
ValidityStateBinding::Wrap) ValidityStateBinding::Wrap)
} }