mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Generate bindings for HTMLTableColElement.
This commit is contained in:
parent
ce647eb80f
commit
c2391fe5ff
10 changed files with 117 additions and 5 deletions
|
@ -573,6 +573,7 @@ addHTMLElement('HTMLStyleElement')
|
||||||
addHTMLElement('HTMLTableCaptionElement')
|
addHTMLElement('HTMLTableCaptionElement')
|
||||||
addHTMLElement('HTMLTableElement')
|
addHTMLElement('HTMLTableElement')
|
||||||
addHTMLElement('HTMLTableCellElement')
|
addHTMLElement('HTMLTableCellElement')
|
||||||
|
addHTMLElement('HTMLTableColElement')
|
||||||
addHTMLElement('HTMLTableRowElement')
|
addHTMLElement('HTMLTableRowElement')
|
||||||
addHTMLElement('HTMLTableSectionElement')
|
addHTMLElement('HTMLTableSectionElement')
|
||||||
addHTMLElement('HTMLTextAreaElement')
|
addHTMLElement('HTMLTextAreaElement')
|
||||||
|
|
|
@ -4641,6 +4641,7 @@ class CGBindingRoot(CGThing):
|
||||||
'dom::htmltablecaptionelement::HTMLTableCaptionElement',
|
'dom::htmltablecaptionelement::HTMLTableCaptionElement',
|
||||||
'dom::htmltableelement::HTMLTableElement',
|
'dom::htmltableelement::HTMLTableElement',
|
||||||
'dom::htmltablecellelement::HTMLTableCellElement',
|
'dom::htmltablecellelement::HTMLTableCellElement',
|
||||||
|
'dom::htmltablecolelement::HTMLTableColElement',
|
||||||
'dom::htmltablerowelement::HTMLTableRowElement',
|
'dom::htmltablerowelement::HTMLTableRowElement',
|
||||||
'dom::htmltablesectionelement::HTMLTableSectionElement',
|
'dom::htmltablesectionelement::HTMLTableSectionElement',
|
||||||
'dom::htmltextareaelement::HTMLTextAreaElement',
|
'dom::htmltextareaelement::HTMLTextAreaElement',
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
/* -*- 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 HTMLTableColElement : HTMLElement {
|
||||||
|
[SetterThrows]
|
||||||
|
attribute unsigned long span;
|
||||||
|
};
|
||||||
|
|
||||||
|
partial interface HTMLTableColElement {
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString align;
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString ch;
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString chOff;
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString vAlign;
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString width;
|
||||||
|
};
|
|
@ -19,6 +19,7 @@ use dom::element::{HTMLElementTypeId,
|
||||||
HTMLSpanElementTypeId, HTMLSourceElementTypeId,
|
HTMLSpanElementTypeId, HTMLSourceElementTypeId,
|
||||||
HTMLStyleElementTypeId, HTMLTextAreaElementTypeId,
|
HTMLStyleElementTypeId, HTMLTextAreaElementTypeId,
|
||||||
HTMLTableElementTypeId, HTMLTableCaptionElementTypeId, HTMLTableCellElementTypeId,
|
HTMLTableElementTypeId, HTMLTableCaptionElementTypeId, HTMLTableCellElementTypeId,
|
||||||
|
HTMLTableColElementTypeId,
|
||||||
HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId, HTMLTimeElementTypeId,
|
HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId, HTMLTimeElementTypeId,
|
||||||
HTMLTitleElementTypeId, HTMLUListElementTypeId, HTMLDListElementTypeId};
|
HTMLTitleElementTypeId, HTMLUListElementTypeId, HTMLDListElementTypeId};
|
||||||
use dom::element::{HTMLHeadElement,HTMLHtmlElement, HTMLDivElement, HTMLParagraphElement, HTMLSpanElement};
|
use dom::element::{HTMLHeadElement,HTMLHtmlElement, HTMLDivElement, HTMLParagraphElement, HTMLSpanElement};
|
||||||
|
@ -45,6 +46,7 @@ use dom::htmlstyleelement::HTMLStyleElement;
|
||||||
use dom::htmltableelement::HTMLTableElement;
|
use dom::htmltableelement::HTMLTableElement;
|
||||||
use dom::htmltablecaptionelement::HTMLTableCaptionElement;
|
use dom::htmltablecaptionelement::HTMLTableCaptionElement;
|
||||||
use dom::htmltablecellelement::HTMLTableCellElement;
|
use dom::htmltablecellelement::HTMLTableCellElement;
|
||||||
|
use dom::htmltablecolelement::HTMLTableColElement;
|
||||||
use dom::htmltablerowelement::HTMLTableRowElement;
|
use dom::htmltablerowelement::HTMLTableRowElement;
|
||||||
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||||
use dom::htmltextareaelement::HTMLTextAreaElement;
|
use dom::htmltextareaelement::HTMLTextAreaElement;
|
||||||
|
@ -143,6 +145,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
||||||
ElementNodeTypeId(HTMLTableElementTypeId) => generate_element!(HTMLTableElement),
|
ElementNodeTypeId(HTMLTableElementTypeId) => generate_element!(HTMLTableElement),
|
||||||
ElementNodeTypeId(HTMLTableCellElementTypeId) => generate_element!(HTMLTableCellElement),
|
ElementNodeTypeId(HTMLTableCellElementTypeId) => generate_element!(HTMLTableCellElement),
|
||||||
ElementNodeTypeId(HTMLTableCaptionElementTypeId) => generate_element!(HTMLTableCaptionElement),
|
ElementNodeTypeId(HTMLTableCaptionElementTypeId) => generate_element!(HTMLTableCaptionElement),
|
||||||
|
ElementNodeTypeId(HTMLTableColElementTypeId) => generate_element!(HTMLTableColElement),
|
||||||
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),
|
||||||
|
|
|
@ -18,7 +18,7 @@ use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLAppletElementBinding,
|
||||||
HTMLScriptElementBinding, HTMLSourceElementBinding, HTMLSpanElementBinding,
|
HTMLScriptElementBinding, HTMLSourceElementBinding, HTMLSpanElementBinding,
|
||||||
HTMLStyleElementBinding, HTMLTableElementBinding,
|
HTMLStyleElementBinding, HTMLTableElementBinding,
|
||||||
HTMLTableCaptionElementBinding, HTMLTableCellElementBinding,
|
HTMLTableCaptionElementBinding, HTMLTableCellElementBinding,
|
||||||
HTMLTableRowElementBinding,
|
HTMLTableColElementBinding, HTMLTableRowElementBinding,
|
||||||
HTMLTableSectionElementBinding, HTMLTextAreaElementBinding,
|
HTMLTableSectionElementBinding, HTMLTextAreaElementBinding,
|
||||||
HTMLTimeElementBinding, HTMLTitleElementBinding, HTMLUListElementBinding};
|
HTMLTimeElementBinding, HTMLTitleElementBinding, HTMLUListElementBinding};
|
||||||
use dom::bindings::utils::{null_string, str};
|
use dom::bindings::utils::{null_string, str};
|
||||||
|
@ -49,6 +49,7 @@ use dom::htmlstyleelement::HTMLStyleElement;
|
||||||
use dom::htmltableelement::HTMLTableElement;
|
use dom::htmltableelement::HTMLTableElement;
|
||||||
use dom::htmltablecaptionelement::HTMLTableCaptionElement;
|
use dom::htmltablecaptionelement::HTMLTableCaptionElement;
|
||||||
use dom::htmltablecellelement::HTMLTableCellElement;
|
use dom::htmltablecellelement::HTMLTableCellElement;
|
||||||
|
use dom::htmltablecolelement::HTMLTableColElement;
|
||||||
use dom::htmltablerowelement::HTMLTableRowElement;
|
use dom::htmltablerowelement::HTMLTableRowElement;
|
||||||
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||||
use dom::htmltextareaelement::HTMLTextAreaElement;
|
use dom::htmltextareaelement::HTMLTextAreaElement;
|
||||||
|
@ -125,9 +126,10 @@ pub enum ElementTypeId {
|
||||||
HTMLSourceElementTypeId,
|
HTMLSourceElementTypeId,
|
||||||
HTMLSpanElementTypeId,
|
HTMLSpanElementTypeId,
|
||||||
HTMLStyleElementTypeId,
|
HTMLStyleElementTypeId,
|
||||||
|
HTMLTableElementTypeId,
|
||||||
HTMLTableCaptionElementTypeId,
|
HTMLTableCaptionElementTypeId,
|
||||||
HTMLTableCellElementTypeId,
|
HTMLTableCellElementTypeId,
|
||||||
HTMLTableElementTypeId,
|
HTMLTableColElementTypeId,
|
||||||
HTMLTableRowElementTypeId,
|
HTMLTableRowElementTypeId,
|
||||||
HTMLTableSectionElementTypeId,
|
HTMLTableSectionElementTypeId,
|
||||||
HTMLTextAreaElementTypeId,
|
HTMLTextAreaElementTypeId,
|
||||||
|
@ -261,6 +263,8 @@ generate_cacheable_wrapper!(HTMLTableCaptionElement, HTMLTableCaptionElementBind
|
||||||
generate_binding_object!(HTMLTableCaptionElement)
|
generate_binding_object!(HTMLTableCaptionElement)
|
||||||
generate_cacheable_wrapper!(HTMLTableCellElement, HTMLTableCellElementBinding::Wrap)
|
generate_cacheable_wrapper!(HTMLTableCellElement, HTMLTableCellElementBinding::Wrap)
|
||||||
generate_binding_object!(HTMLTableCellElement)
|
generate_binding_object!(HTMLTableCellElement)
|
||||||
|
generate_cacheable_wrapper!(HTMLTableColElement, HTMLTableColElementBinding::Wrap)
|
||||||
|
generate_binding_object!(HTMLTableColElement)
|
||||||
generate_cacheable_wrapper!(HTMLTableRowElement, HTMLTableRowElementBinding::Wrap)
|
generate_cacheable_wrapper!(HTMLTableRowElement, HTMLTableRowElementBinding::Wrap)
|
||||||
generate_binding_object!(HTMLTableRowElement)
|
generate_binding_object!(HTMLTableRowElement)
|
||||||
generate_cacheable_wrapper!(HTMLTableSectionElement, HTMLTableSectionElementBinding::Wrap)
|
generate_cacheable_wrapper!(HTMLTableSectionElement, HTMLTableSectionElementBinding::Wrap)
|
||||||
|
|
54
src/components/script/dom/htmltablecolelement.rs
Normal file
54
src/components/script/dom/htmltablecolelement.rs
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/* 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 HTMLTableColElement {
|
||||||
|
parent: HTMLElement,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl HTMLTableColElement {
|
||||||
|
pub fn Span(&self) -> u32 {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetSpan(&mut self, _span: u32, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Align(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Ch(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetCh(&mut self, _ch: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn ChOff(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetChOff(&mut self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn VAlign(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetVAlign(&mut self, _v_align: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Width(&self) -> DOMString {
|
||||||
|
null_string
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,7 +16,8 @@ use dom::element::{HTMLElementTypeId,
|
||||||
HTMLSelectElementTypeId, HTMLSmallElementTypeId, HTMLSourceElementTypeId,
|
HTMLSelectElementTypeId, HTMLSmallElementTypeId, HTMLSourceElementTypeId,
|
||||||
HTMLSpanElementTypeId, HTMLStyleElementTypeId, HTMLTableSectionElementTypeId,
|
HTMLSpanElementTypeId, HTMLStyleElementTypeId, HTMLTableSectionElementTypeId,
|
||||||
HTMLTableCellElementTypeId, HTMLTableElementTypeId,
|
HTMLTableCellElementTypeId, HTMLTableElementTypeId,
|
||||||
HTMLTableCaptionElementTypeId, HTMLTableRowElementTypeId, HTMLTextAreaElementTypeId,
|
HTMLTableCaptionElementTypeId, HTMLTableColElementTypeId,
|
||||||
|
HTMLTableRowElementTypeId, HTMLTextAreaElementTypeId,
|
||||||
HTMLTimeElementTypeId, HTMLTitleElementTypeId, HTMLUListElementTypeId,
|
HTMLTimeElementTypeId, HTMLTitleElementTypeId, HTMLUListElementTypeId,
|
||||||
UnknownElementTypeId};
|
UnknownElementTypeId};
|
||||||
use dom::element::{HTMLDivElement, HTMLFontElement, HTMLFormElement,
|
use dom::element::{HTMLDivElement, HTMLFontElement, HTMLFormElement,
|
||||||
|
@ -49,6 +50,7 @@ use dom::htmlstyleelement::HTMLStyleElement;
|
||||||
use dom::htmltableelement::HTMLTableElement;
|
use dom::htmltableelement::HTMLTableElement;
|
||||||
use dom::htmltablecaptionelement::HTMLTableCaptionElement;
|
use dom::htmltablecaptionelement::HTMLTableCaptionElement;
|
||||||
use dom::htmltablecellelement::HTMLTableCellElement;
|
use dom::htmltablecellelement::HTMLTableCellElement;
|
||||||
|
use dom::htmltablecolelement::HTMLTableColElement;
|
||||||
use dom::htmltablerowelement::HTMLTableRowElement;
|
use dom::htmltablerowelement::HTMLTableRowElement;
|
||||||
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||||
use dom::htmltextareaelement::HTMLTextAreaElement;
|
use dom::htmltextareaelement::HTMLTextAreaElement;
|
||||||
|
@ -264,9 +266,11 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
|
||||||
handle_element!(cx, tag, "source", HTMLSourceElementTypeId, HTMLSourceElement, []);
|
handle_element!(cx, tag, "source", HTMLSourceElementTypeId, HTMLSourceElement, []);
|
||||||
handle_element!(cx, tag, "span", HTMLSpanElementTypeId, HTMLSpanElement, []);
|
handle_element!(cx, tag, "span", HTMLSpanElementTypeId, HTMLSpanElement, []);
|
||||||
handle_element!(cx, tag, "style", HTMLStyleElementTypeId, HTMLStyleElement, []);
|
handle_element!(cx, tag, "style", HTMLStyleElementTypeId, HTMLStyleElement, []);
|
||||||
|
handle_element!(cx, tag, "table", HTMLTableElementTypeId, HTMLTableElement, []);
|
||||||
handle_element!(cx, tag, "caption", HTMLTableCaptionElementTypeId, HTMLTableCaptionElement, []);
|
handle_element!(cx, tag, "caption", HTMLTableCaptionElementTypeId, HTMLTableCaptionElement, []);
|
||||||
handle_element!(cx, tag, "td", HTMLTableCellElementTypeId, HTMLTableCellElement, []);
|
handle_element!(cx, tag, "td", HTMLTableCellElementTypeId, HTMLTableCellElement, []);
|
||||||
handle_element!(cx, tag, "table", HTMLTableElementTypeId, HTMLTableElement, []);
|
handle_element!(cx, tag, "col", HTMLTableColElementTypeId, HTMLTableColElement, []);
|
||||||
|
handle_element!(cx, tag, "colgroup",HTMLTableColElementTypeId, HTMLTableColElement, []);
|
||||||
handle_element!(cx, tag, "tbody", HTMLTableSectionElementTypeId, HTMLTableSectionElement, []);
|
handle_element!(cx, tag, "tbody", HTMLTableSectionElementTypeId, HTMLTableSectionElement, []);
|
||||||
handle_element!(cx, tag, "textarea",HTMLTextAreaElementTypeId, HTMLTextAreaElement, []);
|
handle_element!(cx, tag, "textarea",HTMLTextAreaElementTypeId, HTMLTextAreaElement, []);
|
||||||
handle_element!(cx, tag, "time", HTMLTimeElementTypeId, HTMLTimeElement, []);
|
handle_element!(cx, tag, "time", HTMLTimeElementTypeId, HTMLTimeElement, []);
|
||||||
|
|
|
@ -70,8 +70,9 @@ pub mod dom {
|
||||||
pub mod HTMLSpanElementBinding;
|
pub mod HTMLSpanElementBinding;
|
||||||
pub mod HTMLStyleElementBinding;
|
pub mod HTMLStyleElementBinding;
|
||||||
pub mod HTMLTableElementBinding;
|
pub mod HTMLTableElementBinding;
|
||||||
pub mod HTMLTableCellElementBinding;
|
|
||||||
pub mod HTMLTableCaptionElementBinding;
|
pub mod HTMLTableCaptionElementBinding;
|
||||||
|
pub mod HTMLTableCellElementBinding;
|
||||||
|
pub mod HTMLTableColElementBinding;
|
||||||
pub mod HTMLTableRowElementBinding;
|
pub mod HTMLTableRowElementBinding;
|
||||||
pub mod HTMLTableSectionElementBinding;
|
pub mod HTMLTableSectionElementBinding;
|
||||||
pub mod HTMLTextAreaElementBinding;
|
pub mod HTMLTextAreaElementBinding;
|
||||||
|
@ -123,6 +124,7 @@ pub mod dom {
|
||||||
pub mod htmltableelement;
|
pub mod htmltableelement;
|
||||||
pub mod htmltablecaptionelement;
|
pub mod htmltablecaptionelement;
|
||||||
pub mod htmltablecellelement;
|
pub mod htmltablecellelement;
|
||||||
|
pub mod htmltablecolelement;
|
||||||
pub mod htmltablerowelement;
|
pub mod htmltablerowelement;
|
||||||
pub mod htmltablesectionelement;
|
pub mod htmltablesectionelement;
|
||||||
pub mod htmltextareaelement;
|
pub mod htmltextareaelement;
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
<ol type="1"></ol>
|
<ol type="1"></ol>
|
||||||
<table>
|
<table>
|
||||||
<caption>sample table</caption>
|
<caption>sample table</caption>
|
||||||
|
<colgroup>
|
||||||
|
<col/>
|
||||||
|
</colgroup>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td>head</td></tr>
|
<tr><td>head</td></tr>
|
||||||
<tr><td>data</td></tr>
|
<tr><td>data</td></tr>
|
||||||
|
|
|
@ -210,6 +210,16 @@ window.alert(tags.length);
|
||||||
window.alert(tags[0].tagName);
|
window.alert(tags[0].tagName);
|
||||||
window.alert(tags[0] instanceof HTMLTableCellElement);
|
window.alert(tags[0] instanceof HTMLTableCellElement);
|
||||||
|
|
||||||
|
window.alert("HTMLTableColElement");
|
||||||
|
let tagList = ["col", "colgroup"];
|
||||||
|
for (let i = 0, l = tagList.length; i < l; ++i) {
|
||||||
|
let tags = document.getElementsByTagName(tagList[i]);
|
||||||
|
window.alert(tags);
|
||||||
|
window.alert(tags.length);
|
||||||
|
window.alert(tags[0].tagName);
|
||||||
|
window.alert(tags[0] instanceof HTMLTableColElement);
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: Doesn't work until we throw proper exceptions instead of returning 0 on
|
//TODO: Doesn't work until we throw proper exceptions instead of returning 0 on
|
||||||
// unwrap failure.
|
// unwrap failure.
|
||||||
/*try {
|
/*try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue