mirror of
https://github.com/servo/servo.git
synced 2025-06-22 16:18:59 +01:00
Generate bindings for HTMLTableElement.
This commit is contained in:
parent
c5125ca5e2
commit
655bdcc511
10 changed files with 175 additions and 4 deletions
|
@ -560,6 +560,7 @@ addHTMLElement('HTMLParagraphElement')
|
||||||
addHTMLElement('HTMLScriptElement')
|
addHTMLElement('HTMLScriptElement')
|
||||||
addHTMLElement('HTMLSpanElement')
|
addHTMLElement('HTMLSpanElement')
|
||||||
addHTMLElement('HTMLStyleElement')
|
addHTMLElement('HTMLStyleElement')
|
||||||
|
addHTMLElement('HTMLTableElement')
|
||||||
|
|
||||||
# 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
|
||||||
|
|
|
@ -4628,6 +4628,7 @@ class CGBindingRoot(CGThing):
|
||||||
'dom::htmlolistelement::HTMLOListElement',
|
'dom::htmlolistelement::HTMLOListElement',
|
||||||
'dom::htmlscriptelement::HTMLScriptElement',
|
'dom::htmlscriptelement::HTMLScriptElement',
|
||||||
'dom::htmlstyleelement::HTMLStyleElement',
|
'dom::htmlstyleelement::HTMLStyleElement',
|
||||||
|
'dom::htmltableelement::HTMLTableElement',
|
||||||
'dom::bindings::utils::*',
|
'dom::bindings::utils::*',
|
||||||
'dom::bindings::conversions::*',
|
'dom::bindings::conversions::*',
|
||||||
'dom::blob::*', #XXXjdm
|
'dom::blob::*', #XXXjdm
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
/* -*- 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/
|
||||||
|
*
|
||||||
|
* © 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 HTMLTableElement : HTMLElement {
|
||||||
|
/*
|
||||||
|
attribute HTMLTableCaptionElement? caption;
|
||||||
|
HTMLElement createCaption();
|
||||||
|
*/
|
||||||
|
void deleteCaption();
|
||||||
|
/*
|
||||||
|
[SetterThrows]
|
||||||
|
attribute HTMLTableSectionElement? tHead;
|
||||||
|
HTMLElement createTHead();
|
||||||
|
*/
|
||||||
|
void deleteTHead();
|
||||||
|
/*
|
||||||
|
[SetterThrows]
|
||||||
|
attribute HTMLTableSectionElement? tFoot;
|
||||||
|
HTMLElement createTFoot();
|
||||||
|
*/
|
||||||
|
void deleteTFoot();
|
||||||
|
/*
|
||||||
|
readonly attribute HTMLCollection tBodies;
|
||||||
|
HTMLElement createTBody();
|
||||||
|
readonly attribute HTMLCollection rows;
|
||||||
|
[Throws]
|
||||||
|
HTMLElement insertRow(optional long index = -1);
|
||||||
|
*/
|
||||||
|
[Throws]
|
||||||
|
void deleteRow(long index);
|
||||||
|
attribute boolean sortable;
|
||||||
|
void stopSorting();
|
||||||
|
};
|
||||||
|
|
||||||
|
partial interface HTMLTableElement {
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString align;
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString border;
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString frame;
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString rules;
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString summary;
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString width;
|
||||||
|
|
||||||
|
[TreatNullAs=EmptyString, SetterThrows] attribute DOMString bgColor;
|
||||||
|
[TreatNullAs=EmptyString, SetterThrows] attribute DOMString cellPadding;
|
||||||
|
[TreatNullAs=EmptyString, SetterThrows] attribute DOMString cellSpacing;
|
||||||
|
};
|
|
@ -10,7 +10,7 @@ use dom::element::{HTMLHeadElementTypeId, HTMLHtmlElementTypeId, HTMLAnchorEleme
|
||||||
use dom::element::{HTMLDivElementTypeId, HTMLImageElementTypeId, HTMLSpanElementTypeId};
|
use dom::element::{HTMLDivElementTypeId, HTMLImageElementTypeId, HTMLSpanElementTypeId};
|
||||||
use dom::element::{HTMLBodyElementTypeId, HTMLHRElementTypeId, HTMLIframeElementTypeId};
|
use dom::element::{HTMLBodyElementTypeId, HTMLHRElementTypeId, HTMLIframeElementTypeId};
|
||||||
use dom::element::{HTMLParagraphElementTypeId, HTMLScriptElementTypeId, HTMLMetaElementTypeId};
|
use dom::element::{HTMLParagraphElementTypeId, HTMLScriptElementTypeId, HTMLMetaElementTypeId};
|
||||||
use dom::element::{HTMLOListElementTypeId, HTMLStyleElementTypeId};
|
use dom::element::{HTMLOListElementTypeId, HTMLStyleElementTypeId, HTMLTableElementTypeId};
|
||||||
use dom::element::{HTMLHeadElement, HTMLHtmlElement, HTMLDivElement, HTMLSpanElement};
|
use dom::element::{HTMLHeadElement, HTMLHtmlElement, HTMLDivElement, HTMLSpanElement};
|
||||||
use dom::element::{HTMLParagraphElement};
|
use dom::element::{HTMLParagraphElement};
|
||||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||||
|
@ -22,6 +22,7 @@ use dom::htmlmetaelement::HTMLMetaElement;
|
||||||
use dom::htmlolistelement::HTMLOListElement;
|
use dom::htmlolistelement::HTMLOListElement;
|
||||||
use dom::htmlscriptelement::HTMLScriptElement;
|
use dom::htmlscriptelement::HTMLScriptElement;
|
||||||
use dom::htmlstyleelement::HTMLStyleElement;
|
use dom::htmlstyleelement::HTMLStyleElement;
|
||||||
|
use dom::htmltableelement::HTMLTableElement;
|
||||||
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};
|
||||||
|
|
||||||
|
@ -101,6 +102,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
||||||
ElementNodeTypeId(HTMLScriptElementTypeId) => generate_element!(HTMLScriptElement),
|
ElementNodeTypeId(HTMLScriptElementTypeId) => generate_element!(HTMLScriptElement),
|
||||||
ElementNodeTypeId(HTMLSpanElementTypeId) => generate_element!(HTMLSpanElement),
|
ElementNodeTypeId(HTMLSpanElementTypeId) => generate_element!(HTMLSpanElement),
|
||||||
ElementNodeTypeId(HTMLStyleElementTypeId) => generate_element!(HTMLStyleElement),
|
ElementNodeTypeId(HTMLStyleElementTypeId) => generate_element!(HTMLStyleElement),
|
||||||
|
ElementNodeTypeId(HTMLTableElementTypeId) => generate_element!(HTMLTableElement),
|
||||||
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,
|
||||||
|
|
|
@ -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, ..44]);
|
let protoArray = @mut ([0 as *JSObject, ..45]);
|
||||||
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
|
||||||
|
|
|
@ -11,6 +11,7 @@ use dom::bindings::codegen::{HTMLParagraphElementBinding, HTMLScriptElementBindi
|
||||||
use dom::bindings::codegen::{HTMLDivElementBinding, HTMLSpanElementBinding};
|
use dom::bindings::codegen::{HTMLDivElementBinding, HTMLSpanElementBinding};
|
||||||
use dom::bindings::codegen::{HTMLImageElementBinding, HTMLOListElementBinding};
|
use dom::bindings::codegen::{HTMLImageElementBinding, HTMLOListElementBinding};
|
||||||
use dom::bindings::codegen::{HTMLMetaElementBinding, HTMLStyleElementBinding};
|
use dom::bindings::codegen::{HTMLMetaElementBinding, HTMLStyleElementBinding};
|
||||||
|
use dom::bindings::codegen::{HTMLTableElementBinding};
|
||||||
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;
|
||||||
|
@ -26,6 +27,7 @@ use dom::htmlmetaelement::HTMLMetaElement;
|
||||||
use dom::htmlolistelement::HTMLOListElement;
|
use dom::htmlolistelement::HTMLOListElement;
|
||||||
use dom::htmlscriptelement::HTMLScriptElement;
|
use dom::htmlscriptelement::HTMLScriptElement;
|
||||||
use dom::htmlstyleelement::HTMLStyleElement;
|
use dom::htmlstyleelement::HTMLStyleElement;
|
||||||
|
use dom::htmltableelement::HTMLTableElement;
|
||||||
use dom::node::{ElementNodeTypeId, Node, ScriptView, AbstractNode};
|
use dom::node::{ElementNodeTypeId, Node, ScriptView, AbstractNode};
|
||||||
use layout_interface::{ContentBoxQuery, ContentBoxResponse, ContentBoxesQuery};
|
use layout_interface::{ContentBoxQuery, ContentBoxResponse, ContentBoxesQuery};
|
||||||
use layout_interface::{ContentBoxesResponse};
|
use layout_interface::{ContentBoxesResponse};
|
||||||
|
@ -123,7 +125,6 @@ pub struct HTMLSmallElement { parent: HTMLElement }
|
||||||
pub struct HTMLSpanElement { parent: HTMLElement }
|
pub struct HTMLSpanElement { parent: HTMLElement }
|
||||||
pub struct HTMLTableBodyElement { parent: HTMLElement }
|
pub struct HTMLTableBodyElement { parent: HTMLElement }
|
||||||
pub struct HTMLTableCellElement { parent: HTMLElement }
|
pub struct HTMLTableCellElement { parent: HTMLElement }
|
||||||
pub struct HTMLTableElement { parent: HTMLElement }
|
|
||||||
pub struct HTMLTableRowElement { parent: HTMLElement }
|
pub struct HTMLTableRowElement { parent: HTMLElement }
|
||||||
pub struct HTMLTitleElement { parent: HTMLElement }
|
pub struct HTMLTitleElement { parent: HTMLElement }
|
||||||
pub struct HTMLUListElement { parent: HTMLElement }
|
pub struct HTMLUListElement { parent: HTMLElement }
|
||||||
|
@ -209,6 +210,8 @@ generate_cacheable_wrapper!(HTMLSpanElement, HTMLSpanElementBinding::Wrap)
|
||||||
generate_binding_object!(HTMLSpanElement)
|
generate_binding_object!(HTMLSpanElement)
|
||||||
generate_cacheable_wrapper!(HTMLStyleElement, HTMLStyleElementBinding::Wrap)
|
generate_cacheable_wrapper!(HTMLStyleElement, HTMLStyleElementBinding::Wrap)
|
||||||
generate_binding_object!(HTMLStyleElement)
|
generate_binding_object!(HTMLStyleElement)
|
||||||
|
generate_cacheable_wrapper!(HTMLTableElement, HTMLTableElementBinding::Wrap)
|
||||||
|
generate_binding_object!(HTMLTableElement)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fancier elements
|
// Fancier elements
|
||||||
|
|
98
src/components/script/dom/htmltableelement.rs
Normal file
98
src/components/script/dom/htmltableelement.rs
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
/* 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 HTMLTableElement {
|
||||||
|
parent: HTMLElement,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl HTMLTableElement {
|
||||||
|
|
||||||
|
pub fn DeleteCaption(&self) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn DeleteTHead(&self) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn DeleteTFoot(&self) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn DeleteRow(&mut self, _index: i32, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Sortable(&self) -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetSortable(&self, _sortable: bool) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn StopSorting(&self) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Align(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Border(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetBorder(&self, _border: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Frame(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetFrame(&self, _frame: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Rules(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetRules(&self, _rules: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Summary(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetSummary(&self, _summary: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Width(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetWidth(&self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn BgColor(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn CellPadding(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetCellPadding(&self, _cell_padding: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn CellSpacing(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetCellSpacing(&self, _cell_spacing: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,7 +22,7 @@ use dom::element::{HTMLAsideElement, HTMLBRElement,
|
||||||
HTMLOptionElement, HTMLParagraphElement, HTMLListItemElement,
|
HTMLOptionElement, HTMLParagraphElement, HTMLListItemElement,
|
||||||
HTMLSectionElement, HTMLSelectElement, HTMLSmallElement,
|
HTMLSectionElement, HTMLSelectElement, HTMLSmallElement,
|
||||||
HTMLSpanElement, HTMLTableBodyElement,
|
HTMLSpanElement, HTMLTableBodyElement,
|
||||||
HTMLTableCellElement, HTMLTableElement, HTMLTableRowElement,
|
HTMLTableCellElement, HTMLTableRowElement,
|
||||||
HTMLTitleElement, HTMLUListElement};
|
HTMLTitleElement, HTMLUListElement};
|
||||||
use dom::element::{HTMLHeadingElementTypeId, Heading1, Heading2, Heading3, Heading4, Heading5,
|
use dom::element::{HTMLHeadingElementTypeId, Heading1, Heading2, Heading3, Heading4, Heading5,
|
||||||
Heading6};
|
Heading6};
|
||||||
|
@ -35,6 +35,7 @@ use dom::htmlmetaelement::HTMLMetaElement;
|
||||||
use dom::htmlolistelement::HTMLOListElement;
|
use dom::htmlolistelement::HTMLOListElement;
|
||||||
use dom::htmlscriptelement::HTMLScriptElement;
|
use dom::htmlscriptelement::HTMLScriptElement;
|
||||||
use dom::htmlstyleelement::HTMLStyleElement;
|
use dom::htmlstyleelement::HTMLStyleElement;
|
||||||
|
use dom::htmltableelement::HTMLTableElement;
|
||||||
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};
|
||||||
|
|
|
@ -59,6 +59,7 @@ pub mod dom {
|
||||||
pub mod HTMLScriptElementBinding;
|
pub mod HTMLScriptElementBinding;
|
||||||
pub mod HTMLSpanElementBinding;
|
pub mod HTMLSpanElementBinding;
|
||||||
pub mod HTMLStyleElementBinding;
|
pub mod HTMLStyleElementBinding;
|
||||||
|
pub mod HTMLTableElementBinding;
|
||||||
pub mod MouseEventBinding;
|
pub mod MouseEventBinding;
|
||||||
pub mod NodeBinding;
|
pub mod NodeBinding;
|
||||||
pub mod PrototypeList;
|
pub mod PrototypeList;
|
||||||
|
@ -91,6 +92,7 @@ pub mod dom {
|
||||||
pub mod htmlolistelement;
|
pub mod htmlolistelement;
|
||||||
pub mod htmlscriptelement;
|
pub mod htmlscriptelement;
|
||||||
pub mod htmlstyleelement;
|
pub mod htmlstyleelement;
|
||||||
|
pub mod htmltableelement;
|
||||||
pub mod mouseevent;
|
pub mod mouseevent;
|
||||||
pub mod node;
|
pub mod node;
|
||||||
pub mod uievent;
|
pub mod uievent;
|
||||||
|
|
|
@ -20,5 +20,6 @@
|
||||||
<applet></applet>
|
<applet></applet>
|
||||||
<iframe></iframe>
|
<iframe></iframe>
|
||||||
<ol type="1"></ol>
|
<ol type="1"></ol>
|
||||||
|
<table></table>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue