Skip to content

Commit

Permalink
Generate bindings for HTMLUListElement
Browse files Browse the repository at this point in the history
  • Loading branch information
sonwow authored and jdm committed Aug 9, 2013
1 parent 490e81f commit fa7f367
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/codegen/Bindings.conf
Expand Up @@ -565,6 +565,7 @@ addHTMLElement('HTMLTableElement')
addHTMLElement('HTMLTableRowElement')
addHTMLElement('HTMLTableSectionElement')
addHTMLElement('HTMLTextAreaElement')
addHTMLElement('HTMLUListElement')

# If you add one of these, you need to make sure nsDOMQS.h has the relevant
# macros added for it
Expand Down
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -4633,6 +4633,7 @@ def makeEnumTypedef(e):
'dom::htmltablerowelement::HTMLTableRowElement',
'dom::htmltablesectionelement::HTMLTableSectionElement',
'dom::htmltextareaelement::HTMLTextAreaElement',
'dom::htmlulistelement::HTMLUListElement',
'dom::bindings::utils::*',
'dom::bindings::conversions::*',
'dom::blob::*', #XXXjdm
Expand Down
25 changes: 25 additions & 0 deletions src/components/script/dom/bindings/codegen/HTMLUListElement.webidl
@@ -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;
};
4 changes: 3 additions & 1 deletion src/components/script/dom/bindings/node.rs
Expand Up @@ -14,7 +14,7 @@ use dom::element::{HTMLBRElementTypeId};
use dom::element::{HTMLParagraphElementTypeId, HTMLScriptElementTypeId, HTMLMetaElementTypeId};
use dom::element::{HTMLOListElementTypeId, HTMLStyleElementTypeId, HTMLTableElementTypeId};
use dom::element::{HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId};
use dom::element::{HTMLTextAreaElementTypeId};
use dom::element::{HTMLTextAreaElementTypeId, HTMLUListElementTypeId};
use dom::element::{HTMLHeadElement, HTMLHtmlElement, HTMLDivElement, HTMLSpanElement};
use dom::element::{HTMLParagraphElement};
use dom::htmlelement::HTMLElement;
Expand All @@ -32,6 +32,7 @@ use dom::htmltableelement::HTMLTableElement;
use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmltablesectionelement::HTMLTableSectionElement;
use dom::htmltextareaelement::HTMLTextAreaElement;
use dom::htmlulistelement::HTMLUListElement;
use dom::node::{AbstractNode, Node, ElementNodeTypeId, TextNodeTypeId, CommentNodeTypeId};
use dom::node::{DoctypeNodeTypeId, ScriptView, Text};

Expand Down Expand Up @@ -117,6 +118,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLTableRowElementTypeId) => generate_element!(HTMLTableRowElement),
ElementNodeTypeId(HTMLTableSectionElementTypeId) => generate_element!(HTMLTableSectionElement),
ElementNodeTypeId(HTMLTextAreaElementTypeId) => generate_element!(HTMLTextAreaElement),
ElementNodeTypeId(HTMLUListElementTypeId) => generate_element!(HTMLUListElement),
ElementNodeTypeId(_) => element::create(cx, node).ptr,
CommentNodeTypeId |
DoctypeNodeTypeId => text::create(cx, node).ptr,
Expand Down
2 changes: 1 addition & 1 deletion src/components/script/dom/bindings/utils.rs
Expand Up @@ -617,7 +617,7 @@ pub extern fn ThrowingConstructor(_cx: *JSContext, _argc: uint, _vp: *JSVal) ->
}

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);
unsafe {
//XXXjdm we should be storing the box pointer instead of the inner
Expand Down
5 changes: 4 additions & 1 deletion src/components/script/dom/element.rs
Expand Up @@ -13,6 +13,7 @@ use dom::bindings::codegen::{HTMLImageElementBinding, HTMLOListElementBinding};
use dom::bindings::codegen::{HTMLMetaElementBinding, HTMLStyleElementBinding};
use dom::bindings::codegen::{HTMLTableElementBinding, HTMLTableRowElementBinding};
use dom::bindings::codegen::{HTMLTableSectionElementBinding, HTMLTextAreaElementBinding};
use dom::bindings::codegen::{HTMLUListElementBinding};
use dom::bindings::utils::{null_string, str};
use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, WrapperCache};
use dom::clientrect::ClientRect;
Expand All @@ -31,6 +32,7 @@ use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmlstyleelement::HTMLStyleElement;
use dom::htmltableelement::HTMLTableElement;
use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmlulistelement::HTMLUListElement;
use dom::htmltablesectionelement::HTMLTableSectionElement;
use dom::htmltextareaelement::HTMLTextAreaElement;
use dom::node::{ElementNodeTypeId, Node, ScriptView, AbstractNode};
Expand Down Expand Up @@ -123,7 +125,6 @@ pub struct HTMLSmallElement { parent: HTMLElement }
pub struct HTMLSpanElement { parent: HTMLElement }
pub struct HTMLTableCellElement { parent: HTMLElement }
pub struct HTMLTitleElement { parent: HTMLElement }
pub struct HTMLUListElement { parent: HTMLElement }
pub struct UnknownElement { parent: HTMLElement }

impl HTMLHtmlElement {
Expand Down Expand Up @@ -216,6 +217,8 @@ generate_cacheable_wrapper!(HTMLTableSectionElement, HTMLTableSectionElementBind
generate_binding_object!(HTMLTableSectionElement)
generate_cacheable_wrapper!(HTMLTextAreaElement, HTMLTextAreaElementBinding::Wrap)
generate_binding_object!(HTMLTextAreaElement)
generate_cacheable_wrapper!(HTMLUListElement, HTMLUListElementBinding::Wrap)
generate_binding_object!(HTMLUListElement)

//
// Fancier elements
Expand Down
26 changes: 26 additions & 0 deletions src/components/script/dom/htmlulistelement.rs
@@ -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) {
}
}
3 changes: 2 additions & 1 deletion src/components/script/html/hubbub_html_parser.rs
Expand Up @@ -24,7 +24,7 @@ use dom::element::{HTMLDivElement, HTMLFontElement, HTMLFormElement,
HTMLSelectElement, HTMLSmallElement,
HTMLSpanElement,
HTMLTableCellElement,
HTMLTitleElement, HTMLUListElement};
HTMLTitleElement};
use dom::element::{HTMLHeadingElementTypeId, Heading1, Heading2, Heading3, Heading4, Heading5,
Heading6};
use dom::htmlbrelement::HTMLBRElement;
Expand All @@ -41,6 +41,7 @@ use dom::htmltableelement::HTMLTableElement;
use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmltablesectionelement::HTMLTableSectionElement;
use dom::htmltextareaelement::HTMLTextAreaElement;
use dom::htmlulistelement::HTMLUListElement;
use dom::element::{Element, Attr};
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Comment, Doctype, ElementNodeTypeId, Node, ScriptView};
Expand Down
2 changes: 2 additions & 0 deletions src/components/script/script.rc
Expand Up @@ -64,6 +64,7 @@ pub mod dom {
pub mod HTMLTableRowElementBinding;
pub mod HTMLTableSectionElementBinding;
pub mod HTMLTextAreaElementBinding;
pub mod HTMLUListElementBinding;
pub mod MouseEventBinding;
pub mod NodeBinding;
pub mod PrototypeList;
Expand Down Expand Up @@ -101,6 +102,7 @@ pub mod dom {
pub mod htmltablerowelement;
pub mod htmltablesectionelement;
pub mod htmltextareaelement;
pub mod htmlulistelement;
pub mod mouseevent;
pub mod node;
pub mod uievent;
Expand Down

5 comments on commit fa7f367

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at jdm@fa7f367

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging jdm/servo/ulist = fa7f367 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jdm/servo/ulist = fa7f367 merged ok, testing candidate = 2ab430b

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 2ab430b

Please sign in to comment.