Generate bindings for HTMLUListElement

This commit is contained in:
Youngsoo Son 2013-08-09 14:57:09 +09:00 committed by Josh Matthews
parent 490e81f75c
commit fa7f367d22
9 changed files with 65 additions and 4 deletions

View file

@ -565,6 +565,7 @@ addHTMLElement('HTMLTableElement')
addHTMLElement('HTMLTableRowElement') addHTMLElement('HTMLTableRowElement')
addHTMLElement('HTMLTableSectionElement') addHTMLElement('HTMLTableSectionElement')
addHTMLElement('HTMLTextAreaElement') addHTMLElement('HTMLTextAreaElement')
addHTMLElement('HTMLUListElement')
# If you add one of these, you need to make sure nsDOMQS.h has the relevant # If you add one of these, you need to make sure nsDOMQS.h has the relevant
# macros added for it # macros added for it

View file

@ -4633,6 +4633,7 @@ class CGBindingRoot(CGThing):
'dom::htmltablerowelement::HTMLTableRowElement', 'dom::htmltablerowelement::HTMLTableRowElement',
'dom::htmltablesectionelement::HTMLTableSectionElement', 'dom::htmltablesectionelement::HTMLTableSectionElement',
'dom::htmltextareaelement::HTMLTextAreaElement', 'dom::htmltextareaelement::HTMLTextAreaElement',
'dom::htmlulistelement::HTMLUListElement',
'dom::bindings::utils::*', 'dom::bindings::utils::*',
'dom::bindings::conversions::*', 'dom::bindings::conversions::*',
'dom::blob::*', #XXXjdm 'dom::blob::*', #XXXjdm

View file

