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/HTMLTableCaptionElement.webidl19
-rw-r--r--src/components/script/dom/bindings/node.rs5
-rw-r--r--src/components/script/dom/element.rs9
-rw-r--r--src/components/script/dom/htmltablecaptionelement.rs19
-rw-r--r--src/components/script/html/hubbub_html_parser.rs6
-rw-r--r--src/components/script/script.rc2
-rw-r--r--src/test/html/test_bindings.html1
-rw-r--r--src/test/html/test_bindings.js7
10 files changed, 65 insertions, 5 deletions
diff --git a/src/components/script/dom/bindings/codegen/Bindings.conf b/src/components/script/dom/bindings/codegen/Bindings.conf
index 70097b49bb5..13cc61e8f3b 100644
--- a/src/components/script/dom/bindings/codegen/Bindings.conf
+++ b/src/components/script/dom/bindings/codegen/Bindings.conf
@@ -563,6 +563,7 @@ addHTMLElement('HTMLParagraphElement')
addHTMLElement('HTMLScriptElement')
addHTMLElement('HTMLSpanElement')
addHTMLElement('HTMLStyleElement')
+addHTMLElement('HTMLTableCaptionElement')
addHTMLElement('HTMLTableElement')
addHTMLElement('HTMLTableRowElement')
addHTMLElement('HTMLTableSectionElement')
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index 5d12b15fdc7..0ab24f9c821 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -4631,6 +4631,7 @@ class CGBindingRoot(CGThing):
'dom::htmlolistelement::HTMLOListElement',
'dom::htmlscriptelement::HTMLScriptElement',
'dom::htmlstyleelement::HTMLStyleElement',
+ 'dom::htmltablecaptionelement::HTMLTableCaptionElement',
'dom::htmltableelement::HTMLTableElement',
'dom::htmltablerowelement::HTMLTableRowElement',
'dom::htmltablesectionelement::HTMLTableSectionElement',
diff --git a/src/components/script/dom/bindings/codegen/HTMLTableCaptionElement.webidl b/src/components/script/dom/bindings/codegen/HTMLTableCaptionElement.webidl
new file mode 100644
index 00000000000..256713372e3
--- /dev/null
+++ b/src/components/script/dom/bindings/codegen/HTMLTableCaptionElement.webidl
@@ -0,0 +1,19 @@
+/* -*- 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 HTMLTableCaptionElement : HTMLElement {};
+
+partial interface HTMLTableCaptionElement {
+ [SetterThrows]
+ attribute DOMString align;
+};
diff --git a/src/components/script/dom/bindings/node.rs b/src/components/script/dom/bindings/node.rs
index 580443b8135..3d1e0907ac0 100644
--- a/src/components/script/dom/bindings/node.rs
+++ b/src/components/script/dom/bindings/node.rs
@@ -14,7 +14,8 @@ use dom::element::{HTMLElementTypeId,
HTMLMetaElementTypeId, HTMLOListElementTypeId,
HTMLParagraphElementTypeId, HTMLScriptElementTypeId,
HTMLSpanElementTypeId, HTMLStyleElementTypeId, HTMLTextAreaElementTypeId,
- HTMLTableElementTypeId, HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId,
+ HTMLTableCaptionElementTypeId, HTMLTableElementTypeId,
+ HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId,
HTMLTitleElementTypeId, HTMLUListElementTypeId, HTMLDListElementTypeId};
use dom::element::{HTMLHeadElement,HTMLHtmlElement, HTMLDivElement, HTMLParagraphElement, HTMLSpanElement};
use dom::htmlelement::HTMLElement;
@@ -30,6 +31,7 @@ use dom::htmlmetaelement::HTMLMetaElement;
use dom::htmlolistelement::HTMLOListElement;
use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmlstyleelement::HTMLStyleElement;
+use dom::htmltablecaptionelement::HTMLTableCaptionElement;
use dom::htmltableelement::HTMLTableElement;
use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmltablesectionelement::HTMLTableSectionElement;
@@ -118,6 +120,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLScriptElementTypeId) => generate_element!(HTMLScriptElement),
ElementNodeTypeId(HTMLSpanElementTypeId) => generate_element!(HTMLSpanElement),
ElementNodeTypeId(HTMLStyleElementTypeId) => generate_element!(HTMLStyleElement),
+ ElementNodeTypeId(HTMLTableCaptionElementTypeId) => generate_element!(HTMLTableCaptionElement),
ElementNodeTypeId(HTMLTableElementTypeId) => generate_element!(HTMLTableElement),
ElementNodeTypeId(HTMLTableRowElementTypeId) => generate_element!(HTMLTableRowElement),
ElementNodeTypeId(HTMLTableSectionElementTypeId) => generate_element!(HTMLTableSectionElement),
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs
index f243df7dbcb..0c84fb7fddb 100644
--- a/src/components/script/dom/element.rs
+++ b/src/components/script/dom/element.rs
@@ -10,7 +10,8 @@ use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLBodyElementBinding, H
HTMLHtmlElementBinding, HTMLIFrameElementBinding,
HTMLImageElementBinding, HTMLMetaElementBinding,
HTMLOListElementBinding, HTMLParagraphElementBinding,
- HTMLScriptElementBinding, HTMLSpanElementBinding, HTMLStyleElementBinding,
+ HTMLScriptElementBinding, HTMLSpanElementBinding,
+ HTMLStyleElementBinding, HTMLTableCaptionElementBinding,
HTMLTableElementBinding, HTMLTableRowElementBinding,
HTMLTableSectionElementBinding, HTMLTextAreaElementBinding,
HTMLTitleElementBinding, HTMLUListElementBinding};
@@ -32,6 +33,7 @@ use dom::htmlmetaelement::HTMLMetaElement;
use dom::htmlolistelement::HTMLOListElement;
use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmlstyleelement::HTMLStyleElement;
+use dom::htmltablecaptionelement::HTMLTableCaptionElement;
use dom::htmltableelement::HTMLTableElement;
use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmlulistelement::HTMLUListElement;
@@ -102,10 +104,11 @@ pub enum ElementTypeId {
HTMLSmallElementTypeId,
HTMLSpanElementTypeId,
HTMLStyleElementTypeId,
- HTMLTableSectionElementTypeId,
+ HTMLTableCaptionElementTypeId,
HTMLTableCellElementTypeId,
HTMLTableElementTypeId,
HTMLTableRowElementTypeId,
+ HTMLTableSectionElementTypeId,
HTMLTextAreaElementTypeId,
HTMLTitleElementTypeId,
HTMLUListElementTypeId,
@@ -219,6 +222,8 @@ generate_binding_object!(HTMLSpanElement)
generate_cacheable_wrapper!(HTMLStyleElement, HTMLStyleElementBinding::Wrap)
generate_binding_object!(HTMLStyleElement)
generate_cacheable_wrapper!(HTMLTableElement, HTMLTableElementBinding::Wrap)
+generate_binding_object!(HTMLTableCaptionElement)
+generate_cacheable_wrapper!(HTMLTableCaptionElement, HTMLTableCaptionElementBinding::Wrap)
generate_binding_object!(HTMLTableElement)
generate_cacheable_wrapper!(HTMLTableRowElement, HTMLTableRowElementBinding::Wrap)
generate_binding_object!(HTMLTableRowElement)
diff --git a/src/components/script/dom/htmltablecaptionelement.rs b/src/components/script/dom/htmltablecaptionelement.rs
new file mode 100644
index 00000000000..3cb48190d69
--- /dev/null
+++ b/src/components/script/dom/htmltablecaptionelement.rs
@@ -0,0 +1,19 @@
+/* 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 HTMLTableCaptionElement {
+ parent: HTMLElement
+}
+
+impl HTMLTableCaptionElement {
+ pub fn Align(&self) -> DOMString {
+ null_string
+ }
+
+ pub fn SetAlign(&mut self, _align: &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 8eb6d222dbd..9b316ba7ada 100644
--- a/src/components/script/html/hubbub_html_parser.rs
+++ b/src/components/script/html/hubbub_html_parser.rs
@@ -15,7 +15,7 @@ use dom::element::{HTMLElementTypeId,
HTMLSelectElementTypeId, HTMLSmallElementTypeId,
HTMLSpanElementTypeId, HTMLStyleElementTypeId, HTMLTableSectionElementTypeId,
HTMLTableCellElementTypeId, HTMLTableElementTypeId,
- HTMLTableRowElementTypeId, HTMLTextAreaElementTypeId,
+ HTMLTableCaptionElementTypeId, HTMLTableRowElementTypeId, HTMLTextAreaElementTypeId,
HTMLTitleElementTypeId, HTMLUListElementTypeId,
UnknownElementTypeId};
use dom::element::{HTMLDivElement, HTMLFontElement, HTMLFormElement,
@@ -38,6 +38,7 @@ use dom::htmlmetaelement::HTMLMetaElement;
use dom::htmlolistelement::HTMLOListElement;
use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmlstyleelement::HTMLStyleElement;
+use dom::htmltablecaptionelement::HTMLTableCaptionElement;
use dom::htmltableelement::HTMLTableElement;
use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmltablesectionelement::HTMLTableSectionElement;
@@ -247,9 +248,10 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
handle_element!(cx, tag, "small", HTMLSmallElementTypeId, HTMLSmallElement, []);
handle_element!(cx, tag, "span", HTMLSpanElementTypeId, HTMLSpanElement, []);
handle_element!(cx, tag, "style", HTMLStyleElementTypeId, HTMLStyleElement, []);
- handle_element!(cx, tag, "tbody", HTMLTableSectionElementTypeId, HTMLTableSectionElement, []);
+ handle_element!(cx, tag, "caption", HTMLTableCaptionElementTypeId, HTMLTableCaptionElement, []);
handle_element!(cx, tag, "td", HTMLTableCellElementTypeId, HTMLTableCellElement, []);
handle_element!(cx, tag, "table", HTMLTableElementTypeId, HTMLTableElement, []);
+ handle_element!(cx, tag, "tbody", HTMLTableSectionElementTypeId, HTMLTableSectionElement, []);
handle_element!(cx, tag, "textarea",HTMLTextAreaElementTypeId, HTMLTextAreaElement, []);
handle_element!(cx, tag, "tr", HTMLTableRowElementTypeId, HTMLTableRowElement, []);
handle_element!(cx, tag, "title", HTMLTitleElementTypeId, HTMLTitleElement, []);
diff --git a/src/components/script/script.rc b/src/components/script/script.rc
index 888c07ce824..dfcbab356bf 100644
--- a/src/components/script/script.rc
+++ b/src/components/script/script.rc
@@ -62,6 +62,7 @@ pub mod dom {
pub mod HTMLScriptElementBinding;
pub mod HTMLSpanElementBinding;
pub mod HTMLStyleElementBinding;
+ pub mod HTMLTableCaptionElementBinding;
pub mod HTMLTableElementBinding;
pub mod HTMLTableRowElementBinding;
pub mod HTMLTableSectionElementBinding;
@@ -103,6 +104,7 @@ pub mod dom {
pub mod htmlolistelement;
pub mod htmlscriptelement;
pub mod htmlstyleelement;
+ pub mod htmltablecaptionelement;
pub mod htmltableelement;
pub mod htmltablerowelement;
pub mod htmltablesectionelement;
diff --git a/src/test/html/test_bindings.html b/src/test/html/test_bindings.html
index e9c116c92cd..1c3f62e764d 100644
--- a/src/test/html/test_bindings.html
+++ b/src/test/html/test_bindings.html
@@ -22,6 +22,7 @@
<iframe></iframe>
<ol type="1"></ol>
<table>
+ <caption>sample table</caption>
<tbody>
<tr></tr>
</tbody>
diff --git a/src/test/html/test_bindings.js b/src/test/html/test_bindings.js
index d33b6c6ba83..2ce275e1086 100644
--- a/src/test/html/test_bindings.js
+++ b/src/test/html/test_bindings.js
@@ -158,6 +158,13 @@ window.alert(tags.length);
window.alert(tags[0].tagName);
window.alert(tags[0] instanceof HTMLCanvasElement);
+window.alert("HTMLTableCaptionElement:");
+let tags = document.getElementsByTagName("caption");
+window.alert(tags);
+window.alert(tags.length);
+window.alert(tags[0].tagName);
+window.alert(tags[0] instanceof HTMLTableCaptionElement);
+
window.alert("HTMLTextAreaElement:");
let tags = document.getElementsByTagName("textarea");
window.alert(tags);