aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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
-rw-r--r--src/components/script/html/hubbub_html_parser.rs3
-rw-r--r--src/components/script/script.rc2
-rw-r--r--src/test/html/test_bindings.html4
10 files changed, 120 insertions, 6 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) {
+ }
+}
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs
index 78abf956b21..8cc7089027a 100644
--- a/src/components/script/html/hubbub_html_parser.rs
+++ b/src/components/script/html/hubbub_html_parser.rs
@@ -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;
diff --git a/src/components/script/script.rc b/src/components/script/script.rc
index 728999e1b3f..a0f5f62fd04 100644
--- a/src/components/script/script.rc
+++ b/src/components/script/script.rc
@@ -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;
diff --git a/src/test/html/test_bindings.html b/src/test/html/test_bindings.html
index 95e5075695e..c2d7e90fe32 100644
--- a/src/test/html/test_bindings.html
+++ b/src/test/html/test_bindings.html
@@ -21,7 +21,9 @@
<iframe></iframe>
<ol type="1"></ol>
<table>
- <tbody></tbody>
+ <tbody>
+ <tr></tr>
+ </tbody>
</table>
<section>section</section>
<aside>aside</aside>