mirror of
https://github.com/servo/servo.git
synced 2025-06-18 13:24:29 +00:00
Generate bindings for HTMLUnknownElement.
This commit is contained in:
parent
65c993e7e6
commit
1eb5eeb630
8 changed files with 35 additions and 3 deletions
|
@ -611,6 +611,7 @@ addHTMLElement('HTMLTextAreaElement')
|
|||
addHTMLElement('HTMLTimeElement')
|
||||
addHTMLElement('HTMLTitleElement')
|
||||
addHTMLElement('HTMLUListElement')
|
||||
addHTMLElement('HTMLUnknownElement')
|
||||
|
||||
# If you add one of these, you need to make sure nsDOMQS.h has the relevant
|
||||
# macros added for it
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/* -*- 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/ and
|
||||
* http://dev.w3.org/csswg/cssom-view/
|
||||
*
|
||||
* © 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.
|
||||
*/
|
||||
|
||||
interface HTMLUnknownElement : HTMLElement {
|
||||
};
|
|
@ -445,3 +445,5 @@ generate_cacheable_wrapper!(HTMLTimeElement, HTMLTimeElementBinding::Wrap)
|
|||
generate_binding_object!(HTMLTimeElement)
|
||||
generate_cacheable_wrapper!(HTMLUListElement, HTMLUListElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLUListElement)
|
||||
generate_cacheable_wrapper!(HTMLUnknownElement, HTMLUnknownElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLUnknownElement)
|
||||
|
|
|
@ -128,6 +128,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
|||
ElementNodeTypeId(HTMLTimeElementTypeId) => generate_element!(HTMLTimeElement),
|
||||
ElementNodeTypeId(HTMLTitleElementTypeId) => generate_element!(HTMLTitleElement),
|
||||
ElementNodeTypeId(HTMLUListElementTypeId) => generate_element!(HTMLUListElement),
|
||||
ElementNodeTypeId(HTMLUnknownElementTypeId) => generate_element!(HTMLUnknownElement),
|
||||
ElementNodeTypeId(_) => element::create(cx, node).ptr,
|
||||
CommentNodeTypeId |
|
||||
DoctypeNodeTypeId => text::create(cx, node).ptr,
|
||||
|
|
|
@ -105,7 +105,7 @@ pub enum ElementTypeId {
|
|||
HTMLTimeElementTypeId,
|
||||
HTMLTitleElementTypeId,
|
||||
HTMLUListElementTypeId,
|
||||
UnknownElementTypeId,
|
||||
HTMLUnknownElementTypeId,
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -113,7 +113,6 @@ pub enum ElementTypeId {
|
|||
//
|
||||
|
||||
pub struct HTMLSmallElement { parent: HTMLElement }
|
||||
pub struct UnknownElement { parent: HTMLElement }
|
||||
|
||||
//
|
||||
// Element methods
|
||||
|
|
9
src/components/script/dom/htmlunknownelement.rs
Normal file
9
src/components/script/dom/htmlunknownelement.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
/* 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::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLUnknownElement {
|
||||
parent: HTMLElement
|
||||
}
|
|
@ -258,7 +258,10 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
|
|||
handle_htmlelement!(cx, tag, "section", HTMLElementTypeId, HTMLElement);
|
||||
|
||||
unsafe {
|
||||
Node::as_abstract_node(cx, @Element::new(UnknownElementTypeId, tag.to_str()))
|
||||
let element = @HTMLUnknownElement {
|
||||
parent: HTMLElement::new(HTMLUnknownElementTypeId, tag.to_str())
|
||||
};
|
||||
Node::as_abstract_node(cx, element)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@ pub mod dom {
|
|||
pub mod htmltimeelement;
|
||||
pub mod htmltitleelement;
|
||||
pub mod htmlulistelement;
|
||||
pub mod htmlunknownelement;
|
||||
pub mod mouseevent;
|
||||
pub mod node;
|
||||
pub mod uievent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue