mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Most of the code refactoring needed to be done is done with this commit.
This commit is contained in:
parent
dbec9d8454
commit
883902bd97
86 changed files with 469 additions and 469 deletions
|
@ -239,7 +239,7 @@ unsafe fn get_subframe_window(cx: *mut JSContext,
|
|||
rooted!(in(cx) let target = GetProxyPrivate(*proxy.ptr).to_object());
|
||||
let win = root_from_handleobject::<Window>(target.handle()).unwrap();
|
||||
let mut found = false;
|
||||
return win.IndexedGetter(index, &mut found);
|
||||
return win.indexed_getter(index, &mut found);
|
||||
}
|
||||
|
||||
None
|
||||
|
|
|
@ -49,7 +49,7 @@ impl DOMPointMethods for DOMPoint {
|
|||
|
||||
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-x
|
||||
fn SetX(&self, value: f64) {
|
||||
self.point.SetX(value);
|
||||
self.point.set_x(value);
|
||||
}
|
||||
|
||||
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-y
|
||||
|
@ -59,7 +59,7 @@ impl DOMPointMethods for DOMPoint {
|
|||
|
||||
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-y
|
||||
fn SetY(&self, value: f64) {
|
||||
self.point.SetY(value);
|
||||
self.point.set_y(value);
|
||||
}
|
||||
|
||||
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-z
|
||||
|
@ -69,7 +69,7 @@ impl DOMPointMethods for DOMPoint {
|
|||
|
||||
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-z
|
||||
fn SetZ(&self, value: f64) {
|
||||
self.point.SetZ(value);
|
||||
self.point.set_z(value);
|
||||
}
|
||||
|
||||
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-w
|
||||
|
@ -79,6 +79,6 @@ impl DOMPointMethods for DOMPoint {
|
|||
|
||||
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-w
|
||||
fn SetW(&self, value: f64) {
|
||||
self.point.SetW(value);
|
||||
self.point.set_w(value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,26 +69,26 @@ impl DOMPointReadOnlyMethods for DOMPointReadOnly {
|
|||
}
|
||||
|
||||
pub trait DOMPointWriteMethods {
|
||||
fn SetX(&self, value: f64);
|
||||
fn SetY(&self, value: f64);
|
||||
fn SetZ(&self, value: f64);
|
||||
fn SetW(&self, value: f64);
|
||||
fn set_x(&self, value: f64);
|
||||
fn set_y(&self, value: f64);
|
||||
fn set_z(&self, value: f64);
|
||||
fn set_w(&self, value: f64);
|
||||
}
|
||||
|
||||
impl DOMPointWriteMethods for DOMPointReadOnly {
|
||||
fn SetX(&self, value: f64) {
|
||||
fn set_x(&self, value: f64) {
|
||||
self.x.set(value);
|
||||
}
|
||||
|
||||
fn SetY(&self, value: f64) {
|
||||
fn set_y(&self, value: f64) {
|
||||
self.y.set(value);
|
||||
}
|
||||
|
||||
fn SetZ(&self, value: f64) {
|
||||
fn set_z(&self, value: f64) {
|
||||
self.z.set(value);
|
||||
}
|
||||
|
||||
fn SetW(&self, value: f64) {
|
||||
fn set_w(&self, value: f64) {
|
||||
self.w.set(value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,22 +39,22 @@ pub struct HTMLAnchorElement {
|
|||
}
|
||||
|
||||
impl HTMLAnchorElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLAnchorElement {
|
||||
HTMLAnchorElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
rel_list: Default::default(),
|
||||
url: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLAnchorElement> {
|
||||
Node::reflect_node(box HTMLAnchorElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLAnchorElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLAnchorElementBinding::Wrap)
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => USVString(String::new()),
|
||||
Some(ref url) => {
|
||||
// Steps 3-4.
|
||||
UrlHelper::Hash(url)
|
||||
UrlHelper::hash(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => return,
|
||||
// Steps 4-5.
|
||||
Some(url) => {
|
||||
UrlHelper::SetHash(url, value);
|
||||
UrlHelper::set_hash(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
}
|
||||
};
|
||||
|
@ -195,7 +195,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
USVString(String::new())
|
||||
} else {
|
||||
// Steps 4-5.
|
||||
UrlHelper::Host(url)
|
||||
UrlHelper::host(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetHost(url, value);
|
||||
UrlHelper::set_host(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
}
|
||||
};
|
||||
|
@ -231,7 +231,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => USVString(String::new()),
|
||||
Some(ref url) => {
|
||||
// Step 4.
|
||||
UrlHelper::Hostname(url)
|
||||
UrlHelper::hostname(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetHostname(url, value);
|
||||
UrlHelper::set_hostname(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
}
|
||||
};
|
||||
|
@ -291,7 +291,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
// Step 3.
|
||||
None => USVString(String::new()),
|
||||
// Steps 3-4.
|
||||
Some(ref url) => UrlHelper::Password(url)
|
||||
Some(ref url) => UrlHelper::password(url)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -307,7 +307,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetPassword(url, value);
|
||||
UrlHelper::set_password(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
}
|
||||
};
|
||||
|
@ -324,7 +324,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
// Step 3.
|
||||
None => USVString(String::new()),
|
||||
// Steps 4-5.
|
||||
Some(ref url) => UrlHelper::Pathname(url)
|
||||
Some(ref url) => UrlHelper::pathname(url)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -340,7 +340,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => return,
|
||||
// Step 5.
|
||||
Some(url) => {
|
||||
UrlHelper::SetPathname(url, value);
|
||||
UrlHelper::set_pathname(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
}
|
||||
};
|
||||
|
@ -357,7 +357,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
// Step 3.
|
||||
None => USVString(String::new()),
|
||||
// Step 4.
|
||||
Some(ref url) => UrlHelper::Port(url)
|
||||
Some(ref url) => UrlHelper::port(url)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -374,7 +374,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetPort(url, value);
|
||||
UrlHelper::set_port(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
}
|
||||
};
|
||||
|
@ -391,7 +391,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
// Step 2.
|
||||
None => USVString(":".to_owned()),
|
||||
// Step 3.
|
||||
Some(ref url) => UrlHelper::Protocol(url)
|
||||
Some(ref url) => UrlHelper::protocol(url)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -405,7 +405,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => return,
|
||||
// Step 3.
|
||||
Some(url) => {
|
||||
UrlHelper::SetProtocol(url, value);
|
||||
UrlHelper::set_protocol(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
}
|
||||
};
|
||||
|
@ -422,7 +422,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
// Step 2.
|
||||
None => USVString(String::new()),
|
||||
// Step 3.
|
||||
Some(ref url) => UrlHelper::Search(url)
|
||||
Some(ref url) => UrlHelper::search(url)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -439,7 +439,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
// TODO add this element's node document character encoding as
|
||||
// encoding override (as described in the spec)
|
||||
Some(url) => {
|
||||
UrlHelper::SetSearch(url, value);
|
||||
UrlHelper::set_search(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
}
|
||||
};
|
||||
|
@ -456,7 +456,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
// Step 2.
|
||||
None => USVString(String::new()),
|
||||
// Step 3.
|
||||
Some(ref url) => UrlHelper::Username(url)
|
||||
Some(ref url) => UrlHelper::username(url)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -472,7 +472,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
|
|||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetUsername(url, value);
|
||||
UrlHelper::set_username(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
}
|
||||
};
|
||||
|
|
|
@ -20,20 +20,20 @@ pub struct HTMLAppletElement {
|
|||
}
|
||||
|
||||
impl HTMLAppletElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLAppletElement {
|
||||
HTMLAppletElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLAppletElement> {
|
||||
Node::reflect_node(box HTMLAppletElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLAppletElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLAppletElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -23,18 +23,18 @@ pub struct HTMLAreaElement {
|
|||
}
|
||||
|
||||
impl HTMLAreaElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement {
|
||||
HTMLAreaElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
rel_list: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLAreaElement> {
|
||||
Node::reflect_node(box HTMLAreaElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLAreaElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLAreaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLAudioElement {
|
|||
}
|
||||
|
||||
impl HTMLAudioElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLAudioElement {
|
||||
HTMLAudioElement {
|
||||
htmlmediaelement:
|
||||
HTMLMediaElement::new_inherited(localName, prefix, document)
|
||||
HTMLMediaElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLAudioElement> {
|
||||
Node::reflect_node(box HTMLAudioElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLAudioElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLAudioElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -23,17 +23,17 @@ pub struct HTMLBaseElement {
|
|||
}
|
||||
|
||||
impl HTMLBaseElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement {
|
||||
HTMLBaseElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLBaseElement> {
|
||||
Node::reflect_node(box HTMLBaseElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLBaseElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLBaseElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -32,17 +32,17 @@ pub struct HTMLBodyElement {
|
|||
}
|
||||
|
||||
impl HTMLBodyElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
-> HTMLBodyElement {
|
||||
HTMLBodyElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
-> Root<HTMLBodyElement> {
|
||||
Node::reflect_node(box HTMLBodyElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLBodyElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLBodyElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct HTMLBRElement {
|
|||
}
|
||||
|
||||
impl HTMLBRElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBRElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBRElement {
|
||||
HTMLBRElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLBRElement> {
|
||||
Node::reflect_node(box HTMLBRElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLBRElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLBRElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -43,22 +43,22 @@ pub struct HTMLButtonElement {
|
|||
}
|
||||
|
||||
impl HTMLButtonElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLButtonElement {
|
||||
HTMLButtonElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document),
|
||||
local_name, prefix, document),
|
||||
button_type: Cell::new(ButtonType::Submit)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLButtonElement> {
|
||||
Node::reflect_node(box HTMLButtonElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLButtonElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLButtonElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -56,20 +56,20 @@ pub struct HTMLCanvasElement {
|
|||
}
|
||||
|
||||
impl HTMLCanvasElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLCanvasElement {
|
||||
HTMLCanvasElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
context: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLCanvasElement> {
|
||||
Node::reflect_node(box HTMLCanvasElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLCanvasElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLCanvasElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -17,19 +17,19 @@ pub struct HTMLDataElement {
|
|||
}
|
||||
|
||||
impl HTMLDataElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDataElement {
|
||||
HTMLDataElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLDataElement> {
|
||||
Node::reflect_node(box HTMLDataElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLDataElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLDataElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -21,20 +21,20 @@ pub struct HTMLDataListElement {
|
|||
}
|
||||
|
||||
impl HTMLDataListElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDataListElement {
|
||||
HTMLDataListElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLDataListElement> {
|
||||
Node::reflect_node(box HTMLDataListElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLDataListElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLDataListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -28,21 +28,21 @@ pub struct HTMLDetailsElement {
|
|||
}
|
||||
|
||||
impl HTMLDetailsElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDetailsElement {
|
||||
HTMLDetailsElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
toggle_counter: Cell::new(0)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLDetailsElement> {
|
||||
Node::reflect_node(box HTMLDetailsElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLDetailsElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLDetailsElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -22,21 +22,21 @@ pub struct HTMLDialogElement {
|
|||
}
|
||||
|
||||
impl HTMLDialogElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDialogElement {
|
||||
HTMLDialogElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
return_value: DOMRefCell::new(DOMString::new()),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLDialogElement> {
|
||||
Node::reflect_node(box HTMLDialogElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLDialogElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLDialogElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLDirectoryElement {
|
|||
}
|
||||
|
||||
impl HTMLDirectoryElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDirectoryElement {
|
||||
HTMLDirectoryElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLDirectoryElement> {
|
||||
Node::reflect_node(box HTMLDirectoryElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLDirectoryElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLDirectoryElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ pub struct HTMLDivElement {
|
|||
}
|
||||
|
||||
impl HTMLDivElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDivElement {
|
||||
HTMLDivElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLDivElement> {
|
||||
Node::reflect_node(box HTMLDivElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLDivElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLDivElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,18 +16,18 @@ pub struct HTMLDListElement {
|
|||
}
|
||||
|
||||
impl HTMLDListElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLDListElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLDListElement {
|
||||
HTMLDListElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLDListElement> {
|
||||
Node::reflect_node(box HTMLDListElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLDListElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLDListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -62,8 +62,8 @@ impl HTMLElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> {
|
||||
Node::reflect_node(box HTMLElement::new_inherited(localName, prefix, document),
|
||||
pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> {
|
||||
Node::reflect_node(box HTMLElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct HTMLEmbedElement {
|
|||
}
|
||||
|
||||
impl HTMLEmbedElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLEmbedElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLEmbedElement {
|
||||
HTMLEmbedElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLEmbedElement> {
|
||||
Node::reflect_node(box HTMLEmbedElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLEmbedElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLEmbedElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -26,21 +26,21 @@ pub struct HTMLFieldSetElement {
|
|||
}
|
||||
|
||||
impl HTMLFieldSetElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLFieldSetElement {
|
||||
HTMLFieldSetElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document)
|
||||
local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLFieldSetElement> {
|
||||
Node::reflect_node(box HTMLFieldSetElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLFieldSetElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLFieldSetElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -25,17 +25,17 @@ pub struct HTMLFontElement {
|
|||
|
||||
|
||||
impl HTMLFontElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFontElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFontElement {
|
||||
HTMLFontElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLFontElement> {
|
||||
Node::reflect_node(box HTMLFontElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLFontElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLFontElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -65,11 +65,11 @@ pub struct HTMLFormElement {
|
|||
}
|
||||
|
||||
impl HTMLFormElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLFormElement {
|
||||
HTMLFormElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
marked_for_reset: Cell::new(false),
|
||||
elements: Default::default(),
|
||||
generation_id: Cell::new(GenerationId(0))
|
||||
|
@ -77,10 +77,10 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLFormElement> {
|
||||
Node::reflect_node(box HTMLFormElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLFormElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLFormElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct HTMLFrameElement {
|
|||
}
|
||||
|
||||
impl HTMLFrameElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFrameElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFrameElement {
|
||||
HTMLFrameElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLFrameElement> {
|
||||
Node::reflect_node(box HTMLFrameElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLFrameElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLFrameElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -19,20 +19,20 @@ pub struct HTMLFrameSetElement {
|
|||
}
|
||||
|
||||
impl HTMLFrameSetElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLFrameSetElement {
|
||||
HTMLFrameSetElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLFrameSetElement> {
|
||||
Node::reflect_node(box HTMLFrameSetElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLFrameSetElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLFrameSetElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -22,19 +22,19 @@ pub struct HTMLHeadElement {
|
|||
}
|
||||
|
||||
impl HTMLHeadElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLHeadElement {
|
||||
HTMLHeadElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLHeadElement> {
|
||||
Node::reflect_node(box HTMLHeadElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLHeadElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLHeadElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -27,23 +27,23 @@ pub struct HTMLHeadingElement {
|
|||
}
|
||||
|
||||
impl HTMLHeadingElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document,
|
||||
level: HeadingLevel) -> HTMLHeadingElement {
|
||||
HTMLHeadingElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
level: level,
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document,
|
||||
level: HeadingLevel) -> Root<HTMLHeadingElement> {
|
||||
Node::reflect_node(box HTMLHeadingElement::new_inherited(localName, prefix, document, level),
|
||||
Node::reflect_node(box HTMLHeadingElement::new_inherited(local_name, prefix, document, level),
|
||||
document,
|
||||
HTMLHeadingElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -21,17 +21,17 @@ pub struct HTMLHRElement {
|
|||
}
|
||||
|
||||
impl HTMLHRElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLHRElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLHRElement {
|
||||
HTMLHRElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLHRElement> {
|
||||
Node::reflect_node(box HTMLHRElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLHRElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLHRElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -173,11 +173,11 @@ impl HTMLIFrameElement {
|
|||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
}
|
||||
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLIFrameElement {
|
||||
HTMLIFrameElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
pipeline_id: Cell::new(None),
|
||||
sandbox: Default::default(),
|
||||
sandbox_allowance: Cell::new(None),
|
||||
|
@ -187,10 +187,10 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLIFrameElement> {
|
||||
Node::reflect_node(box HTMLIFrameElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLIFrameElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLIFrameElementBinding::Wrap)
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ unsafe fn build_mozbrowser_event_detail(event: MozBrowserEvent,
|
|||
}
|
||||
}
|
||||
|
||||
pub fn Navigate(iframe: &HTMLIFrameElement, direction: TraversalDirection) -> ErrorResult {
|
||||
pub fn navigate(iframe: &HTMLIFrameElement, direction: TraversalDirection) -> ErrorResult {
|
||||
if iframe.Mozbrowser() {
|
||||
if iframe.upcast::<Node>().is_in_doc() {
|
||||
let window = window_from_node(iframe);
|
||||
|
@ -450,7 +450,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
|
|||
let self_url = self.get_url();
|
||||
let win_url = window_from_node(self).get_url();
|
||||
|
||||
if UrlHelper::SameOrigin(&self_url, &win_url) {
|
||||
if UrlHelper::same_origin(&self_url, &win_url) {
|
||||
Some(window.Document())
|
||||
} else {
|
||||
None
|
||||
|
@ -479,16 +479,16 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
|
|||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goBack
|
||||
fn GoBack(&self) -> ErrorResult {
|
||||
Navigate(self, TraversalDirection::Back(1))
|
||||
navigate(self, TraversalDirection::Back(1))
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goForward
|
||||
fn GoForward(&self) -> ErrorResult {
|
||||
Navigate(self, TraversalDirection::Forward(1))
|
||||
navigate(self, TraversalDirection::Forward(1))
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/reload
|
||||
fn Reload(&self, _hardReload: bool) -> ErrorResult {
|
||||
fn Reload(&self, _hard_reload: bool) -> ErrorResult {
|
||||
if self.Mozbrowser() {
|
||||
if self.upcast::<Node>().is_in_doc() {
|
||||
self.navigate_or_reload_child_browsing_context(None);
|
||||
|
@ -632,7 +632,7 @@ impl VirtualMethods for HTMLIFrameElement {
|
|||
// HTMLIFrameElement::contentDocument.
|
||||
let self_url = self.get_url();
|
||||
let win_url = window_from_node(self).get_url();
|
||||
UrlHelper::SameOrigin(&self_url, &win_url)
|
||||
UrlHelper::same_origin(&self_url, &win_url)
|
||||
};
|
||||
let (sender, receiver) = if same_origin {
|
||||
(None, None)
|
||||
|
|
|
@ -194,9 +194,9 @@ impl HTMLImageElement {
|
|||
}
|
||||
}
|
||||
}
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLImageElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLImageElement {
|
||||
HTMLImageElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
current_request: DOMRefCell::new(ImageRequest {
|
||||
state: State::Unavailable,
|
||||
parsed_url: None,
|
||||
|
@ -215,10 +215,10 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLImageElement> {
|
||||
Node::reflect_node(box HTMLImageElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLImageElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLImageElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -125,12 +125,12 @@ static DEFAULT_INPUT_SIZE: u32 = 20;
|
|||
static DEFAULT_MAX_LENGTH: i32 = -1;
|
||||
|
||||
impl HTMLInputElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLInputElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLInputElement {
|
||||
let chan = document.window().constellation_chan().clone();
|
||||
HTMLInputElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
|
||||
localName, prefix, document),
|
||||
local_name, prefix, document),
|
||||
input_type: Cell::new(InputType::InputText),
|
||||
placeholder: DOMRefCell::new(DOMString::new()),
|
||||
checked_changed: Cell::new(false),
|
||||
|
@ -145,10 +145,10 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLInputElement> {
|
||||
Node::reflect_node(box HTMLInputElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLInputElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLInputElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -25,20 +25,20 @@ pub struct HTMLLabelElement {
|
|||
}
|
||||
|
||||
impl HTMLLabelElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLLabelElement {
|
||||
HTMLLabelElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLLabelElement> {
|
||||
Node::reflect_node(box HTMLLabelElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLLabelElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLLabelElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -23,19 +23,19 @@ pub struct HTMLLegendElement {
|
|||
}
|
||||
|
||||
impl HTMLLegendElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document)
|
||||
-> HTMLLegendElement {
|
||||
HTMLLegendElement { htmlelement: HTMLElement::new_inherited(localName, prefix, document) }
|
||||
HTMLLegendElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document) }
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document)
|
||||
-> Root<HTMLLegendElement> {
|
||||
Node::reflect_node(box HTMLLegendElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLLegendElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLLegendElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -20,17 +20,17 @@ pub struct HTMLLIElement {
|
|||
}
|
||||
|
||||
impl HTMLLIElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLLIElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLLIElement {
|
||||
HTMLLIElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLLIElement> {
|
||||
Node::reflect_node(box HTMLLIElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLLIElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLLIElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -57,10 +57,10 @@ pub struct HTMLLinkElement {
|
|||
}
|
||||
|
||||
impl HTMLLinkElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document,
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document,
|
||||
creator: ElementCreator) -> HTMLLinkElement {
|
||||
HTMLLinkElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
rel_list: Default::default(),
|
||||
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated),
|
||||
stylesheet: DOMRefCell::new(None),
|
||||
|
@ -68,11 +68,11 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document,
|
||||
creator: ElementCreator) -> Root<HTMLLinkElement> {
|
||||
Node::reflect_node(box HTMLLinkElement::new_inherited(localName, prefix, document, creator),
|
||||
Node::reflect_node(box HTMLLinkElement::new_inherited(local_name, prefix, document, creator),
|
||||
document,
|
||||
HTMLLinkElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ pub struct HTMLMapElement {
|
|||
}
|
||||
|
||||
impl HTMLMapElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLMapElement {
|
||||
HTMLMapElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLMapElement> {
|
||||
Node::reflect_node(box HTMLMapElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLMapElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLMapElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -31,20 +31,20 @@ pub struct HTMLMetaElement {
|
|||
}
|
||||
|
||||
impl HTMLMetaElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLMetaElement {
|
||||
HTMLMetaElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
stylesheet: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLMetaElement> {
|
||||
Node::reflect_node(box HTMLMetaElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLMetaElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLMetaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -18,19 +18,19 @@ pub struct HTMLMeterElement {
|
|||
}
|
||||
|
||||
impl HTMLMeterElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLMeterElement {
|
||||
HTMLMeterElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLMeterElement> {
|
||||
Node::reflect_node(box HTMLMeterElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLMeterElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLMeterElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLModElement {
|
|||
}
|
||||
|
||||
impl HTMLModElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLModElement {
|
||||
HTMLModElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLModElement> {
|
||||
Node::reflect_node(box HTMLModElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLModElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLModElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -28,21 +28,21 @@ pub struct HTMLObjectElement {
|
|||
}
|
||||
|
||||
impl HTMLObjectElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLObjectElement {
|
||||
HTMLObjectElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
image: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLObjectElement> {
|
||||
Node::reflect_node(box HTMLObjectElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLObjectElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLObjectElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ pub struct HTMLOListElement {
|
|||
}
|
||||
|
||||
impl HTMLOListElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLOListElement {
|
||||
HTMLOListElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLOListElement> {
|
||||
Node::reflect_node(box HTMLOListElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLOListElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLOListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -23,21 +23,21 @@ pub struct HTMLOptGroupElement {
|
|||
}
|
||||
|
||||
impl HTMLOptGroupElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLOptGroupElement {
|
||||
HTMLOptGroupElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document)
|
||||
local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLOptGroupElement> {
|
||||
Node::reflect_node(box HTMLOptGroupElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLOptGroupElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLOptGroupElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -39,23 +39,23 @@ pub struct HTMLOptionElement {
|
|||
}
|
||||
|
||||
impl HTMLOptionElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLOptionElement {
|
||||
HTMLOptionElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document),
|
||||
local_name, prefix, document),
|
||||
selectedness: Cell::new(false),
|
||||
dirtiness: Cell::new(false),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLOptionElement> {
|
||||
Node::reflect_node(box HTMLOptionElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLOptionElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLOptionElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -21,20 +21,20 @@ pub struct HTMLOutputElement {
|
|||
}
|
||||
|
||||
impl HTMLOutputElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLOutputElement {
|
||||
HTMLOutputElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLOutputElement> {
|
||||
Node::reflect_node(box HTMLOutputElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLOutputElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLOutputElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLParagraphElement {
|
|||
}
|
||||
|
||||
impl HTMLParagraphElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLParagraphElement {
|
||||
HTMLParagraphElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLParagraphElement> {
|
||||
Node::reflect_node(box HTMLParagraphElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLParagraphElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLParagraphElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLParamElement {
|
|||
}
|
||||
|
||||
impl HTMLParamElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLParamElement {
|
||||
HTMLParamElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLParamElement> {
|
||||
Node::reflect_node(box HTMLParamElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLParamElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLParamElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLPreElement {
|
|||
}
|
||||
|
||||
impl HTMLPreElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLPreElement {
|
||||
HTMLPreElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLPreElement> {
|
||||
Node::reflect_node(box HTMLPreElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLPreElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLPreElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -18,20 +18,20 @@ pub struct HTMLProgressElement {
|
|||
}
|
||||
|
||||
impl HTMLProgressElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLProgressElement {
|
||||
HTMLProgressElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLProgressElement> {
|
||||
Node::reflect_node(box HTMLProgressElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLProgressElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLProgressElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLQuoteElement {
|
|||
}
|
||||
|
||||
impl HTMLQuoteElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLQuoteElement {
|
||||
HTMLQuoteElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLQuoteElement> {
|
||||
Node::reflect_node(box HTMLQuoteElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLQuoteElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLQuoteElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -64,11 +64,11 @@ pub struct HTMLScriptElement {
|
|||
}
|
||||
|
||||
impl HTMLScriptElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document,
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document,
|
||||
creator: ElementCreator) -> HTMLScriptElement {
|
||||
HTMLScriptElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
already_started: Cell::new(false),
|
||||
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated),
|
||||
non_blocking: Cell::new(creator != ElementCreator::ParserCreated),
|
||||
|
@ -79,9 +79,9 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document,
|
||||
pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document,
|
||||
creator: ElementCreator) -> Root<HTMLScriptElement> {
|
||||
Node::reflect_node(box HTMLScriptElement::new_inherited(localName, prefix, document, creator),
|
||||
Node::reflect_node(box HTMLScriptElement::new_inherited(local_name, prefix, document, creator),
|
||||
document,
|
||||
HTMLScriptElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -34,21 +34,21 @@ pub struct HTMLSelectElement {
|
|||
static DEFAULT_SELECT_SIZE: u32 = 0;
|
||||
|
||||
impl HTMLSelectElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLSelectElement {
|
||||
HTMLSelectElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document)
|
||||
local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLSelectElement> {
|
||||
Node::reflect_node(box HTMLSelectElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLSelectElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLSelectElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLSourceElement {
|
|||
}
|
||||
|
||||
impl HTMLSourceElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLSourceElement {
|
||||
HTMLSourceElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLSourceElement> {
|
||||
Node::reflect_node(box HTMLSourceElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLSourceElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLSourceElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct HTMLSpanElement {
|
|||
}
|
||||
|
||||
impl HTMLSpanElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLSpanElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLSpanElement {
|
||||
HTMLSpanElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLSpanElement> {
|
||||
Node::reflect_node(box HTMLSpanElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLSpanElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLSpanElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -28,20 +28,20 @@ pub struct HTMLStyleElement {
|
|||
}
|
||||
|
||||
impl HTMLStyleElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLStyleElement {
|
||||
HTMLStyleElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
stylesheet: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLStyleElement> {
|
||||
Node::reflect_node(box HTMLStyleElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLStyleElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLStyleElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLTableCaptionElement {
|
|||
}
|
||||
|
||||
impl HTMLTableCaptionElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTableCaptionElement {
|
||||
HTMLTableCaptionElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLTableCaptionElement> {
|
||||
Node::reflect_node(box HTMLTableCaptionElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTableCaptionElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTableCaptionElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLTableColElement {
|
|||
}
|
||||
|
||||
impl HTMLTableColElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTableColElement {
|
||||
HTMLTableColElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLTableColElement> {
|
||||
Node::reflect_node(box HTMLTableColElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTableColElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTableColElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ pub struct HTMLTableDataCellElement {
|
|||
}
|
||||
|
||||
impl HTMLTableDataCellElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTableDataCellElement {
|
||||
HTMLTableDataCellElement {
|
||||
htmltablecellelement:
|
||||
HTMLTableCellElement::new_inherited(localName, prefix, document)
|
||||
HTMLTableCellElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
-> Root<HTMLTableDataCellElement> {
|
||||
Node::reflect_node(box HTMLTableDataCellElement::new_inherited(localName,
|
||||
Node::reflect_node(box HTMLTableDataCellElement::new_inherited(local_name,
|
||||
prefix,
|
||||
document),
|
||||
document,
|
||||
|
|
|
@ -49,10 +49,10 @@ impl CollectionFilter for TableRowFilter {
|
|||
}
|
||||
|
||||
impl HTMLTableElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
-> HTMLTableElement {
|
||||
HTMLTableElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
border: Cell::new(None),
|
||||
cellspacing: Cell::new(None),
|
||||
tbodies: Default::default(),
|
||||
|
@ -60,9 +60,9 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
-> Root<HTMLTableElement> {
|
||||
Node::reflect_node(box HTMLTableElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTableElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTableElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLTableHeaderCellElement {
|
|||
}
|
||||
|
||||
impl HTMLTableHeaderCellElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTableHeaderCellElement {
|
||||
HTMLTableHeaderCellElement {
|
||||
htmltablecellelement:
|
||||
HTMLTableCellElement::new_inherited(localName, prefix, document)
|
||||
HTMLTableCellElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLTableHeaderCellElement> {
|
||||
Node::reflect_node(box HTMLTableHeaderCellElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTableHeaderCellElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTableHeaderCellElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -40,18 +40,18 @@ pub struct HTMLTableRowElement {
|
|||
}
|
||||
|
||||
impl HTMLTableRowElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
-> HTMLTableRowElement {
|
||||
HTMLTableRowElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
cells: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
-> Root<HTMLTableRowElement> {
|
||||
Node::reflect_node(box HTMLTableRowElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTableRowElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTableRowElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -25,17 +25,17 @@ pub struct HTMLTableSectionElement {
|
|||
}
|
||||
|
||||
impl HTMLTableSectionElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
-> HTMLTableSectionElement {
|
||||
HTMLTableSectionElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
|
||||
-> Root<HTMLTableSectionElement> {
|
||||
Node::reflect_node(box HTMLTableSectionElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTableSectionElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTableSectionElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -25,21 +25,21 @@ pub struct HTMLTemplateElement {
|
|||
}
|
||||
|
||||
impl HTMLTemplateElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTemplateElement {
|
||||
HTMLTemplateElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
contents: MutNullableHeap::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLTemplateElement> {
|
||||
Node::reflect_node(box HTMLTemplateElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTemplateElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTemplateElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -96,14 +96,14 @@ static DEFAULT_COLS: u32 = 20;
|
|||
static DEFAULT_ROWS: u32 = 2;
|
||||
|
||||
impl HTMLTextAreaElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTextAreaElement {
|
||||
let chan = document.window().constellation_chan().clone();
|
||||
HTMLTextAreaElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
|
||||
localName, prefix, document),
|
||||
local_name, prefix, document),
|
||||
textinput: DOMRefCell::new(TextInput::new(
|
||||
Lines::Multiple, DOMString::new(), chan, None, SelectionDirection::None)),
|
||||
value_changed: Cell::new(false),
|
||||
|
@ -111,10 +111,10 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLTextAreaElement> {
|
||||
Node::reflect_node(box HTMLTextAreaElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTextAreaElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTextAreaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct HTMLTimeElement {
|
|||
}
|
||||
|
||||
impl HTMLTimeElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTimeElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTimeElement {
|
||||
HTMLTimeElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLTimeElement> {
|
||||
Node::reflect_node(box HTMLTimeElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTimeElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTimeElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -22,17 +22,17 @@ pub struct HTMLTitleElement {
|
|||
}
|
||||
|
||||
impl HTMLTitleElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTitleElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTitleElement {
|
||||
HTMLTitleElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLTitleElement> {
|
||||
Node::reflect_node(box HTMLTitleElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTitleElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTitleElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct HTMLTrackElement {
|
|||
}
|
||||
|
||||
impl HTMLTrackElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTrackElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTrackElement {
|
||||
HTMLTrackElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLTrackElement> {
|
||||
Node::reflect_node(box HTMLTrackElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTrackElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTrackElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct HTMLUListElement {
|
|||
}
|
||||
|
||||
impl HTMLUListElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLUListElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLUListElement {
|
||||
HTMLUListElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLUListElement> {
|
||||
Node::reflect_node(box HTMLUListElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLUListElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLUListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLUnknownElement {
|
|||
}
|
||||
|
||||
impl HTMLUnknownElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLUnknownElement {
|
||||
HTMLUnknownElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLUnknownElement> {
|
||||
Node::reflect_node(box HTMLUnknownElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLUnknownElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLUnknownElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,18 +16,18 @@ pub struct HTMLVideoElement {
|
|||
}
|
||||
|
||||
impl HTMLVideoElement {
|
||||
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLVideoElement {
|
||||
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLVideoElement {
|
||||
HTMLVideoElement {
|
||||
htmlmediaelement:
|
||||
HTMLMediaElement::new_inherited(localName, prefix, document)
|
||||
HTMLMediaElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> Root<HTMLVideoElement> {
|
||||
Node::reflect_node(box HTMLVideoElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLVideoElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLVideoElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ impl KeyboardEvent {
|
|||
|
||||
pub fn new(window: &Window,
|
||||
type_: DOMString,
|
||||
canBubble: bool,
|
||||
can_bubble: bool,
|
||||
cancelable: bool,
|
||||
view: Option<&Window>,
|
||||
_detail: i32,
|
||||
|
@ -78,26 +78,26 @@ impl KeyboardEvent {
|
|||
code: DOMString,
|
||||
location: u32,
|
||||
repeat: bool,
|
||||
isComposing: bool,
|
||||
ctrlKey: bool,
|
||||
altKey: bool,
|
||||
shiftKey: bool,
|
||||
metaKey: bool,
|
||||
is_composing: bool,
|
||||
ctrl_key: bool,
|
||||
alt_key: bool,
|
||||
shift_key: bool,
|
||||
meta_key: bool,
|
||||
char_code: Option<u32>,
|
||||
key_code: u32) -> Root<KeyboardEvent> {
|
||||
let ev = KeyboardEvent::new_uninitialized(window);
|
||||
ev.InitKeyboardEvent(type_, canBubble, cancelable, view, key_string, location,
|
||||
ev.InitKeyboardEvent(type_, can_bubble, cancelable, view, key_string, location,
|
||||
DOMString::new(), repeat, DOMString::new());
|
||||
ev.key.set(key);
|
||||
*ev.code.borrow_mut() = code;
|
||||
ev.ctrl.set(ctrlKey);
|
||||
ev.alt.set(altKey);
|
||||
ev.shift.set(shiftKey);
|
||||
ev.meta.set(metaKey);
|
||||
ev.ctrl.set(ctrl_key);
|
||||
ev.alt.set(alt_key);
|
||||
ev.shift.set(shift_key);
|
||||
ev.meta.set(meta_key);
|
||||
ev.char_code.set(char_code);
|
||||
ev.printable.set(ch);
|
||||
ev.key_code.set(key_code);
|
||||
ev.is_composing.set(isComposing);
|
||||
ev.is_composing.set(is_composing);
|
||||
ev
|
||||
}
|
||||
|
||||
|
@ -759,13 +759,13 @@ impl KeyEventProperties {
|
|||
impl KeyboardEventMethods for KeyboardEvent {
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-initKeyboardEvent
|
||||
fn InitKeyboardEvent(&self,
|
||||
typeArg: DOMString,
|
||||
canBubbleArg: bool,
|
||||
cancelableArg: bool,
|
||||
viewArg: Option<&Window>,
|
||||
keyArg: DOMString,
|
||||
locationArg: u32,
|
||||
_modifiersListArg: DOMString,
|
||||
type_arg: DOMString,
|
||||
can_bubble_arg: bool,
|
||||
cancelable_arg: bool,
|
||||
view_arg: Option<&Window>,
|
||||
key_arg: DOMString,
|
||||
location_arg: u32,
|
||||
_modifiers_list_arg: DOMString,
|
||||
repeat: bool,
|
||||
_locale: DOMString) {
|
||||
if self.upcast::<Event>().dispatching() {
|
||||
|
@ -773,9 +773,9 @@ impl KeyboardEventMethods for KeyboardEvent {
|
|||
}
|
||||
|
||||
self.upcast::<UIEvent>()
|
||||
.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, 0);
|
||||
*self.key_string.borrow_mut() = keyArg;
|
||||
self.location.set(locationArg);
|
||||
.InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, 0);
|
||||
*self.key_string.borrow_mut() = key_arg;
|
||||
self.location.set(location_arg);
|
||||
self.repeat.set(repeat);
|
||||
}
|
||||
|
||||
|
@ -825,8 +825,8 @@ impl KeyboardEventMethods for KeyboardEvent {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
|
||||
fn GetModifierState(&self, keyArg: DOMString) -> bool {
|
||||
match &*keyArg {
|
||||
fn GetModifierState(&self, key_arg: DOMString) -> bool {
|
||||
match &*key_arg {
|
||||
"Ctrl" => self.CtrlKey(),
|
||||
"Alt" => self.AltKey(),
|
||||
"Shift" => self.ShiftKey(),
|
||||
|
|
|
@ -62,7 +62,7 @@ impl LocationMethods for Location {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-hash
|
||||
fn Hash(&self) -> USVString {
|
||||
UrlHelper::Hash(&self.get_url())
|
||||
UrlHelper::hash(&self.get_url())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-hash
|
||||
|
@ -70,37 +70,37 @@ impl LocationMethods for Location {
|
|||
if value.0.is_empty() {
|
||||
value = USVString("#".to_owned());
|
||||
}
|
||||
self.set_url_component(value, UrlHelper::SetHash);
|
||||
self.set_url_component(value, UrlHelper::set_hash);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-host
|
||||
fn Host(&self) -> USVString {
|
||||
UrlHelper::Host(&self.get_url())
|
||||
UrlHelper::host(&self.get_url())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-host
|
||||
fn SetHost(&self, value: USVString) {
|
||||
self.set_url_component(value, UrlHelper::SetHost);
|
||||
self.set_url_component(value, UrlHelper::set_host);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-origin
|
||||
fn Origin(&self) -> USVString {
|
||||
UrlHelper::Origin(&self.get_url())
|
||||
UrlHelper::origin(&self.get_url())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-hostname
|
||||
fn Hostname(&self) -> USVString {
|
||||
UrlHelper::Hostname(&self.get_url())
|
||||
UrlHelper::hostname(&self.get_url())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-hostname
|
||||
fn SetHostname(&self, value: USVString) {
|
||||
self.set_url_component(value, UrlHelper::SetHostname);
|
||||
self.set_url_component(value, UrlHelper::set_hostname);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-href
|
||||
fn Href(&self) -> USVString {
|
||||
UrlHelper::Href(&self.get_url())
|
||||
UrlHelper::href(&self.get_url())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-href
|
||||
|
@ -112,32 +112,32 @@ impl LocationMethods for Location {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-pathname
|
||||
fn Pathname(&self) -> USVString {
|
||||
UrlHelper::Pathname(&self.get_url())
|
||||
UrlHelper::pathname(&self.get_url())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-pathname
|
||||
fn SetPathname(&self, value: USVString) {
|
||||
self.set_url_component(value, UrlHelper::SetPathname);
|
||||
self.set_url_component(value, UrlHelper::set_pathname);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-port
|
||||
fn Port(&self) -> USVString {
|
||||
UrlHelper::Port(&self.get_url())
|
||||
UrlHelper::port(&self.get_url())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-port
|
||||
fn SetPort(&self, value: USVString) {
|
||||
self.set_url_component(value, UrlHelper::SetPort);
|
||||
self.set_url_component(value, UrlHelper::set_port);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-protocol
|
||||
fn Protocol(&self) -> USVString {
|
||||
UrlHelper::Protocol(&self.get_url())
|
||||
UrlHelper::protocol(&self.get_url())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-protocol
|
||||
fn SetProtocol(&self, value: USVString) {
|
||||
self.set_url_component(value, UrlHelper::SetProtocol);
|
||||
self.set_url_component(value, UrlHelper::set_protocol);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-href
|
||||
|
@ -147,11 +147,11 @@ impl LocationMethods for Location {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-search
|
||||
fn Search(&self) -> USVString {
|
||||
UrlHelper::Search(&self.get_url())
|
||||
UrlHelper::search(&self.get_url())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-search
|
||||
fn SetSearch(&self, value: USVString) {
|
||||
self.set_url_component(value, UrlHelper::SetSearch);
|
||||
self.set_url_component(value, UrlHelper::set_search);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,26 +59,26 @@ impl MouseEvent {
|
|||
|
||||
pub fn new(window: &Window,
|
||||
type_: DOMString,
|
||||
canBubble: EventBubbles,
|
||||
can_bubble: EventBubbles,
|
||||
cancelable: EventCancelable,
|
||||
view: Option<&Window>,
|
||||
detail: i32,
|
||||
screenX: i32,
|
||||
screenY: i32,
|
||||
clientX: i32,
|
||||
clientY: i32,
|
||||
ctrlKey: bool,
|
||||
altKey: bool,
|
||||
shiftKey: bool,
|
||||
metaKey: bool,
|
||||
screen_x: i32,
|
||||
screen_y: i32,
|
||||
client_x: i32,
|
||||
client_y: i32,
|
||||
ctrl_key: bool,
|
||||
alt_key: bool,
|
||||
shift_key: bool,
|
||||
meta_key: bool,
|
||||
button: i16,
|
||||
relatedTarget: Option<&EventTarget>) -> Root<MouseEvent> {
|
||||
related_target: Option<&EventTarget>) -> Root<MouseEvent> {
|
||||
let ev = MouseEvent::new_uninitialized(window);
|
||||
ev.InitMouseEvent(type_, bool::from(canBubble), bool::from(cancelable),
|
||||
ev.InitMouseEvent(type_, bool::from(can_bubble), bool::from(cancelable),
|
||||
view, detail,
|
||||
screenX, screenY, clientX, clientY,
|
||||
ctrlKey, altKey, shiftKey, metaKey,
|
||||
button, relatedTarget);
|
||||
screen_x, screen_y, client_x, client_y,
|
||||
ctrl_key, alt_key, shift_key, meta_key,
|
||||
button, related_target);
|
||||
ev
|
||||
}
|
||||
|
||||
|
@ -166,37 +166,37 @@ impl MouseEventMethods for MouseEvent {
|
|||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-initMouseEvent
|
||||
fn InitMouseEvent(&self,
|
||||
typeArg: DOMString,
|
||||
canBubbleArg: bool,
|
||||
cancelableArg: bool,
|
||||
viewArg: Option<&Window>,
|
||||
detailArg: i32,
|
||||
screenXArg: i32,
|
||||
screenYArg: i32,
|
||||
clientXArg: i32,
|
||||
clientYArg: i32,
|
||||
ctrlKeyArg: bool,
|
||||
altKeyArg: bool,
|
||||
shiftKeyArg: bool,
|
||||
metaKeyArg: bool,
|
||||
buttonArg: i16,
|
||||
relatedTargetArg: Option<&EventTarget>) {
|
||||
type_arg: DOMString,
|
||||
can_bubble_arg: bool,
|
||||
cancelable_arg: bool,
|
||||
view_arg: Option<&Window>,
|
||||
detail_arg: i32,
|
||||
screen_x_arg: i32,
|
||||
screen_y_arg: i32,
|
||||
client_x_arg: i32,
|
||||
client_y_arg: i32,
|
||||
ctrl_key_arg: bool,
|
||||
alt_key_arg: bool,
|
||||
shift_key_arg: bool,
|
||||
meta_key_arg: bool,
|
||||
button_arg: i16,
|
||||
related_target_arg: Option<&EventTarget>) {
|
||||
if self.upcast::<Event>().dispatching() {
|
||||
return;
|
||||
}
|
||||
|
||||
self.upcast::<UIEvent>()
|
||||
.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
|
||||
self.screen_x.set(screenXArg);
|
||||
self.screen_y.set(screenYArg);
|
||||
self.client_x.set(clientXArg);
|
||||
self.client_y.set(clientYArg);
|
||||
self.ctrl_key.set(ctrlKeyArg);
|
||||
self.alt_key.set(altKeyArg);
|
||||
self.shift_key.set(shiftKeyArg);
|
||||
self.meta_key.set(metaKeyArg);
|
||||
self.button.set(buttonArg);
|
||||
self.related_target.set(relatedTargetArg);
|
||||
.InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, detail_arg);
|
||||
self.screen_x.set(screen_x_arg);
|
||||
self.screen_y.set(screen_y_arg);
|
||||
self.client_x.set(client_x_arg);
|
||||
self.client_y.set(client_y_arg);
|
||||
self.ctrl_key.set(ctrl_key_arg);
|
||||
self.alt_key.set(alt_key_arg);
|
||||
self.shift_key.set(shift_key_arg);
|
||||
self.meta_key.set(meta_key_arg);
|
||||
self.button.set(button_arg);
|
||||
self.related_target.set(related_target_arg);
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-event-istrusted
|
||||
|
|
|
@ -21,7 +21,7 @@ pub struct Navigator {
|
|||
bluetooth: MutNullableHeap<JS<Bluetooth>>,
|
||||
plugins: MutNullableHeap<JS<PluginArray>>,
|
||||
mime_types: MutNullableHeap<JS<MimeTypeArray>>,
|
||||
serviceWorker: MutNullableHeap<JS<ServiceWorkerContainer>>,
|
||||
service_worker: MutNullableHeap<JS<ServiceWorkerContainer>>,
|
||||
}
|
||||
|
||||
impl Navigator {
|
||||
|
@ -31,7 +31,7 @@ impl Navigator {
|
|||
bluetooth: Default::default(),
|
||||
plugins: Default::default(),
|
||||
mime_types: Default::default(),
|
||||
serviceWorker: Default::default(),
|
||||
service_worker: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ impl NavigatorMethods for Navigator {
|
|||
|
||||
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#navigator-service-worker-attribute
|
||||
fn ServiceWorker(&self) -> Root<ServiceWorkerContainer> {
|
||||
self.serviceWorker.or_init(|| ServiceWorkerContainer::new(self.global().r()))
|
||||
self.service_worker.or_init(|| ServiceWorkerContainer::new(self.global().r()))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-cookieenabled
|
||||
|
|
|
@ -796,10 +796,10 @@ impl Node {
|
|||
}
|
||||
|
||||
pub fn summarize(&self) -> NodeInfo {
|
||||
let USVString(baseURI) = self.BaseURI();
|
||||
let USVString(base_uri) = self.BaseURI();
|
||||
NodeInfo {
|
||||
uniqueId: self.unique_id(),
|
||||
baseURI: baseURI,
|
||||
baseURI: base_uri,
|
||||
parent: self.GetParentNode().map_or("".to_owned(), |node| node.unique_id()),
|
||||
nodeType: self.NodeType(),
|
||||
namespaceURI: String::new(), //FIXME
|
||||
|
@ -2296,8 +2296,8 @@ impl NodeMethods for Node {
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-node-issamenode
|
||||
fn IsSameNode(&self, otherNode: Option<&Node>) -> bool {
|
||||
match otherNode {
|
||||
fn IsSameNode(&self, other_node: Option<&Node>) -> bool {
|
||||
match other_node {
|
||||
Some(node) => self == node,
|
||||
None => false,
|
||||
}
|
||||
|
|
|
@ -51,8 +51,8 @@ impl PerformanceMethods for Performance {
|
|||
|
||||
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now
|
||||
fn Now(&self) -> DOMHighResTimeStamp {
|
||||
let navStart = self.timing.NavigationStartPrecise();
|
||||
let now = (time::precise_time_ns() as f64 - navStart) / 1000000 as f64;
|
||||
let nav_start = self.timing.navigation_start_precise();
|
||||
let now = (time::precise_time_ns() as f64 - nav_start) / 1000000 as f64;
|
||||
Finite::wrap(now)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,20 +14,20 @@ use dom::window::Window;
|
|||
#[dom_struct]
|
||||
pub struct PerformanceTiming {
|
||||
reflector_: Reflector,
|
||||
navigationStart: u64,
|
||||
navigationStartPrecise: f64,
|
||||
navigation_start: u64,
|
||||
navigation_start_precise: f64,
|
||||
document: JS<Document>,
|
||||
}
|
||||
|
||||
impl PerformanceTiming {
|
||||
fn new_inherited(navStart: u64,
|
||||
navStartPrecise: f64,
|
||||
fn new_inherited(nav_start: u64,
|
||||
nav_start_precise: f64,
|
||||
document: &Document)
|
||||
-> PerformanceTiming {
|
||||
PerformanceTiming {
|
||||
reflector_: Reflector::new(),
|
||||
navigationStart: navStart,
|
||||
navigationStartPrecise: navStartPrecise,
|
||||
navigation_start: nav_start,
|
||||
navigation_start_precise: nav_start_precise,
|
||||
document: JS::from_ref(document),
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ impl PerformanceTiming {
|
|||
impl PerformanceTimingMethods for PerformanceTiming {
|
||||
// https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-navigationStart
|
||||
fn NavigationStart(&self) -> u64 {
|
||||
self.navigationStart
|
||||
self.navigation_start
|
||||
}
|
||||
|
||||
// https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-domLoading
|
||||
|
@ -89,7 +89,7 @@ impl PerformanceTimingMethods for PerformanceTiming {
|
|||
|
||||
|
||||
impl PerformanceTiming {
|
||||
pub fn NavigationStartPrecise(&self) -> f64 {
|
||||
self.navigationStartPrecise
|
||||
pub fn navigation_start_precise(&self) -> f64 {
|
||||
self.navigation_start_precise
|
||||
}
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ impl Runnable for StorageEventRunnable {
|
|||
for it_context in root_context.iter() {
|
||||
let it_window_root = it_context.active_window();
|
||||
let it_window = it_window_root.r();
|
||||
assert!(UrlHelper::SameOrigin(&ev_url, &it_window.get_url()));
|
||||
assert!(UrlHelper::same_origin(&ev_url, &it_window.get_url()));
|
||||
// TODO: Such a Document object is not necessarily fully active, but events fired on such
|
||||
// objects are ignored by the event loop until the Document becomes fully active again.
|
||||
if ev_window.pipeline_id() != it_window.pipeline_id() {
|
||||
|
|
|
@ -20,26 +20,26 @@ use string_cache::Atom;
|
|||
pub struct StorageEvent {
|
||||
event: Event,
|
||||
key: Option<DOMString>,
|
||||
oldValue: Option<DOMString>,
|
||||
newValue: Option<DOMString>,
|
||||
old_value: Option<DOMString>,
|
||||
new_value: Option<DOMString>,
|
||||
url: DOMString,
|
||||
storageArea: MutNullableHeap<JS<Storage>>
|
||||
storage_area: MutNullableHeap<JS<Storage>>
|
||||
}
|
||||
|
||||
|
||||
impl StorageEvent {
|
||||
pub fn new_inherited(key: Option<DOMString>,
|
||||
oldValue: Option<DOMString>,
|
||||
newValue: Option<DOMString>,
|
||||
old_value: Option<DOMString>,
|
||||
new_value: Option<DOMString>,
|
||||
url: DOMString,
|
||||
storageArea: Option<&Storage>) -> StorageEvent {
|
||||
storage_area: Option<&Storage>) -> StorageEvent {
|
||||
StorageEvent {
|
||||
event: Event::new_inherited(),
|
||||
key: key,
|
||||
oldValue: oldValue,
|
||||
newValue: newValue,
|
||||
old_value: old_value,
|
||||
new_value: new_value,
|
||||
url: url,
|
||||
storageArea: MutNullableHeap::new(storageArea)
|
||||
storage_area: MutNullableHeap::new(storage_area)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,12 +96,12 @@ impl StorageEventMethods for StorageEvent {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-storageevent-oldvalue
|
||||
fn GetOldValue(&self) -> Option<DOMString> {
|
||||
self.oldValue.clone()
|
||||
self.old_value.clone()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-storageevent-newvalue
|
||||
fn GetNewValue(&self) -> Option<DOMString> {
|
||||
self.newValue.clone()
|
||||
self.new_value.clone()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-storageevent-url
|
||||
|
@ -111,7 +111,7 @@ impl StorageEventMethods for StorageEvent {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-storageevent-storagearea
|
||||
fn GetStorageArea(&self) -> Option<Root<Storage>> {
|
||||
self.storageArea.get()
|
||||
self.storage_area.get()
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-event-istrusted
|
||||
|
|
|
@ -55,7 +55,7 @@ impl TouchEvent {
|
|||
|
||||
pub fn new(window: &Window,
|
||||
type_: DOMString,
|
||||
canBubble: EventBubbles,
|
||||
can_bubble: EventBubbles,
|
||||
cancelable: EventCancelable,
|
||||
view: Option<&Window>,
|
||||
detail: i32,
|
||||
|
@ -68,7 +68,7 @@ impl TouchEvent {
|
|||
meta_key: bool) -> Root<TouchEvent> {
|
||||
let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches);
|
||||
ev.upcast::<UIEvent>().InitUIEvent(type_,
|
||||
bool::from(canBubble),
|
||||
bool::from(can_bubble),
|
||||
bool::from(cancelable),
|
||||
view, detail);
|
||||
ev.ctrl_key.set(ctrl_key);
|
||||
|
|
|
@ -176,37 +176,37 @@ impl URL {
|
|||
impl URLMethods for URL {
|
||||
// https://url.spec.whatwg.org/#dom-url-hash
|
||||
fn Hash(&self) -> USVString {
|
||||
UrlHelper::Hash(&self.url.borrow())
|
||||
UrlHelper::hash(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-hash
|
||||
fn SetHash(&self, value: USVString) {
|
||||
UrlHelper::SetHash(&mut self.url.borrow_mut(), value);
|
||||
UrlHelper::set_hash(&mut self.url.borrow_mut(), value);
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-host
|
||||
fn Host(&self) -> USVString {
|
||||
UrlHelper::Host(&self.url.borrow())
|
||||
UrlHelper::host(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-host
|
||||
fn SetHost(&self, value: USVString) {
|
||||
UrlHelper::SetHost(&mut self.url.borrow_mut(), value);
|
||||
UrlHelper::set_host(&mut self.url.borrow_mut(), value);
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-hostname
|
||||
fn Hostname(&self) -> USVString {
|
||||
UrlHelper::Hostname(&self.url.borrow())
|
||||
UrlHelper::hostname(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-hostname
|
||||
fn SetHostname(&self, value: USVString) {
|
||||
UrlHelper::SetHostname(&mut self.url.borrow_mut(), value);
|
||||
UrlHelper::set_hostname(&mut self.url.borrow_mut(), value);
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-href
|
||||
fn Href(&self) -> USVString {
|
||||
UrlHelper::Href(&self.url.borrow())
|
||||
UrlHelper::href(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-href
|
||||
|
@ -225,57 +225,57 @@ impl URLMethods for URL {
|
|||
|
||||
// https://url.spec.whatwg.org/#dom-url-password
|
||||
fn Password(&self) -> USVString {
|
||||
UrlHelper::Password(&self.url.borrow())
|
||||
UrlHelper::password(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-password
|
||||
fn SetPassword(&self, value: USVString) {
|
||||
UrlHelper::SetPassword(&mut self.url.borrow_mut(), value);
|
||||
UrlHelper::set_password(&mut self.url.borrow_mut(), value);
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-pathname
|
||||
fn Pathname(&self) -> USVString {
|
||||
UrlHelper::Pathname(&self.url.borrow())
|
||||
UrlHelper::pathname(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-pathname
|
||||
fn SetPathname(&self, value: USVString) {
|
||||
UrlHelper::SetPathname(&mut self.url.borrow_mut(), value);
|
||||
UrlHelper::set_pathname(&mut self.url.borrow_mut(), value);
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-port
|
||||
fn Port(&self) -> USVString {
|
||||
UrlHelper::Port(&self.url.borrow())
|
||||
UrlHelper::port(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-port
|
||||
fn SetPort(&self, value: USVString) {
|
||||
UrlHelper::SetPort(&mut self.url.borrow_mut(), value);
|
||||
UrlHelper::set_port(&mut self.url.borrow_mut(), value);
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-protocol
|
||||
fn Protocol(&self) -> USVString {
|
||||
UrlHelper::Protocol(&self.url.borrow())
|
||||
UrlHelper::protocol(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-protocol
|
||||
fn SetProtocol(&self, value: USVString) {
|
||||
UrlHelper::SetProtocol(&mut self.url.borrow_mut(), value);
|
||||
UrlHelper::set_protocol(&mut self.url.borrow_mut(), value);
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-origin
|
||||
fn Origin(&self) -> USVString {
|
||||
UrlHelper::Origin(&self.url.borrow())
|
||||
UrlHelper::origin(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-search
|
||||
fn Search(&self) -> USVString {
|
||||
UrlHelper::Search(&self.url.borrow())
|
||||
UrlHelper::search(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-search
|
||||
fn SetSearch(&self, value: USVString) {
|
||||
UrlHelper::SetSearch(&mut self.url.borrow_mut(), value);
|
||||
UrlHelper::set_search(&mut self.url.borrow_mut(), value);
|
||||
if let Some(search_params) = self.search_params.get() {
|
||||
search_params.set_list(self.url.borrow().query_pairs().into_owned().collect());
|
||||
}
|
||||
|
@ -293,11 +293,11 @@ impl URLMethods for URL {
|
|||
|
||||
// https://url.spec.whatwg.org/#dom-url-username
|
||||
fn Username(&self) -> USVString {
|
||||
UrlHelper::Username(&self.url.borrow())
|
||||
UrlHelper::username(&self.url.borrow())
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-username
|
||||
fn SetUsername(&self, value: USVString) {
|
||||
UrlHelper::SetUsername(&mut self.url.borrow_mut(), value);
|
||||
UrlHelper::set_username(&mut self.url.borrow_mut(), value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,25 +10,25 @@ use url::{Url, quirks};
|
|||
pub struct UrlHelper;
|
||||
|
||||
impl UrlHelper {
|
||||
pub fn SameOrigin(urlA: &Url, urlB: &Url) -> bool { urlA.origin() == urlB.origin() }
|
||||
pub fn Origin(url: &Url) -> USVString { USVString(quirks::origin(url)) }
|
||||
pub fn Href(url: &Url) -> USVString { USVString(quirks::href(url).to_owned()) }
|
||||
pub fn Hash(url: &Url) -> USVString { USVString(quirks::hash(url).to_owned()) }
|
||||
pub fn Host(url: &Url) -> USVString { USVString(quirks::host(url).to_owned()) }
|
||||
pub fn Port(url: &Url) -> USVString { USVString(quirks::port(url).to_owned()) }
|
||||
pub fn Search(url: &Url) -> USVString { USVString(quirks::search(url).to_owned()) }
|
||||
pub fn Hostname(url: &Url) -> USVString { USVString(quirks::hostname(url).to_owned()) }
|
||||
pub fn Password(url: &Url) -> USVString { USVString(quirks::password(url).to_owned()) }
|
||||
pub fn Pathname(url: &Url) -> USVString { USVString(quirks::pathname(url).to_owned()) }
|
||||
pub fn Protocol(url: &Url) -> USVString { USVString(quirks::protocol(url).to_owned()) }
|
||||
pub fn Username(url: &Url) -> USVString { USVString(quirks::username(url).to_owned()) }
|
||||
pub fn SetHash(url: &mut Url, value: USVString) { quirks::set_hash(url, &value.0) }
|
||||
pub fn SetHost(url: &mut Url, value: USVString) { let _ = quirks::set_host(url, &value.0); }
|
||||
pub fn SetPort(url: &mut Url, value: USVString) { let _ = quirks::set_port(url, &value.0); }
|
||||
pub fn SetSearch(url: &mut Url, value: USVString) { quirks::set_search(url, &value.0) }
|
||||
pub fn SetPathname(url: &mut Url, value: USVString) { quirks::set_pathname(url, &value.0) }
|
||||
pub fn SetHostname(url: &mut Url, value: USVString) { let _ = quirks::set_hostname(url, &value.0); }
|
||||
pub fn SetPassword(url: &mut Url, value: USVString) { let _ = quirks::set_password(url, &value.0); }
|
||||
pub fn SetProtocol(url: &mut Url, value: USVString) { let _ = quirks::set_protocol(url, &value.0); }
|
||||
pub fn SetUsername(url: &mut Url, value: USVString) { let _ = quirks::set_username(url, &value.0); }
|
||||
pub fn same_origin(url_a: &Url, url_b: &Url) -> bool { url_a.origin() == url_b.origin() }
|
||||
pub fn origin(url: &Url) -> USVString { USVString(quirks::origin(url)) }
|
||||
pub fn href(url: &Url) -> USVString { USVString(quirks::href(url).to_owned()) }
|
||||
pub fn hash(url: &Url) -> USVString { USVString(quirks::hash(url).to_owned()) }
|
||||
pub fn host(url: &Url) -> USVString { USVString(quirks::host(url).to_owned()) }
|
||||
pub fn port(url: &Url) -> USVString { USVString(quirks::port(url).to_owned()) }
|
||||
pub fn search(url: &Url) -> USVString { USVString(quirks::search(url).to_owned()) }
|
||||
pub fn hostname(url: &Url) -> USVString { USVString(quirks::hostname(url).to_owned()) }
|
||||
pub fn password(url: &Url) -> USVString { USVString(quirks::password(url).to_owned()) }
|
||||
pub fn pathname(url: &Url) -> USVString { USVString(quirks::pathname(url).to_owned()) }
|
||||
pub fn protocol(url: &Url) -> USVString { USVString(quirks::protocol(url).to_owned()) }
|
||||
pub fn username(url: &Url) -> USVString { USVString(quirks::username(url).to_owned()) }
|
||||
pub fn set_hash(url: &mut Url, value: USVString) { quirks::set_hash(url, &value.0) }
|
||||
pub fn set_host(url: &mut Url, value: USVString) { let _ = quirks::set_host(url, &value.0); }
|
||||
pub fn set_port(url: &mut Url, value: USVString) { let _ = quirks::set_port(url, &value.0); }
|
||||
pub fn set_search(url: &mut Url, value: USVString) { quirks::set_search(url, &value.0) }
|
||||
pub fn set_pathname(url: &mut Url, value: USVString) { quirks::set_pathname(url, &value.0) }
|
||||
pub fn set_hostname(url: &mut Url, value: USVString) { let _ = quirks::set_hostname(url, &value.0); }
|
||||
pub fn set_password(url: &mut Url, value: USVString) { let _ = quirks::set_password(url, &value.0); }
|
||||
pub fn set_protocol(url: &mut Url, value: USVString) { let _ = quirks::set_protocol(url, &value.0); }
|
||||
pub fn set_username(url: &mut Url, value: USVString) { let _ = quirks::set_username(url, &value.0); }
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ impl WebSocket {
|
|||
}
|
||||
|
||||
// Step 6: Origin.
|
||||
let origin = UrlHelper::Origin(&global.get_url()).0;
|
||||
let origin = UrlHelper::origin(&global.get_url()).0;
|
||||
|
||||
// Step 7.
|
||||
let ws = WebSocket::new(global, resource_url.clone());
|
||||
|
|
|
@ -1536,7 +1536,7 @@ impl Window {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#accessing-other-browsing-contexts
|
||||
pub fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option<Root<Window>> {
|
||||
pub fn indexed_getter(&self, _index: u32, _found: &mut bool) -> Option<Root<Window>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
@ -37,42 +37,42 @@ impl WorkerLocation {
|
|||
impl WorkerLocationMethods for WorkerLocation {
|
||||
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-hash
|
||||
fn Hash(&self) -> USVString {
|
||||
UrlHelper::Hash(&self.url)
|
||||
UrlHelper::hash(&self.url)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-host
|
||||
fn Host(&self) -> USVString {
|
||||
UrlHelper::Host(&self.url)
|
||||
UrlHelper::host(&self.url)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-hostname
|
||||
fn Hostname(&self) -> USVString {
|
||||
UrlHelper::Hostname(&self.url)
|
||||
UrlHelper::hostname(&self.url)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-href
|
||||
fn Href(&self) -> USVString {
|
||||
UrlHelper::Href(&self.url)
|
||||
UrlHelper::href(&self.url)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-pathname
|
||||
fn Pathname(&self) -> USVString {
|
||||
UrlHelper::Pathname(&self.url)
|
||||
UrlHelper::pathname(&self.url)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-port
|
||||
fn Port(&self) -> USVString {
|
||||
UrlHelper::Port(&self.url)
|
||||
UrlHelper::port(&self.url)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-protocol
|
||||
fn Protocol(&self) -> USVString {
|
||||
UrlHelper::Protocol(&self.url)
|
||||
UrlHelper::protocol(&self.url)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-search
|
||||
fn Search(&self) -> USVString {
|
||||
UrlHelper::Search(&self.url)
|
||||
UrlHelper::search(&self.url)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-href
|
||||
|
|
|
@ -370,11 +370,11 @@ unsafe extern "C" fn gc_slice_callback(_rt: *mut JSRuntime, progress: GCProgress
|
|||
};
|
||||
if !desc.is_null() {
|
||||
let desc: &GCDescription = &*desc;
|
||||
let invocationKind = match desc.invocationKind_ {
|
||||
let invocation_kind = match desc.invocationKind_ {
|
||||
JSGCInvocationKind::GC_NORMAL => "GC_NORMAL",
|
||||
JSGCInvocationKind::GC_SHRINK => "GC_SHRINK",
|
||||
};
|
||||
println!(" isCompartment={}, invocationKind={}", desc.isCompartment_, invocationKind);
|
||||
println!(" isCompartment={}, invocation_kind={}", desc.isCompartment_, invocation_kind);
|
||||
}
|
||||
let _ = stdout().flush();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue