aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom
diff options
context:
space:
mode:
authorsaneyuki_s <saneyuki.s.snyk@gmail.com>2013-08-09 21:29:38 +0900
committerJosh Matthews <josh@joshmatthews.net>2013-08-09 12:01:03 -0400
commitd0e0a16ee601df516d00605efcff1fab71fdca27 (patch)
tree0a5c23c1aaad77876123b9be93f8378035822a20 /src/components/script/dom
parentebb4f3b3d1ed2e7904cb756394ca883a0a47f7a7 (diff)
downloadservo-d0e0a16ee601df516d00605efcff1fab71fdca27.tar.gz
servo-d0e0a16ee601df516d00605efcff1fab71fdca27.zip
Generate bindings for HTMLTableRowElement.
Diffstat (limited to 'src/components/script/dom')
-rw-r--r--src/components/script/dom/bindings/codegen/Bindings.conf1
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py1
-rw-r--r--src/components/script/dom/bindings/codegen/HTMLTableRowElement.webidl37
-rw-r--r--src/components/script/dom/bindings/node.rs4
-rw-r--r--src/components/script/dom/bindings/utils.rs2
-rw-r--r--src/components/script/dom/element.rs6
-rw-r--r--src/components/script/dom/htmltablerowelement.rs66
7 files changed, 113 insertions, 4 deletions
diff --git a/src/components/script/dom/bindings/codegen/Bindings.conf b/src/components/script/dom/bindings/codegen/Bindings.conf
index 9651e921cf0..031d78557b9 100644
--- a/src/components/script/dom/bindings/codegen/Bindings.conf
+++ b/src/components/script/dom/bindings/codegen/Bindings.conf
@@ -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
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index e1039e0550e..4666f05b91d 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -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::*',
diff --git a/src/components/script/dom/bindings/codegen/HTMLTableRowElement.webidl b/src/components/script/dom/bindings/codegen/HTMLTableRowElement.webidl
new file mode 100644
index 00000000000..47b97143130
--- /dev/null
+++ b/src/components/script/dom/bindings/codegen/HTMLTableRowElement.webidl
@@ -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;
+};
diff --git a/src/components/script/dom/bindings/node.rs b/src/components/script/dom/bindings/node.rs
index 46fc89aa24c..ee228f90e58 100644
--- a/src/components/script/dom/bindings/node.rs
+++ b/src/components/script/dom/bindings/node.rs
@@ -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 |
diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs
index 492cdd29772..5b4aec76baa 100644
--- a/src/components/script/dom/bindings/utils.rs
+++ b/src/components/script/dom/bindings/utils.rs
@@ -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
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs
index 33892dfaba9..87e437d81a3 100644
--- a/src/components/script/dom/element.rs
+++ b/src/components/script/dom/element.rs
@@ -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)
diff --git a/src/components/script/dom/htmltablerowelement.rs b/src/components/script/dom/htmltablerowelement.rs
new file mode 100644
index 00000000000..8286cd5ac4a
--- /dev/null
+++ b/src/components/script/dom/htmltablerowelement.rs
@@ -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) {
+ }
+}