mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Generate bindings for HTMLAppletElement
This commit is contained in:
parent
fe5b795f30
commit
f12406ac24
8 changed files with 150 additions and 3 deletions
|
@ -546,6 +546,7 @@ def addHTMLElement(element):
|
|||
}
|
||||
|
||||
addHTMLElement('HTMLAnchorElement')
|
||||
addHTMLElement('HTMLAppletElement')
|
||||
addHTMLElement('HTMLBodyElement')
|
||||
addHTMLElement('HTMLBRElement')
|
||||
addHTMLElement('HTMLCanvasElement')
|
||||
|
|
|
@ -4618,6 +4618,7 @@ class CGBindingRoot(CGThing):
|
|||
'dom::element::{Element, HTMLHeadElement, HTMLHtmlElement}', #XXXjdm
|
||||
'dom::element::{HTMLDivElement, HTMLSpanElement, HTMLParagraphElement}', #XXXjdm
|
||||
'dom::htmlanchorelement::HTMLAnchorElement', #XXXjdm
|
||||
'dom::htmlappletelement::HTMLAppletElement',
|
||||
'dom::htmlbodyelement::HTMLBodyElement',
|
||||
'dom::htmlbrelement::HTMLBRElement', #XXXrecrack
|
||||
'dom::htmlcanvaselement::HTMLCanvasElement',
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/#the-applet-element
|
||||
*
|
||||
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
|
||||
* Opera Software ASA. You are granted a license to use, reproduce
|
||||
* and create derivative works of this document.
|
||||
*/
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#the-applet-element
|
||||
[NeedNewResolve]
|
||||
interface HTMLAppletElement : HTMLElement {
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString align;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString alt;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString archive;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString code;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString codeBase;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString height;
|
||||
[Pure, SetterThrows]
|
||||
attribute unsigned long hspace;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString name;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString _object;
|
||||
[Pure, SetterThrows]
|
||||
attribute unsigned long vspace;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString width;
|
||||
};
|
||||
|
||||
//HTMLAppletElement implements MozImageLoadingContent;
|
||||
//HTMLAppletElement implements MozFrameLoaderOwner;
|
||||
//HTMLAppletElement implements MozObjectLoadingContent;
|
||||
|
|
@ -7,7 +7,8 @@ use dom::bindings::text;
|
|||
use dom::bindings::utils;
|
||||
use dom::bindings::utils::{CacheableWrapper, WrapperCache, DerivedWrapper};
|
||||
use dom::element::{HTMLElementTypeId,
|
||||
HTMLAnchorElementTypeId, HTMLBodyElementTypeId, HTMLBRElementTypeId,
|
||||
HTMLAnchorElementTypeId, HTMLAppletElementTypeId,
|
||||
HTMLBodyElementTypeId, HTMLBRElementTypeId,
|
||||
HTMLCanvasElementTypeId,
|
||||
HTMLDivElementTypeId, HTMLHeadElementTypeId, HTMLHRElementTypeId,
|
||||
HTMLHtmlElementTypeId, HTMLIframeElementTypeId, HTMLImageElementTypeId,
|
||||
|
@ -21,6 +22,7 @@ use dom::element::{HTMLElementTypeId,
|
|||
use dom::element::{HTMLHeadElement,HTMLHtmlElement, HTMLDivElement, HTMLParagraphElement, HTMLSpanElement};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlappletelement::HTMLAppletElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlhrelement::HTMLHRElement;
|
||||
use dom::htmlbrelement::HTMLBRElement;
|
||||
|
@ -107,6 +109,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
|||
match node.type_id() {
|
||||
ElementNodeTypeId(HTMLElementTypeId) => generate_element!(HTMLElement),
|
||||
ElementNodeTypeId(HTMLAnchorElementTypeId) => generate_element!(HTMLAnchorElement),
|
||||
ElementNodeTypeId(HTMLAppletElementTypeId) => generate_element!(HTMLAppletElement),
|
||||
ElementNodeTypeId(HTMLBodyElementTypeId) => generate_element!(HTMLBodyElement),
|
||||
ElementNodeTypeId(HTMLBRElementTypeId) => generate_element!(HTMLBRElement),
|
||||
ElementNodeTypeId(HTMLCanvasElementTypeId) => generate_element!(HTMLCanvasElement),
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
//! Element nodes.
|
||||
|
||||
use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLBodyElementBinding, HTMLBRElementBinding,
|
||||
use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLAppletElementBinding,
|
||||
HTMLBodyElementBinding, HTMLBRElementBinding,
|
||||
HTMLCanvasElementBinding, HTMLDListElementBinding, HTMLDivElementBinding,
|
||||
HTMLHeadElementBinding, HTMLHRElementBinding,
|
||||
HTMLHtmlElementBinding, HTMLIFrameElementBinding,
|
||||
|
@ -20,6 +21,7 @@ use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResu
|
|||
use dom::clientrect::ClientRect;
|
||||
use dom::clientrectlist::ClientRectList;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlappletelement::HTMLAppletElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlbrelement::HTMLBRElement;
|
||||
use dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
|
@ -81,6 +83,7 @@ impl BindingObject for Element {
|
|||
pub enum ElementTypeId {
|
||||
HTMLElementTypeId,
|
||||
HTMLAnchorElementTypeId,
|
||||
HTMLAppletElementTypeId,
|
||||
HTMLBRElementTypeId,
|
||||
HTMLBodyElementTypeId,
|
||||
HTMLCanvasElementTypeId,
|
||||
|
@ -195,6 +198,8 @@ generate_cacheable_wrapper!(HTMLHeadElement, HTMLHeadElementBinding::Wrap)
|
|||
generate_binding_object!(HTMLHeadElement)
|
||||
generate_cacheable_wrapper!(HTMLAnchorElement, HTMLAnchorElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLAnchorElement)
|
||||
generate_cacheable_wrapper!(HTMLAppletElement, HTMLAppletElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLAppletElement)
|
||||
generate_cacheable_wrapper!(HTMLBodyElement, HTMLBodyElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLBodyElement)
|
||||
generate_cacheable_wrapper!(HTMLCanvasElement, HTMLCanvasElementBinding::Wrap)
|
||||
|
|
89
src/components/script/dom/htmlappletelement.rs
Normal file
89
src/components/script/dom/htmlappletelement.rs
Normal file
|
@ -0,0 +1,89 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::utils::{DOMString, null_string, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLAppletElement {
|
||||
parent: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLAppletElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetAlt(&self, _alt: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Archive(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetArchive(&self, _archive: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Code(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetCode(&self, _code: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn CodeBase(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetCodeBase(&self, _code_base: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetHeight(&self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Hspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetHspace(&mut self, _hspace: u32, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Object(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetObject(&mut self, _object: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Vspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetVspace(&mut self, _vspace: u32, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::element::{HTMLElementTypeId,
|
||||
HTMLAnchorElementTypeId, HTMLBRElementTypeId,
|
||||
HTMLAnchorElementTypeId, HTMLAppletElementTypeId, HTMLBRElementTypeId,
|
||||
HTMLBodyElementTypeId, HTMLCanvasElementTypeId, HTMLDivElementTypeId,
|
||||
HTMLDListElementTypeId,
|
||||
HTMLFontElementTypeId, HTMLFormElementTypeId, HTMLHRElementTypeId,
|
||||
|
@ -28,6 +28,7 @@ use dom::element::{HTMLHeadingElementTypeId, Heading1, Heading2, Heading3, Headi
|
|||
Heading6};
|
||||
use dom::htmlbrelement::HTMLBRElement;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlappletelement::HTMLAppletElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
use dom::htmldlistelement::HTMLDListElement;
|
||||
|
@ -228,6 +229,7 @@ fn js_script_listener(to_parent: SharedChan<HtmlDiscoveryMessage>,
|
|||
fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView> {
|
||||
// TODO (Issue #85): use atoms
|
||||
handle_element!(cx, tag, "a", HTMLAnchorElementTypeId, HTMLAnchorElement, []);
|
||||
handle_element!(cx, tag, "applet", HTMLAppletElementTypeId, HTMLAppletElement, []);
|
||||
handle_element!(cx, tag, "br", HTMLBRElementTypeId, HTMLBRElement, []);
|
||||
handle_element!(cx, tag, "body", HTMLBodyElementTypeId, HTMLBodyElement, []);
|
||||
handle_element!(cx, tag, "canvas", HTMLCanvasElementTypeId, HTMLCanvasElement, []);
|
||||
|
|
|
@ -43,6 +43,7 @@ pub mod dom {
|
|||
pub mod EventTargetBinding;
|
||||
pub mod FormDataBinding;
|
||||
pub mod HTMLAnchorElementBinding;
|
||||
pub mod HTMLAppletElementBinding;
|
||||
pub mod HTMLBodyElementBinding;
|
||||
pub mod HTMLBRElementBinding;
|
||||
pub mod HTMLCanvasElementBinding;
|
||||
|
@ -92,6 +93,7 @@ pub mod dom {
|
|||
pub mod eventtarget;
|
||||
pub mod formdata;
|
||||
pub mod htmlanchorelement;
|
||||
pub mod htmlappletelement;
|
||||
pub mod htmlbodyelement;
|
||||
pub mod htmlbrelement;
|
||||
pub mod htmlcanvaselement;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue