mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Generate bindings for HTMLTableRowElement.
This commit is contained in:
parent
ebb4f3b3d1
commit
d0e0a16ee6
10 changed files with 120 additions and 6 deletions
|
@ -562,6 +562,7 @@ addHTMLElement('HTMLScriptElement')
|
|||
addHTMLElement('HTMLSpanElement')
|
||||
addHTMLElement('HTMLStyleElement')
|
||||
addHTMLElement('HTMLTableElement')
|
||||
addHTMLElement('HTMLTableRowElement')
|
||||
addHTMLElement('HTMLTableSectionElement')
|
||||
|
||||
# If you add one of these, you need to make sure nsDOMQS.h has the relevant
|
||||
|
|
|
@ -4630,6 +4630,7 @@ class CGBindingRoot(CGThing):
|
|||
'dom::htmlscriptelement::HTMLScriptElement',
|
||||
'dom::htmlstyleelement::HTMLStyleElement',
|
||||
'dom::htmltableelement::HTMLTableElement',
|
||||
'dom::htmltablerowelement::HTMLTableRowElement',
|
||||
'dom::htmltablesectionelement::HTMLTableSectionElement',
|
||||
'dom::bindings::utils::*',
|
||||
'dom::bindings::conversions::*',
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
/* -*- 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 HTMLTableRowElement : HTMLElement {
|
||||
readonly attribute long rowIndex;
|
||||
readonly attribute long sectionRowIndex;
|
||||
/*
|
||||
readonly attribute HTMLCollection cells;
|
||||
[Throws]
|
||||
HTMLElement insertCell(optional long index = -1);
|
||||
*/
|
||||
[Throws]
|
||||
void deleteCell(long index);
|
||||
};
|
||||
|
||||
partial interface HTMLTableRowElement {
|
||||
[SetterThrows]
|
||||
attribute DOMString align;
|
||||
[SetterThrows]
|
||||
attribute DOMString ch;
|
||||
[SetterThrows]
|
||||
attribute DOMString chOff;
|
||||
[SetterThrows]
|
||||
attribute DOMString vAlign;
|
||||
|
||||
[TreatNullAs=EmptyString, SetterThrows] attribute DOMString bgColor;
|
||||
};
|
|
@ -13,7 +13,7 @@ use dom::element::{HTMLBodyElementTypeId, HTMLHRElementTypeId, HTMLIframeElement
|
|||
use dom::element::{HTMLBRElementTypeId};
|
||||
use dom::element::{HTMLParagraphElementTypeId, HTMLScriptElementTypeId, HTMLMetaElementTypeId};
|
||||
use dom::element::{HTMLOListElementTypeId, HTMLStyleElementTypeId, HTMLTableElementTypeId};
|
||||
use dom::element::{HTMLTableSectionElementTypeId};
|
||||
use dom::element::{HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId};
|
||||
use dom::element::{HTMLHeadElement, HTMLHtmlElement, HTMLDivElement, HTMLSpanElement};
|
||||
use dom::element::{HTMLParagraphElement};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
@ -28,6 +28,7 @@ use dom::htmlolistelement::HTMLOListElement;
|
|||
use dom::htmlscriptelement::HTMLScriptElement;
|
||||
use dom::htmlstyleelement::HTMLStyleElement;
|
||||
use dom::htmltableelement::HTMLTableElement;
|
||||
use dom::htmltablerowelement::HTMLTableRowElement;
|
||||
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||
use dom::node::{AbstractNode, Node, ElementNodeTypeId, TextNodeTypeId, CommentNodeTypeId};
|
||||
use dom::node::{DoctypeNodeTypeId, ScriptView, Text};
|
||||
|
@ -111,6 +112,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
|||
ElementNodeTypeId(HTMLSpanElementTypeId) => generate_element!(HTMLSpanElement),
|
||||
ElementNodeTypeId(HTMLStyleElementTypeId) => generate_element!(HTMLStyleElement),
|
||||
ElementNodeTypeId(HTMLTableElementTypeId) => generate_element!(HTMLTableElement),
|
||||
ElementNodeTypeId(HTMLTableRowElementTypeId) => generate_element!(HTMLTableRowElement),
|
||||
ElementNodeTypeId(HTMLTableSectionElementTypeId) => generate_element!(HTMLTableSectionElement),
|
||||
ElementNodeTypeId(_) => element::create(cx, node).ptr,
|
||||
CommentNodeTypeId |
|
||||
|
|
|
@ -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, ..47]);
|
||||
let protoArray = @mut ([0 as *JSObject, ..48]);
|
||||
assert!(protoArray.len() == PrototypeList::id::_ID_Count as uint);
|
||||
unsafe {
|
||||
//XXXjdm we should be storing the box pointer instead of the inner
|
||||
|
|
|
@ -11,7 +11,7 @@ use dom::bindings::codegen::{HTMLHRElementBinding, HTMLIFrameElementBinding};
|
|||
use dom::bindings::codegen::{HTMLParagraphElementBinding, HTMLScriptElementBinding};
|
||||
use dom::bindings::codegen::{HTMLImageElementBinding, HTMLOListElementBinding};
|
||||
use dom::bindings::codegen::{HTMLMetaElementBinding, HTMLStyleElementBinding};
|
||||
use dom::bindings::codegen::{HTMLTableElementBinding};
|
||||
use dom::bindings::codegen::{HTMLTableElementBinding, HTMLTableRowElementBinding};
|
||||
use dom::bindings::codegen::{HTMLTableSectionElementBinding};
|
||||
use dom::bindings::utils::{null_string, str};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, WrapperCache};
|
||||
|
@ -30,6 +30,7 @@ use dom::htmlolistelement::HTMLOListElement;
|
|||
use dom::htmlscriptelement::HTMLScriptElement;
|
||||
use dom::htmlstyleelement::HTMLStyleElement;
|
||||
use dom::htmltableelement::HTMLTableElement;
|
||||
use dom::htmltablerowelement::HTMLTableRowElement;
|
||||
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||
use dom::node::{ElementNodeTypeId, Node, ScriptView, AbstractNode};
|
||||
use layout_interface::{ContentBoxQuery, ContentBoxResponse, ContentBoxesQuery};
|
||||
|
@ -119,7 +120,6 @@ pub struct HTMLSelectElement { parent: HTMLElement }
|
|||
pub struct HTMLSmallElement { parent: HTMLElement }
|
||||
pub struct HTMLSpanElement { parent: HTMLElement }
|
||||
pub struct HTMLTableCellElement { parent: HTMLElement }
|
||||
pub struct HTMLTableRowElement { parent: HTMLElement }
|
||||
pub struct HTMLTitleElement { parent: HTMLElement }
|
||||
pub struct HTMLUListElement { parent: HTMLElement }
|
||||
pub struct UnknownElement { parent: HTMLElement }
|
||||
|
@ -208,6 +208,8 @@ generate_cacheable_wrapper!(HTMLStyleElement, HTMLStyleElementBinding::Wrap)
|
|||
generate_binding_object!(HTMLStyleElement)
|
||||
generate_cacheable_wrapper!(HTMLTableElement, HTMLTableElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLTableElement)
|
||||
generate_cacheable_wrapper!(HTMLTableRowElement, HTMLTableRowElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLTableRowElement)
|
||||
generate_cacheable_wrapper!(HTMLTableSectionElement, HTMLTableSectionElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLTableSectionElement)
|
||||
|
||||
|
|
66
src/components/script/dom/htmltablerowelement.rs
Normal file
66
src/components/script/dom/htmltablerowelement.rs
Normal file
|
@ -0,0 +1,66 @@
|
|||
/* 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 HTMLTableRowElement {
|
||||
parent: HTMLElement,
|
||||
}
|
||||
|
||||
impl HTMLTableRowElement {
|
||||
pub fn RowIndex(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn GetRowIndex(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SectionRowIndex(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn GetSectionRowIndex(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn DeleteCell(&mut self, _index: i32, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Ch(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetCh(&self, _ch: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn ChOff(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetChOff(&self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn VAlign(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetVAlign(&self, _v_align: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@ use dom::element::{HTMLDivElement, HTMLFontElement, HTMLFormElement,
|
|||
HTMLOptionElement, HTMLParagraphElement, HTMLListItemElement,
|
||||
HTMLSelectElement, HTMLSmallElement,
|
||||
HTMLSpanElement,
|
||||
HTMLTableCellElement, HTMLTableRowElement,
|
||||
HTMLTableCellElement,
|
||||
HTMLTitleElement, HTMLUListElement};
|
||||
use dom::element::{HTMLHeadingElementTypeId, Heading1, Heading2, Heading3, Heading4, Heading5,
|
||||
Heading6};
|
||||
|
@ -37,6 +37,7 @@ use dom::htmlolistelement::HTMLOListElement;
|
|||
use dom::htmlscriptelement::HTMLScriptElement;
|
||||
use dom::htmlstyleelement::HTMLStyleElement;
|
||||
use dom::htmltableelement::HTMLTableElement;
|
||||
use dom::htmltablerowelement::HTMLTableRowElement;
|
||||
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||
use dom::element::{Element, Attr};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
|
|
@ -61,6 +61,7 @@ pub mod dom {
|
|||
pub mod HTMLSpanElementBinding;
|
||||
pub mod HTMLStyleElementBinding;
|
||||
pub mod HTMLTableElementBinding;
|
||||
pub mod HTMLTableRowElementBinding;
|
||||
pub mod HTMLTableSectionElementBinding;
|
||||
pub mod MouseEventBinding;
|
||||
pub mod NodeBinding;
|
||||
|
@ -96,6 +97,7 @@ pub mod dom {
|
|||
pub mod htmlscriptelement;
|
||||
pub mod htmlstyleelement;
|
||||
pub mod htmltableelement;
|
||||
pub mod htmltablerowelement;
|
||||
pub mod htmltablesectionelement;
|
||||
pub mod mouseevent;
|
||||
pub mod node;
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
<iframe></iframe>
|
||||
<ol type="1"></ol>
|
||||
<table>
|
||||
<tbody></tbody>
|
||||
<tbody>
|
||||
<tr></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<section>section</section>
|
||||
<aside>aside</aside>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue