mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Generate bindings for HTMLDirectoryElement and HTMLEmbedElement
This commit is contained in:
parent
f68639755d
commit
7e9caddb39
10 changed files with 179 additions and 13 deletions
|
@ -559,8 +559,10 @@ addHTMLElement('HTMLCanvasElement')
|
|||
addHTMLElement('HTMLDataElement')
|
||||
addHTMLElement('HTMLDivElement')
|
||||
addHTMLElement('HTMLDataListElement')
|
||||
addHTMLElement('HTMLDirectoryElement')
|
||||
addHTMLElement('HTMLDListElement')
|
||||
addHTMLElement('HTMLElement')
|
||||
addHTMLElement('HTMLEmbedElement')
|
||||
addHTMLElement('HTMLFormElement')
|
||||
addHTMLElement('HTMLHeadElement')
|
||||
addHTMLElement('HTMLHtmlElement')
|
||||
|
|
|
@ -4628,7 +4628,9 @@ class CGBindingRoot(CGThing):
|
|||
'dom::htmldataelement::HTMLDataElement', #XXXjune0cho
|
||||
'dom::htmldatalistelement::HTMLDataListElement',
|
||||
'dom::htmldlistelement::HTMLDListElement',
|
||||
'dom::htmldirectoryelement::HTMLDirectoryElement',
|
||||
'dom::htmlelement::HTMLElement', #XXXjdm
|
||||
'dom::htmlembedelement::HTMLEmbedElement', #XXXjdm
|
||||
'dom::htmldocument::HTMLDocument', #XXXjdm
|
||||
'dom::htmlhrelement::HTMLHRElement',
|
||||
'dom::htmliframeelement::HTMLIFrameElement', #XXXjdm
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/* -*- 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/#other-elements,-attributes-and-apis
|
||||
*
|
||||
* © 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/#other-elements,-attributes-and-apis
|
||||
interface HTMLDirectoryElement : HTMLElement {
|
||||
[SetterThrows, Pure]
|
||||
attribute boolean compact;
|
||||
};
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/* -*- 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-embed-element
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/#HTMLEmbedElement-partial
|
||||
*
|
||||
* © 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-embed-element
|
||||
[NeedNewResolve]
|
||||
interface HTMLEmbedElement : HTMLElement {
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString src;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString type;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString width;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString height;
|
||||
//[Throws]
|
||||
//legacycaller any (any... arguments);
|
||||
};
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#HTMLEmbedElement-partial
|
||||
partial interface HTMLEmbedElement {
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString align;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString name;
|
||||
};
|
||||
|
||||
partial interface HTMLEmbedElement {
|
||||
// GetSVGDocument
|
||||
Document? getSVGDocument();
|
||||
};
|
||||
|
||||
//HTMLEmbedElement implements MozImageLoadingContent;
|
||||
//HTMLEmbedElement implements MozFrameLoaderOwner;
|
||||
//HTMLEmbedElement implements MozObjectLoadingContent;
|
|
@ -11,10 +11,11 @@ use dom::element::{HTMLElementTypeId,
|
|||
HTMLAreaElementTypeId, HTMLBaseElementTypeId,
|
||||
HTMLBodyElementTypeId, HTMLBRElementTypeId, HTMLButtonElementTypeId,
|
||||
HTMLCanvasElementTypeId, HTMLDataElementTypeId, HTMLDataListElementTypeId,
|
||||
HTMLDivElementTypeId, HTMLHeadElementTypeId, HTMLHRElementTypeId,
|
||||
HTMLHtmlElementTypeId, HTMLIframeElementTypeId, HTMLImageElementTypeId,
|
||||
HTMLInputElementTypeId, HTMLLIElementTypeId, HTMLLinkElementTypeId,
|
||||
HTMLMetaElementTypeId, HTMLOListElementTypeId,
|
||||
HTMLDirectoryElementTypeId, HTMLDivElementTypeId, HTMLEmbedElementTypeId,
|
||||
HTMLHeadElementTypeId,
|
||||
HTMLHRElementTypeId, HTMLHtmlElementTypeId, HTMLIframeElementTypeId,
|
||||
HTMLImageElementTypeId, HTMLInputElementTypeId, HTMLLIElementTypeId,
|
||||
HTMLLinkElementTypeId, HTMLMetaElementTypeId, HTMLOListElementTypeId,
|
||||
HTMLParagraphElementTypeId, HTMLProgressElementTypeId,
|
||||
HTMLQuoteElementTypeId, HTMLScriptElementTypeId,
|
||||
HTMLSpanElementTypeId, HTMLSourceElementTypeId,
|
||||
|
@ -36,7 +37,9 @@ use dom::htmlbrelement::HTMLBRElement;
|
|||
use dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
use dom::htmldataelement::HTMLDataElement;
|
||||
use dom::htmldatalistelement::HTMLDataListElement;
|
||||
use dom::htmldirectoryelement::HTMLDirectoryElement;
|
||||
use dom::htmldlistelement::HTMLDListElement;
|
||||
use dom::htmlembedelement::HTMLEmbedElement;
|
||||
use dom::htmliframeelement::HTMLIFrameElement;
|
||||
use dom::htmlimageelement::HTMLImageElement;
|
||||
use dom::htmlinputelement::HTMLInputElement;
|
||||
|
@ -134,8 +137,10 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
|||
ElementNodeTypeId(HTMLCanvasElementTypeId) => generate_element!(HTMLCanvasElement),
|
||||
ElementNodeTypeId(HTMLDataElementTypeId) => generate_element!(HTMLDataElement),
|
||||
ElementNodeTypeId(HTMLDataListElementTypeId) => generate_element!(HTMLDataListElement),
|
||||
ElementNodeTypeId(HTMLDirectoryElementTypeId) => generate_element!(HTMLDirectoryElement),
|
||||
ElementNodeTypeId(HTMLDListElementTypeId) => generate_element!(HTMLDListElement),
|
||||
ElementNodeTypeId(HTMLDivElementTypeId) => generate_element!(HTMLDivElement),
|
||||
ElementNodeTypeId(HTMLEmbedElementTypeId) => generate_element!(HTMLEmbedElement),
|
||||
ElementNodeTypeId(HTMLHeadElementTypeId) => generate_element!(HTMLHeadElement),
|
||||
ElementNodeTypeId(HTMLHRElementTypeId) => generate_element!(HTMLHRElement),
|
||||
ElementNodeTypeId(HTMLHtmlElementTypeId) => generate_element!(HTMLHtmlElement),
|
||||
|
|
|
@ -9,11 +9,12 @@ use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLAppletElementBinding,
|
|||
HTMLBodyElementBinding, HTMLBRElementBinding,
|
||||
HTMLButtonElementBinding, HTMLCanvasElementBinding,
|
||||
HTMLDataElementBinding, HTMLDataListElementBinding,
|
||||
HTMLDListElementBinding, HTMLDivElementBinding,
|
||||
HTMLHeadElementBinding, HTMLHRElementBinding,
|
||||
HTMLHtmlElementBinding, HTMLIFrameElementBinding,
|
||||
HTMLImageElementBinding, HTMLInputElementBinding,
|
||||
HTMLLIElementBinding,
|
||||
HTMLDirectoryElementBinding, HTMLDListElementBinding,
|
||||
HTMLDivElementBinding, HTMLEmbedElementBinding,
|
||||
HTMLHeadElementBinding,
|
||||
HTMLHRElementBinding, HTMLHtmlElementBinding,
|
||||
HTMLIFrameElementBinding, HTMLImageElementBinding,
|
||||
HTMLInputElementBinding, HTMLLIElementBinding,
|
||||
HTMLLinkElementBinding, HTMLMetaElementBinding,
|
||||
HTMLOListElementBinding, HTMLParagraphElementBinding,
|
||||
HTMLProgressElementBinding, HTMLQuoteElementBinding,
|
||||
|
@ -38,8 +39,10 @@ use dom::htmlcanvaselement::HTMLCanvasElement;
|
|||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::htmldataelement::HTMLDataElement;
|
||||
use dom::htmldatalistelement::HTMLDataListElement;
|
||||
use dom::htmldirectoryelement::HTMLDirectoryElement;
|
||||
use dom::htmldlistelement::HTMLDListElement;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::htmlembedelement::HTMLEmbedElement;
|
||||
use dom::htmlhrelement::HTMLHRElement;
|
||||
use dom::htmliframeelement::HTMLIFrameElement;
|
||||
use dom::htmlimageelement::HTMLImageElement;
|
||||
|
@ -111,8 +114,10 @@ pub enum ElementTypeId {
|
|||
HTMLCanvasElementTypeId,
|
||||
HTMLDataElementTypeId,
|
||||
HTMLDataListElementTypeId,
|
||||
HTMLDirectoryElementTypeId,
|
||||
HTMLDListElementTypeId,
|
||||
HTMLDivElementTypeId,
|
||||
HTMLEmbedElementTypeId,
|
||||
HTMLFontElementTypeId,
|
||||
HTMLFormElementTypeId,
|
||||
HTMLHRElementTypeId,
|
||||
|
@ -245,8 +250,12 @@ generate_cacheable_wrapper!(HTMLHtmlElement, HTMLHtmlElementBinding::Wrap)
|
|||
generate_binding_object!(HTMLHtmlElement)
|
||||
generate_cacheable_wrapper!(HTMLDataElement, HTMLDataElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLDataElement)
|
||||
generate_cacheable_wrapper!(HTMLDirectoryElement, HTMLDirectoryElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLDirectoryElement)
|
||||
generate_cacheable_wrapper!(HTMLDivElement, HTMLDivElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLDivElement)
|
||||
generate_cacheable_wrapper!(HTMLEmbedElement, HTMLEmbedElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLEmbedElement)
|
||||
generate_cacheable_wrapper!(HTMLIFrameElement, HTMLIFrameElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLIFrameElement)
|
||||
generate_cacheable_wrapper!(HTMLImageElement, HTMLImageElementBinding::Wrap)
|
||||
|
|
19
src/components/script/dom/htmldirectoryelement.rs
Normal file
19
src/components/script/dom/htmldirectoryelement.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
/* 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::ErrorResult;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLDirectoryElement {
|
||||
parent: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLDirectoryElement {
|
||||
pub fn Compact(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetCompact(&mut self, _compact: bool, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
59
src/components/script/dom/htmlembedelement.rs
Normal file
59
src/components/script/dom/htmlembedelement.rs
Normal file
|
@ -0,0 +1,59 @@
|
|||
/* 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::document::AbstractDocument;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLEmbedElement {
|
||||
parent: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLEmbedElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn GetSVGDocument(&self) -> Option<AbstractDocument> {
|
||||
None
|
||||
}
|
||||
}
|
|
@ -7,10 +7,10 @@ use dom::element::{HTMLElementTypeId,
|
|||
HTMLAreaElementTypeId, HTMLBaseElementTypeId, HTMLBodyElementTypeId,
|
||||
HTMLBRElementTypeId, HTMLButtonElementTypeId, HTMLCanvasElementTypeId,
|
||||
HTMLDataElementTypeId, HTMLDataListElementTypeId, HTMLDivElementTypeId,
|
||||
HTMLDListElementTypeId, HTMLFontElementTypeId, HTMLFormElementTypeId,
|
||||
HTMLHRElementTypeId, HTMLHeadElementTypeId, HTMLHtmlElementTypeId,
|
||||
HTMLImageElementTypeId, HTMLIframeElementTypeId, HTMLInputElementTypeId,
|
||||
HTMLLinkElementTypeId, HTMLLIElementTypeId,
|
||||
HTMLDirectoryElementTypeId, HTMLDListElementTypeId, HTMLFontElementTypeId,
|
||||
HTMLFormElementTypeId, HTMLHRElementTypeId, HTMLHeadElementTypeId,
|
||||
HTMLHtmlElementTypeId, HTMLImageElementTypeId, HTMLIframeElementTypeId,
|
||||
HTMLInputElementTypeId, HTMLLinkElementTypeId, HTMLLIElementTypeId,
|
||||
HTMLMetaElementTypeId, HTMLOListElementTypeId, HTMLOptionElementTypeId,
|
||||
HTMLParagraphElementTypeId, HTMLProgressElementTypeId,
|
||||
HTMLQuoteElementTypeId, HTMLScriptElementTypeId,
|
||||
|
@ -38,6 +38,7 @@ use dom::htmlbuttonelement::HTMLButtonElement;
|
|||
use dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
use dom::htmldataelement::HTMLDataElement;
|
||||
use dom::htmldatalistelement::HTMLDataListElement;
|
||||
use dom::htmldirectoryelement::HTMLDirectoryElement;
|
||||
use dom::htmldlistelement::HTMLDListElement;
|
||||
use dom::htmlhrelement::HTMLHRElement;
|
||||
use dom::htmliframeelement::{IFrameSize, HTMLIFrameElement};
|
||||
|
@ -252,6 +253,7 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
|
|||
handle_element!(cx, tag, "canvas", HTMLCanvasElementTypeId, HTMLCanvasElement, []);
|
||||
handle_element!(cx, tag, "data", HTMLDataElementTypeId, HTMLDataElement, []);
|
||||
handle_element!(cx, tag, "datalist",HTMLDataListElementTypeId, HTMLDataListElement, []);
|
||||
handle_element!(cx, tag, "directory",HTMLDirectoryElementTypeId, HTMLDirectoryElement, []);
|
||||
handle_element!(cx, tag, "div", HTMLDivElementTypeId, HTMLDivElement, []);
|
||||
handle_element!(cx, tag, "dl", HTMLDListElementTypeId, HTMLDListElement, []);
|
||||
handle_element!(cx, tag, "font", HTMLFontElementTypeId, HTMLFontElement, []);
|
||||
|
|
|
@ -53,10 +53,12 @@ pub mod dom {
|
|||
pub mod HTMLCollectionBinding;
|
||||
pub mod HTMLDataElementBinding;
|
||||
pub mod HTMLDataListElementBinding;
|
||||
pub mod HTMLDirectoryElementBinding;
|
||||
pub mod HTMLDListElementBinding;
|
||||
pub mod HTMLDivElementBinding;
|
||||
pub mod HTMLDocumentBinding;
|
||||
pub mod HTMLElementBinding;
|
||||
pub mod HTMLEmbedElementBinding;
|
||||
pub mod HTMLHeadElementBinding;
|
||||
pub mod HTMLHRElementBinding;
|
||||
pub mod HTMLHtmlElementBinding;
|
||||
|
@ -116,9 +118,11 @@ pub mod dom {
|
|||
pub mod htmlcollection;
|
||||
pub mod htmldataelement;
|
||||
pub mod htmldatalistelement;
|
||||
pub mod htmldirectoryelement;
|
||||
pub mod htmldlistelement;
|
||||
pub mod htmldocument;
|
||||
pub mod htmlelement;
|
||||
pub mod htmlembedelement;
|
||||
pub mod htmlhrelement;
|
||||
pub mod htmliframeelement;
|
||||
pub mod htmlimageelement;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue