<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use dom::bindings::codegen::Bindings::ValidityStateBinding;
use dom::bindings::js::{JS, JSRef, Temporary};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::window::Window;
use std::cell::Cell;

#[deriving(Encodable)]
pub struct ValidityState {
    reflector_: Reflector,
    window: Cell<JS<Window>>,
    state: u8,
}

impl ValidityState {
    pub fn new_inherited(window: &JSRef<Window>) -> ValidityState {
        ValidityState {
            reflector_: Reflector::new(),
            window: Cell::new(JS::from_rooted(window)),
            state: 0,
        }
    }

    pub fn new(window: &JSRef<Window>) -> Temporary<ValidityState> {
        reflect_dom_object(box ValidityState::new_inherited(window),
                           window,
                           ValidityStateBinding::Wrap)
    }
}<commit_msg>Remove the unused window field from ValidityState.<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use dom::bindings::codegen::Bindings::ValidityStateBinding;
use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::window::Window;

#[deriving(Encodable)]
pub struct ValidityState {
    reflector_: Reflector,
    state: u8,
}

impl ValidityState {
    pub fn new_inherited() -> ValidityState {
        ValidityState {
            reflector_: Reflector::new(),
            state: 0,
        }
    }

    pub fn new(window: &JSRef<Window>) -> Temporary<ValidityState> {
        reflect_dom_object(box ValidityState::new_inherited(),
                           window,
                           ValidityStateBinding::Wrap)
    }
}
{'fraction_non_alphanumeric': 0.12033398821218075, 'fraction_numerical': 0.005893909626719057, 'mean_word_length': 3.057768924302789, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5552439', 'n_tokens_mistral': 619, 'n_tokens_neox': 620, 'n_words': 162}