@ -0,0 +1,25 @@
/* -*- 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-ul-element
* 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/#the-ul-element
interface HTMLUListElement : HTMLElement {
};
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLUListElement {
[SetterThrows]
attribute boolean compact;
[SetterThrows]
attribute DOMString type;
};

View file

@ -14,7 +14,7 @@ use dom::element::{HTMLBRElementTypeId};
use dom::element::{HTMLParagraphElementTypeId, HTMLScriptElementTypeId, HTMLMetaElementTypeId}; use dom::element::{HTMLParagraphElementTypeId, HTMLScriptElementTypeId, HTMLMetaElementTypeId};
use dom::element::{HTMLOListElementTypeId, HTMLStyleElementTypeId, HTMLTableElementTypeId}; use dom::element::{HTMLOListElementTypeId, HTMLStyleElementTypeId, HTMLTableElementTypeId};
use dom::element::{HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId}; use dom::element::{HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId};
use dom::element::{HTMLTextAreaElementTypeId}; use dom::element::{HTMLTextAreaElementTypeId, HTMLUListElementTypeId};
use dom::element::{HTMLHeadElement, HTMLHtmlElement, HTMLDivElement, HTMLSpanElement}; use dom::element::{HTMLHeadElement, HTMLHtmlElement, HTMLDivElement, HTMLSpanElement};
use dom::element::{HTMLParagraphElement}; use dom::element::{HTMLParagraphElement};
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
@ -32,6 +32,7 @@ use dom::htmltableelement::HTMLTableElement;
use dom::htmltablerowelement::HTMLTableRowElement; use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmltablesectionelement::HTMLTableSectionElement; use dom::htmltablesectionelement::HTMLTableSectionElement;
use dom::htmltextareaelement::HTMLTextAreaElement; use dom::htmltextareaelement::HTMLTextAreaElement;
use dom::htmlulistelement::HTMLUListElement;
use dom::node::{AbstractNode, Node, ElementNodeTypeId, TextNodeTypeId, CommentNodeTypeId}; use dom::node::{AbstractNode, Node, ElementNodeTypeId, TextNodeTypeId, CommentNodeTypeId};
use dom::node::{DoctypeNodeTypeId, ScriptView, Text}; use dom::node::{DoctypeNodeTypeId, ScriptView, Text};
@ -117,6 +118,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLTableRowElementTypeId) => generate_element!(HTMLTableRowElement), ElementNodeTypeId(HTMLTableRowElementTypeId) => generate_element!(HTMLTableRowElement),
ElementNodeTypeId(HTMLTableSectionElementTypeId) => generate_element!(HTMLTableSectionElement), ElementNodeTypeId(HTMLTableSectionElementTypeId) => generate_element!(HTMLTableSectionElement),
ElementNodeTypeId(HTMLTextAreaElementTypeId) => generate_element!(HTMLTextAreaElement), ElementNodeTypeId(HTMLTextAreaElementTypeId) => generate_element!(HTMLTextAreaElement),
ElementNodeTypeId(HTMLUListElementTypeId) => generate_element!(HTMLUListElement),
ElementNodeTypeId(_) => element::create(cx, node).ptr, ElementNodeTypeId(_) => element::create(cx, node).ptr,
CommentNodeTypeId | CommentNodeTypeId |
DoctypeNodeTypeId => text::create(cx, node).ptr, DoctypeNodeTypeId => text::create(cx, node).ptr,

View file

@ -617,7 +617,7 @@ pub extern fn ThrowingConstructor(_cx: *JSContext, _argc: uint, _vp: *JSVal) ->
} }
pub fn initialize_global(global: *JSObject) { pub fn initialize_global(global: *JSObject) {
let protoArray = @mut ([0 as *JSObject, ..49]); let protoArray = @mut ([0 as *JSObject, ..50]);
assert!(protoArray.len() == PrototypeList::id::_ID_Count as uint); assert!(protoArray.len() == PrototypeList::id::_ID_Count as uint);
unsafe { unsafe {
//XXXjdm we should be storing the box pointer instead of the inner //XXXjdm we should be storing the box pointer instead of the inner

View file

@ -13,6 +13,7 @@ use dom::bindings::codegen::{HTMLImageElementBinding, HTMLOListElementBinding};
use dom::bindings::codegen::{HTMLMetaElementBinding, HTMLStyleElementBinding}; use dom::bindings::codegen::{HTMLMetaElementBinding, HTMLStyleElementBinding};
use dom::bindings::codegen::{HTMLTableElementBinding, HTMLTableRowElementBinding}; use dom::bindings::codegen::{HTMLTableElementBinding, HTMLTableRowElementBinding};
use dom::bindings::codegen::{HTMLTableSectionElementBinding, HTMLTextAreaElementBinding}; use dom::bindings::codegen::{HTMLTableSectionElementBinding, HTMLTextAreaElementBinding};
use dom::bindings::codegen::{HTMLUListElementBinding};
use dom::bindings::utils::{null_string, str}; use dom::bindings::utils::{null_string, str};
use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, WrapperCache}; use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, WrapperCache};
use dom::clientrect::ClientRect; use dom::clientrect::ClientRect;
@ -31,6 +32,7 @@ use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmlstyleelement::HTMLStyleElement; use dom::htmlstyleelement::HTMLStyleElement;
use dom::htmltableelement::HTMLTableElement; use dom::htmltableelement::HTMLTableElement;
use dom::htmltablerowelement::HTMLTableRowElement; use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmlulistelement::HTMLUListElement;
use dom::htmltablesectionelement::HTMLTableSectionElement; use dom::htmltablesectionelement::HTMLTableSectionElement;
use dom::htmltextareaelement::HTMLTextAreaElement; use dom::htmltextareaelement::HTMLTextAreaElement;
use dom::node::{ElementNodeTypeId, Node, ScriptView, AbstractNode}; use dom::node::{ElementNodeTypeId, Node, ScriptView, AbstractNode};
@ -123,7 +125,6 @@ pub struct HTMLSmallElement { parent: HTMLElement }
pub struct HTMLSpanElement { parent: HTMLElement } pub struct HTMLSpanElement { parent: HTMLElement }
pub struct HTMLTableCellElement { parent: HTMLElement } pub struct HTMLTableCellElement { parent: HTMLElement }
pub struct HTMLTitleElement { parent: HTMLElement } pub struct HTMLTitleElement { parent: HTMLElement }
pub struct HTMLUListElement { parent: HTMLElement }
pub struct UnknownElement { parent: HTMLElement } pub struct UnknownElement { parent: HTMLElement }
impl HTMLHtmlElement { impl HTMLHtmlElement {
@ -216,6 +217,8 @@ generate_cacheable_wrapper!(HTMLTableSectionElement, HTMLTableSectionElementBind
generate_binding_object!(HTMLTableSectionElement) generate_binding_object!(HTMLTableSectionElement)
generate_cacheable_wrapper!(HTMLTextAreaElement, HTMLTextAreaElementBinding::Wrap) generate_cacheable_wrapper!(HTMLTextAreaElement, HTMLTextAreaElementBinding::Wrap)
generate_binding_object!(HTMLTextAreaElement) generate_binding_object!(HTMLTextAreaElement)
generate_cacheable_wrapper!(HTMLUListElement, HTMLUListElementBinding::Wrap)
generate_binding_object!(HTMLUListElement)
// //
// Fancier elements // Fancier elements

View file

@ -0,0 +1,26 @@
/* 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 HTMLUListElement {
parent: HTMLElement
}
impl HTMLUListElement {
pub fn Compact(&self) -> bool {
false
}
pub fn SetCompact(&mut self, _compact: bool, _rv: &mut ErrorResult) {
}
pub fn Type(&self) -> DOMString {
null_string
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
}
}

View file

@ -24,7 +24,7 @@ use dom::element::{HTMLDivElement, HTMLFontElement, HTMLFormElement,
HTMLSelectElement, HTMLSmallElement, HTMLSelectElement, HTMLSmallElement,
HTMLSpanElement, HTMLSpanElement,
HTMLTableCellElement, HTMLTableCellElement,
HTMLTitleElement, HTMLUListElement}; HTMLTitleElement};
use dom::element::{HTMLHeadingElementTypeId, Heading1, Heading2, Heading3, Heading4, Heading5, use dom::element::{HTMLHeadingElementTypeId, Heading1, Heading2, Heading3, Heading4, Heading5,
Heading6}; Heading6};
use dom::htmlbrelement::HTMLBRElement; use dom::htmlbrelement::HTMLBRElement;
@ -41,6 +41,7 @@ use dom::htmltableelement::HTMLTableElement;
use dom::htmltablerowelement::HTMLTableRowElement; use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmltablesectionelement::HTMLTableSectionElement; use dom::htmltablesectionelement::HTMLTableSectionElement;
use dom::htmltextareaelement::HTMLTextAreaElement; use dom::htmltextareaelement::HTMLTextAreaElement;
use dom::htmlulistelement::HTMLUListElement;
use dom::element::{Element, Attr}; use dom::element::{Element, Attr};
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Comment, Doctype, ElementNodeTypeId, Node, ScriptView}; use dom::node::{AbstractNode, Comment, Doctype, ElementNodeTypeId, Node, ScriptView};

View file

@ -64,6 +64,7 @@ pub mod dom {
pub mod HTMLTableRowElementBinding; pub mod HTMLTableRowElementBinding;
pub mod HTMLTableSectionElementBinding; pub mod HTMLTableSectionElementBinding;
pub mod HTMLTextAreaElementBinding; pub mod HTMLTextAreaElementBinding;
pub mod HTMLUListElementBinding;
pub mod MouseEventBinding; pub mod MouseEventBinding;
pub mod NodeBinding; pub mod NodeBinding;
pub mod PrototypeList; pub mod PrototypeList;
@ -101,6 +102,7 @@ pub mod dom {
pub mod htmltablerowelement; pub mod htmltablerowelement;
pub mod htmltablesectionelement; pub mod htmltablesectionelement;
pub mod htmltextareaelement; pub mod htmltextareaelement;
pub mod htmlulistelement;
pub mod mouseevent; pub mod mouseevent;
pub mod node; pub mod node;
pub mod uievent; pub mod uievent;