mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
auto merge of #765 : jdm/servo/linkelem, r=jdm
Rebase of #716, #717, and #718.
This commit is contained in:
commit
d6d03ac064
24 changed files with 741 additions and 21 deletions
|
@ -546,9 +546,13 @@ def addHTMLElement(element):
|
|||
}
|
||||
|
||||
addHTMLElement('HTMLAnchorElement')
|
||||
addHTMLElement('HTMLAppletElement')
|
||||
addHTMLElement('HTMLAreaElement')
|
||||
addHTMLElement('HTMLBaseElement')
|
||||
addHTMLElement('HTMLBodyElement')
|
||||
addHTMLElement('HTMLBRElement')
|
||||
addHTMLElement('HTMLCanvasElement')
|
||||
addHTMLElement('HTMLDataElement')
|
||||
addHTMLElement('HTMLDivElement')
|
||||
addHTMLElement('HTMLDListElement')
|
||||
addHTMLElement('HTMLElement')
|
||||
|
@ -557,16 +561,20 @@ addHTMLElement('HTMLHtmlElement')
|
|||
addHTMLElement('HTMLHRElement')
|
||||
addHTMLElement('HTMLIFrameElement')
|
||||
addHTMLElement('HTMLImageElement')
|
||||
addHTMLElement('HTMLLinkElement')
|
||||
addHTMLElement('HTMLMetaElement')
|
||||
addHTMLElement('HTMLOListElement')
|
||||
addHTMLElement('HTMLParagraphElement')
|
||||
addHTMLElement('HTMLScriptElement')
|
||||
addHTMLElement('HTMLSourceElement')
|
||||
addHTMLElement('HTMLSpanElement')
|
||||
addHTMLElement('HTMLStyleElement')
|
||||
addHTMLElement('HTMLTableCaptionElement')
|
||||
addHTMLElement('HTMLTableElement')
|
||||
addHTMLElement('HTMLTableRowElement')
|
||||
addHTMLElement('HTMLTableSectionElement')
|
||||
addHTMLElement('HTMLTextAreaElement')
|
||||
addHTMLElement('HTMLTimeElement')
|
||||
addHTMLElement('HTMLTitleElement')
|
||||
addHTMLElement('HTMLUListElement')
|
||||
|
||||
|
|
|
@ -4618,23 +4618,31 @@ class CGBindingRoot(CGThing):
|
|||
'dom::element::{Element, HTMLHeadElement, HTMLHtmlElement}', #XXXjdm
|
||||
'dom::element::{HTMLDivElement, HTMLSpanElement, HTMLParagraphElement}', #XXXjdm
|
||||
'dom::htmlanchorelement::HTMLAnchorElement', #XXXjdm
|
||||
'dom::htmlbodyelement::HTMLBodyElement',
|
||||
'dom::htmlappletelement::HTMLAppletElement', #XXXjune0cho
|
||||
'dom::htmlareaelement::HTMLAreaElement', #XXXjune0cho
|
||||
'dom::htmlbaseelement::HTMLBaseElement', #XXXjune0cho
|
||||
'dom::htmlbodyelement::HTMLBodyElement', #XXXjune0cho
|
||||
'dom::htmlbrelement::HTMLBRElement', #XXXrecrack
|
||||
'dom::htmlcanvaselement::HTMLCanvasElement',
|
||||
'dom::htmldataelement::HTMLDataElement', #XXXjune0cho
|
||||
'dom::htmldlistelement::HTMLDListElement',
|
||||
'dom::htmlelement::HTMLElement', #XXXjdm
|
||||
'dom::htmldocument::HTMLDocument', #XXXjdm
|
||||
'dom::htmlhrelement::HTMLHRElement',
|
||||
'dom::htmliframeelement::HTMLIFrameElement', #XXXjdm
|
||||
'dom::htmlimageelement::HTMLImageElement', #XXXjdm
|
||||
'dom::htmllinkelement::HTMLLinkElement', #XXXrecrack
|
||||
'dom::htmlmetaelement::HTMLMetaElement',
|
||||
'dom::htmlolistelement::HTMLOListElement',
|
||||
'dom::htmlscriptelement::HTMLScriptElement',
|
||||
'dom::htmlsourceelement::HTMLSourceElement',
|
||||
'dom::htmlstyleelement::HTMLStyleElement',
|
||||
'dom::htmltablecaptionelement::HTMLTableCaptionElement',
|
||||
'dom::htmltableelement::HTMLTableElement',
|
||||
'dom::htmltablerowelement::HTMLTableRowElement',
|
||||
'dom::htmltablesectionelement::HTMLTableSectionElement',
|
||||
'dom::htmltextareaelement::HTMLTextAreaElement',
|
||||
'dom::htmltimeelement::HTMLTimeElement',
|
||||
'dom::htmltitleelement::HTMLTitleElement', #XXXyusukesuzuki
|
||||
'dom::htmlulistelement::HTMLUListElement',
|
||||
'dom::bindings::utils::*',
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/* -*- 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/#the-applet-element
|
||||
*
|
||||
* © 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.
|
||||
*/
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#the-applet-element
|
||||
[NeedNewResolve]
|
||||
interface HTMLAppletElement : HTMLElement {
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString align;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString alt;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString archive;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString code;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString codeBase;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString height;
|
||||
[Pure, SetterThrows]
|
||||
attribute unsigned long hspace;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString name;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString _object;
|
||||
[Pure, SetterThrows]
|
||||
attribute unsigned long vspace;
|
||||
[Pure, SetterThrows]
|
||||
attribute DOMString width;
|
||||
};
|
||||
|
||||
//HTMLAppletElement implements MozImageLoadingContent;
|
||||
//HTMLAppletElement implements MozFrameLoaderOwner;
|
||||
//HTMLAppletElement implements MozObjectLoadingContent;
|
|
@ -0,0 +1,52 @@
|
|||
/* -*- 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/#the-area-element
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
*
|
||||
* © 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.
|
||||
*/
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#the-area-element
|
||||
interface HTMLAreaElement : HTMLElement {
|
||||
[SetterThrows]
|
||||
attribute DOMString alt;
|
||||
[SetterThrows]
|
||||
attribute DOMString coords;
|
||||
[SetterThrows]
|
||||
attribute DOMString shape;
|
||||
// No support for stringifier attributes yet
|
||||
//[SetterThrows]
|
||||
//stringifier attribute DOMString href;
|
||||
// stringifier;
|
||||
[SetterThrows]
|
||||
attribute DOMString href;
|
||||
[SetterThrows]
|
||||
attribute DOMString target;
|
||||
[SetterThrows]
|
||||
attribute DOMString download;
|
||||
[SetterThrows]
|
||||
attribute DOMString ping;
|
||||
|
||||
// not implemented.
|
||||
// [SetterThrows]
|
||||
// attribute DOMString rel;
|
||||
//readonly attribute DOMTokenList relList;
|
||||
//
|
||||
// [SetterThrows]
|
||||
// attribute DOMString hreflang;
|
||||
// [SetterThrows]
|
||||
// attribute DOMString type;
|
||||
};
|
||||
//HTMLAreaElement implements URLUtils;
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
partial interface HTMLAreaElement {
|
||||
[SetterThrows]
|
||||
attribute boolean noHref;
|
||||
};
|
|
@ -0,0 +1,20 @@
|
|||
/* -*- 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/#the-base-element
|
||||
*
|
||||
* © 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.
|
||||
*/
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#the-base-element
|
||||
interface HTMLBaseElement : HTMLElement {
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString href;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString target;
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
/* -*- 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/multipage/text-level-semantics.html#the-data-element
|
||||
*/
|
||||
|
||||
interface HTMLDataElement : HTMLElement {
|
||||
[SetterThrows]
|
||||
attribute DOMString value;
|
||||
};
|
|
@ -0,0 +1,47 @@
|
|||
/* -*- 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/#the-link-element
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
* © 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.
|
||||
*/
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#the-link-element
|
||||
interface HTMLLinkElement : HTMLElement {
|
||||
[Pure]
|
||||
attribute boolean disabled;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString href;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString crossOrigin;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString rel;
|
||||
// Not supported yet:
|
||||
// readonly attribute DOMTokenList relList;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString media;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString hreflang;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString type;
|
||||
// Not supported yet:
|
||||
// [PutForwards=value] readonly attribute DOMSettableTokenList sizes;
|
||||
};
|
||||
|
||||
// TODO
|
||||
//HTMLLinkElement implements LinkStyle;
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
partial interface HTMLLinkElement {
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString charset;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString rev;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString target;
|
||||
};
|
|
@ -0,0 +1,21 @@
|
|||
/* -*- 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/#the-source-element
|
||||
*
|
||||
* ⓒ 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 HTMLSourceElement : HTMLElement {
|
||||
[SetterThrows]
|
||||
attribute DOMString src;
|
||||
[SetterThrows]
|
||||
attribute DOMString type;
|
||||
[SetterThrows]
|
||||
attribute DOMString media;
|
||||
};
|
|
@ -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;
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
/* -*- 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/multipage/text-level-semantics.html#the-time-element
|
||||
*/
|
||||
|
||||
interface HTMLTimeElement : HTMLElement {
|
||||
[SetterThrows]
|
||||
attribute DOMString dateTime;
|
||||
};
|
|
@ -7,33 +7,46 @@ use dom::bindings::text;
|
|||
use dom::bindings::utils;
|
||||
use dom::bindings::utils::{CacheableWrapper, WrapperCache, DerivedWrapper};
|
||||
use dom::element::{HTMLElementTypeId,
|
||||
HTMLAnchorElementTypeId, HTMLBodyElementTypeId, HTMLBRElementTypeId,
|
||||
HTMLCanvasElementTypeId,
|
||||
HTMLAnchorElementTypeId, HTMLAppletElementTypeId,
|
||||
HTMLAreaElementTypeId, HTMLBaseElementTypeId,
|
||||
HTMLBodyElementTypeId, HTMLBRElementTypeId,
|
||||
HTMLCanvasElementTypeId, HTMLDataElementTypeId,
|
||||
HTMLDivElementTypeId, HTMLHeadElementTypeId, HTMLHRElementTypeId,
|
||||
HTMLHtmlElementTypeId, HTMLIframeElementTypeId, HTMLImageElementTypeId,
|
||||
HTMLLinkElementTypeId,
|
||||
HTMLMetaElementTypeId, HTMLOListElementTypeId,
|
||||
HTMLParagraphElementTypeId, HTMLScriptElementTypeId,
|
||||
HTMLSpanElementTypeId, HTMLStyleElementTypeId, HTMLTextAreaElementTypeId,
|
||||
HTMLTableElementTypeId, HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId,
|
||||
HTMLSpanElementTypeId, HTMLSourceElementTypeId,
|
||||
HTMLStyleElementTypeId, HTMLTextAreaElementTypeId,
|
||||
HTMLTableCaptionElementTypeId, HTMLTableElementTypeId,
|
||||
HTMLTableRowElementTypeId, HTMLTableSectionElementTypeId, HTMLTimeElementTypeId,
|
||||
HTMLTitleElementTypeId, HTMLUListElementTypeId, HTMLDListElementTypeId};
|
||||
use dom::element::{HTMLHeadElement,HTMLHtmlElement, HTMLDivElement, HTMLParagraphElement, HTMLSpanElement};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlappletelement::HTMLAppletElement;
|
||||
use dom::htmlareaelement::HTMLAreaElement;
|
||||
use dom::htmlbaseelement::HTMLBaseElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlhrelement::HTMLHRElement;
|
||||
use dom::htmlbrelement::HTMLBRElement;
|
||||
use dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
use dom::htmldataelement::HTMLDataElement;
|
||||
use dom::htmldlistelement::HTMLDListElement;
|
||||
use dom::htmliframeelement::HTMLIFrameElement;
|
||||
use dom::htmlimageelement::HTMLImageElement;
|
||||
use dom::htmllinkelement::HTMLLinkElement;
|
||||
use dom::htmlmetaelement::HTMLMetaElement;
|
||||
use dom::htmlolistelement::HTMLOListElement;
|
||||
use dom::htmlscriptelement::HTMLScriptElement;
|
||||
use dom::htmlsourceelement::HTMLSourceElement;
|
||||
use dom::htmlstyleelement::HTMLStyleElement;
|
||||
use dom::htmltablecaptionelement::HTMLTableCaptionElement;
|
||||
use dom::htmltableelement::HTMLTableElement;
|
||||
use dom::htmltablerowelement::HTMLTableRowElement;
|
||||
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||
use dom::htmltextareaelement::HTMLTextAreaElement;
|
||||
use dom::htmltimeelement::HTMLTimeElement;
|
||||
use dom::htmltitleelement::HTMLTitleElement;
|
||||
use dom::htmlulistelement::HTMLUListElement;
|
||||
use dom::node::{AbstractNode, Node, ElementNodeTypeId, TextNodeTypeId, CommentNodeTypeId};
|
||||
|
@ -102,9 +115,13 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
|||
match node.type_id() {
|
||||
ElementNodeTypeId(HTMLElementTypeId) => generate_element!(HTMLElement),
|
||||
ElementNodeTypeId(HTMLAnchorElementTypeId) => generate_element!(HTMLAnchorElement),
|
||||
ElementNodeTypeId(HTMLAppletElementTypeId) => generate_element!(HTMLAppletElement),
|
||||
ElementNodeTypeId(HTMLAreaElementTypeId) => generate_element!(HTMLAreaElement),
|
||||
ElementNodeTypeId(HTMLBaseElementTypeId) => generate_element!(HTMLBaseElement),
|
||||
ElementNodeTypeId(HTMLBodyElementTypeId) => generate_element!(HTMLBodyElement),
|
||||
ElementNodeTypeId(HTMLBRElementTypeId) => generate_element!(HTMLBRElement),
|
||||
ElementNodeTypeId(HTMLCanvasElementTypeId) => generate_element!(HTMLCanvasElement),
|
||||
ElementNodeTypeId(HTMLDataElementTypeId) => generate_element!(HTMLDataElement),
|
||||
ElementNodeTypeId(HTMLDListElementTypeId) => generate_element!(HTMLDListElement),
|
||||
ElementNodeTypeId(HTMLDivElementTypeId) => generate_element!(HTMLDivElement),
|
||||
ElementNodeTypeId(HTMLHeadElementTypeId) => generate_element!(HTMLHeadElement),
|
||||
|
@ -112,16 +129,20 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
|||
ElementNodeTypeId(HTMLHtmlElementTypeId) => generate_element!(HTMLHtmlElement),
|
||||
ElementNodeTypeId(HTMLIframeElementTypeId) => generate_element!(HTMLIFrameElement),
|
||||
ElementNodeTypeId(HTMLImageElementTypeId) => generate_element!(HTMLImageElement),
|
||||
ElementNodeTypeId(HTMLLinkElementTypeId) => generate_element!(HTMLLinkElement),
|
||||
ElementNodeTypeId(HTMLMetaElementTypeId) => generate_element!(HTMLMetaElement),
|
||||
ElementNodeTypeId(HTMLOListElementTypeId) => generate_element!(HTMLOListElement),
|
||||
ElementNodeTypeId(HTMLParagraphElementTypeId) => generate_element!(HTMLParagraphElement),
|
||||
ElementNodeTypeId(HTMLScriptElementTypeId) => generate_element!(HTMLScriptElement),
|
||||
ElementNodeTypeId(HTMLSourceElementTypeId) => generate_element!(HTMLSourceElement),
|
||||
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),
|
||||
ElementNodeTypeId(HTMLTextAreaElementTypeId) => generate_element!(HTMLTextAreaElement),
|
||||
ElementNodeTypeId(HTMLTimeElementTypeId) => generate_element!(HTMLTimeElement),
|
||||
ElementNodeTypeId(HTMLTitleElementTypeId) => generate_element!(HTMLTitleElement),
|
||||
ElementNodeTypeId(HTMLUListElementTypeId) => generate_element!(HTMLUListElement),
|
||||
ElementNodeTypeId(_) => element::create(cx, node).ptr,
|
||||
|
|
|
@ -4,40 +4,53 @@
|
|||
|
||||
//! Element nodes.
|
||||
|
||||
use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLBodyElementBinding, HTMLBRElementBinding,
|
||||
HTMLCanvasElementBinding, HTMLDListElementBinding, HTMLDivElementBinding,
|
||||
use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLAppletElementBinding,
|
||||
HTMLAreaElementBinding, HTMLBaseElementBinding,
|
||||
HTMLBodyElementBinding, HTMLBRElementBinding,
|
||||
HTMLCanvasElementBinding, HTMLDataElementBinding,
|
||||
HTMLDListElementBinding, HTMLDivElementBinding,
|
||||
HTMLHeadElementBinding, HTMLHRElementBinding,
|
||||
HTMLHtmlElementBinding, HTMLIFrameElementBinding,
|
||||
HTMLImageElementBinding, HTMLMetaElementBinding,
|
||||
HTMLLinkElementBinding,
|
||||
HTMLOListElementBinding, HTMLParagraphElementBinding,
|
||||
HTMLScriptElementBinding, HTMLSpanElementBinding, HTMLStyleElementBinding,
|
||||
HTMLScriptElementBinding, HTMLSourceElementBinding, HTMLSpanElementBinding,
|
||||
HTMLStyleElementBinding, HTMLTableCaptionElementBinding,
|
||||
HTMLTableElementBinding, HTMLTableRowElementBinding,
|
||||
HTMLTableSectionElementBinding, HTMLTextAreaElementBinding,
|
||||
HTMLTitleElementBinding, HTMLUListElementBinding};
|
||||
HTMLTimeElementBinding, HTMLTitleElementBinding, HTMLUListElementBinding};
|
||||
use dom::bindings::utils::{null_string, str};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, WrapperCache};
|
||||
use dom::clientrect::ClientRect;
|
||||
use dom::clientrectlist::ClientRectList;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlappletelement::HTMLAppletElement;
|
||||
use dom::htmlareaelement::HTMLAreaElement;
|
||||
use dom::htmlbaseelement::HTMLBaseElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlbrelement::HTMLBRElement;
|
||||
use dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::htmldataelement::HTMLDataElement;
|
||||
use dom::htmldlistelement::HTMLDListElement;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::htmlhrelement::HTMLHRElement;
|
||||
use dom::htmliframeelement::HTMLIFrameElement;
|
||||
use dom::htmlimageelement::HTMLImageElement;
|
||||
use dom::htmllinkelement::HTMLLinkElement;
|
||||
use dom::htmlmetaelement::HTMLMetaElement;
|
||||
use dom::htmlolistelement::HTMLOListElement;
|
||||
use dom::htmlscriptelement::HTMLScriptElement;
|
||||
use dom::htmlsourceelement::HTMLSourceElement;
|
||||
use dom::htmlstyleelement::HTMLStyleElement;
|
||||
use dom::htmltablecaptionelement::HTMLTableCaptionElement;
|
||||
use dom::htmltableelement::HTMLTableElement;
|
||||
use dom::htmltablerowelement::HTMLTableRowElement;
|
||||
use dom::htmlulistelement::HTMLUListElement;
|
||||
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||
use dom::htmltextareaelement::HTMLTextAreaElement;
|
||||
use dom::htmltimeelement::HTMLTimeElement;
|
||||
use dom::htmltitleelement::HTMLTitleElement;
|
||||
use dom::htmlulistelement::HTMLUListElement;
|
||||
use dom::node::{ElementNodeTypeId, Node, ScriptView, AbstractNode};
|
||||
use layout_interface::{ContentBoxQuery, ContentBoxResponse, ContentBoxesQuery};
|
||||
use layout_interface::{ContentBoxesResponse};
|
||||
|
@ -77,9 +90,13 @@ impl BindingObject for Element {
|
|||
pub enum ElementTypeId {
|
||||
HTMLElementTypeId,
|
||||
HTMLAnchorElementTypeId,
|
||||
HTMLAppletElementTypeId,
|
||||
HTMLAreaElementTypeId,
|
||||
HTMLBaseElementTypeId,
|
||||
HTMLBRElementTypeId,
|
||||
HTMLBodyElementTypeId,
|
||||
HTMLCanvasElementTypeId,
|
||||
HTMLDataElementTypeId,
|
||||
HTMLDListElementTypeId,
|
||||
HTMLDivElementTypeId,
|
||||
HTMLFontElementTypeId,
|
||||
|
@ -100,13 +117,16 @@ pub enum ElementTypeId {
|
|||
HTMLScriptElementTypeId,
|
||||
HTMLSelectElementTypeId,
|
||||
HTMLSmallElementTypeId,
|
||||
HTMLSourceElementTypeId,
|
||||
HTMLSpanElementTypeId,
|
||||
HTMLStyleElementTypeId,
|
||||
HTMLTableSectionElementTypeId,
|
||||
HTMLTableCaptionElementTypeId,
|
||||
HTMLTableCellElementTypeId,
|
||||
HTMLTableElementTypeId,
|
||||
HTMLTableRowElementTypeId,
|
||||
HTMLTableSectionElementTypeId,
|
||||
HTMLTextAreaElementTypeId,
|
||||
HTMLTimeElementTypeId,
|
||||
HTMLTitleElementTypeId,
|
||||
HTMLUListElementTypeId,
|
||||
UnknownElementTypeId,
|
||||
|
@ -122,7 +142,6 @@ pub struct HTMLFormElement { parent: HTMLElement }
|
|||
pub struct HTMLHeadElement { parent: HTMLElement }
|
||||
pub struct HTMLHtmlElement { parent: HTMLElement }
|
||||
pub struct HTMLInputElement { parent: HTMLElement }
|
||||
pub struct HTMLLinkElement { parent: HTMLElement }
|
||||
pub struct HTMLListItemElement { parent: HTMLElement }
|
||||
pub struct HTMLOptionElement { parent: HTMLElement }
|
||||
pub struct HTMLParagraphElement { parent: HTMLElement }
|
||||
|
@ -188,6 +207,12 @@ generate_cacheable_wrapper!(HTMLHeadElement, HTMLHeadElementBinding::Wrap)
|
|||
generate_binding_object!(HTMLHeadElement)
|
||||
generate_cacheable_wrapper!(HTMLAnchorElement, HTMLAnchorElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLAnchorElement)
|
||||
generate_cacheable_wrapper!(HTMLAppletElement, HTMLAppletElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLAppletElement)
|
||||
generate_cacheable_wrapper!(HTMLAreaElement, HTMLAreaElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLAreaElement)
|
||||
generate_cacheable_wrapper!(HTMLBaseElement, HTMLBaseElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLBaseElement)
|
||||
generate_cacheable_wrapper!(HTMLBodyElement, HTMLBodyElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLBodyElement)
|
||||
generate_cacheable_wrapper!(HTMLCanvasElement, HTMLCanvasElementBinding::Wrap)
|
||||
|
@ -200,12 +225,16 @@ generate_cacheable_wrapper!(HTMLHRElement, HTMLHRElementBinding::Wrap)
|
|||
generate_binding_object!(HTMLHRElement)
|
||||
generate_cacheable_wrapper!(HTMLHtmlElement, HTMLHtmlElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLHtmlElement)
|
||||
generate_cacheable_wrapper!(HTMLDataElement, HTMLDataElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLDataElement)
|
||||
generate_cacheable_wrapper!(HTMLDivElement, HTMLDivElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLDivElement)
|
||||
generate_cacheable_wrapper!(HTMLIFrameElement, HTMLIFrameElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLIFrameElement)
|
||||
generate_cacheable_wrapper!(HTMLImageElement, HTMLImageElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLImageElement)
|
||||
generate_cacheable_wrapper!(HTMLLinkElement, HTMLLinkElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLLinkElement)
|
||||
generate_cacheable_wrapper!(HTMLMetaElement, HTMLMetaElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLMetaElement)
|
||||
generate_cacheable_wrapper!(HTMLOListElement, HTMLOListElementBinding::Wrap)
|
||||
|
@ -214,11 +243,15 @@ generate_cacheable_wrapper!(HTMLParagraphElement, HTMLParagraphElementBinding::W
|
|||
generate_binding_object!(HTMLParagraphElement)
|
||||
generate_cacheable_wrapper!(HTMLScriptElement, HTMLScriptElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLScriptElement)
|
||||
generate_cacheable_wrapper!(HTMLSourceElement, HTMLSourceElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLSourceElement)
|
||||
generate_cacheable_wrapper!(HTMLSpanElement, HTMLSpanElementBinding::Wrap)
|
||||
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)
|
||||
|
@ -228,6 +261,8 @@ generate_cacheable_wrapper!(HTMLTextAreaElement, HTMLTextAreaElementBinding::Wra
|
|||
generate_binding_object!(HTMLTextAreaElement)
|
||||
generate_cacheable_wrapper!(HTMLTitleElement, HTMLTitleElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLTitleElement)
|
||||
generate_cacheable_wrapper!(HTMLTimeElement, HTMLTimeElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLTimeElement)
|
||||
generate_cacheable_wrapper!(HTMLUListElement, HTMLUListElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLUListElement)
|
||||
|
||||
|
|
89
src/components/script/dom/htmlappletelement.rs
Normal file
89
src/components/script/dom/htmlappletelement.rs
Normal file
|
@ -0,0 +1,89 @@
|
|||
/* 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 HTMLAppletElement {
|
||||
parent: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLAppletElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetAlt(&self, _alt: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Archive(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetArchive(&self, _archive: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Code(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetCode(&self, _code: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn CodeBase(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetCodeBase(&self, _code_base: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetHeight(&self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Hspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetHspace(&mut self, _hspace: u32, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Object(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetObject(&mut self, _object: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Vspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetVspace(&mut self, _vspace: u32, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
68
src/components/script/dom/htmlareaelement.rs
Normal file
68
src/components/script/dom/htmlareaelement.rs
Normal file
|
@ -0,0 +1,68 @@
|
|||
/* 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 HTMLAreaElement {
|
||||
parent: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLAreaElement {
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetAlt(&self, _alt: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Coords(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetCoords(&self, _coords: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Shape(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetShape(&self, _shape: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Href(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetHref(&self, _href: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Download(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetDownload(&self, _download: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Ping(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetPing(&self, _ping: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn NoHref(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetNoHref(&mut self, _no_href: bool, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
26
src/components/script/dom/htmlbaseelement.rs
Normal file
26
src/components/script/dom/htmlbaseelement.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
/* 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 HTMLBaseElement {
|
||||
parent: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLBaseElement {
|
||||
pub fn Href(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetHref(&self, _href: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
19
src/components/script/dom/htmldataelement.rs
Normal file
19
src/components/script/dom/htmldataelement.rs
Normal file
|
@ -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 HTMLDataElement {
|
||||
parent: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLDataElement {
|
||||
pub fn Value(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
82
src/components/script/dom/htmllinkelement.rs
Normal file
82
src/components/script/dom/htmllinkelement.rs
Normal file
|
@ -0,0 +1,82 @@
|
|||
/* 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 HTMLLinkElement {
|
||||
parent: HTMLElement,
|
||||
}
|
||||
|
||||
impl HTMLLinkElement {
|
||||
pub fn Disabled(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDisabled(&mut self, _disable: bool) {
|
||||
}
|
||||
|
||||
pub fn Href(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetHref(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Rel(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetRel(&mut self, _rel: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Media(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Hreflang(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetHreflang(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Charset(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Rev(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetRev(&mut self, _rev: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetTarget(&mut self, _target: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
33
src/components/script/dom/htmlsourceelement.rs
Normal file
33
src/components/script/dom/htmlsourceelement.rs
Normal file
|
@ -0,0 +1,33 @@
|
|||
/* 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 HTMLSourceElement {
|
||||
parent: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLSourceElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Media(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
19
src/components/script/dom/htmltablecaptionelement.rs
Normal file
19
src/components/script/dom/htmltablecaptionelement.rs
Normal file
|
@ -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) {
|
||||
}
|
||||
}
|
19
src/components/script/dom/htmltimeelement.rs
Normal file
19
src/components/script/dom/htmltimeelement.rs
Normal file
|
@ -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 HTMLTimeElement {
|
||||
parent: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLTimeElement {
|
||||
pub fn DateTime(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetDateTime(&mut self, _dateTime: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
|
@ -3,24 +3,25 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::element::{HTMLElementTypeId,
|
||||
HTMLAnchorElementTypeId, HTMLBRElementTypeId,
|
||||
HTMLBodyElementTypeId, HTMLCanvasElementTypeId, HTMLDivElementTypeId,
|
||||
HTMLDListElementTypeId,
|
||||
HTMLAnchorElementTypeId, HTMLAppletElementTypeId,
|
||||
HTMLAreaElementTypeId, HTMLBaseElementTypeId, HTMLBodyElementTypeId,
|
||||
HTMLBRElementTypeId, HTMLCanvasElementTypeId, HTMLDataElementTypeId,
|
||||
HTMLDivElementTypeId, HTMLDListElementTypeId,
|
||||
HTMLFontElementTypeId, HTMLFormElementTypeId, HTMLHRElementTypeId,
|
||||
HTMLHeadElementTypeId, HTMLHtmlElementTypeId,
|
||||
HTMLImageElementTypeId, HTMLIframeElementTypeId, HTMLInputElementTypeId,
|
||||
HTMLLinkElementTypeId, HTMLListItemElementTypeId,
|
||||
HTMLMetaElementTypeId, HTMLOListElementTypeId, HTMLOptionElementTypeId,
|
||||
HTMLParagraphElementTypeId, HTMLScriptElementTypeId,
|
||||
HTMLSelectElementTypeId, HTMLSmallElementTypeId,
|
||||
HTMLSelectElementTypeId, HTMLSmallElementTypeId, HTMLSourceElementTypeId,
|
||||
HTMLSpanElementTypeId, HTMLStyleElementTypeId, HTMLTableSectionElementTypeId,
|
||||
HTMLTableCellElementTypeId, HTMLTableElementTypeId,
|
||||
HTMLTableRowElementTypeId, HTMLTextAreaElementTypeId,
|
||||
HTMLTitleElementTypeId, HTMLUListElementTypeId,
|
||||
HTMLTableCaptionElementTypeId, HTMLTableRowElementTypeId, HTMLTextAreaElementTypeId,
|
||||
HTMLTimeElementTypeId, HTMLTitleElementTypeId, HTMLUListElementTypeId,
|
||||
UnknownElementTypeId};
|
||||
use dom::element::{HTMLDivElement, HTMLFontElement, HTMLFormElement,
|
||||
HTMLHeadElement, HTMLHeadingElement, HTMLHtmlElement,
|
||||
HTMLInputElement, HTMLLinkElement,
|
||||
HTMLInputElement,
|
||||
HTMLOptionElement, HTMLParagraphElement, HTMLListItemElement,
|
||||
HTMLSelectElement, HTMLSmallElement,
|
||||
HTMLSpanElement, HTMLTableCellElement};
|
||||
|
@ -28,20 +29,28 @@ use dom::element::{HTMLHeadingElementTypeId, Heading1, Heading2, Heading3, Headi
|
|||
Heading6};
|
||||
use dom::htmlbrelement::HTMLBRElement;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlappletelement::HTMLAppletElement;
|
||||
use dom::htmlareaelement::HTMLAreaElement;
|
||||
use dom::htmlbaseelement::HTMLBaseElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
use dom::htmldataelement::HTMLDataElement;
|
||||
use dom::htmldlistelement::HTMLDListElement;
|
||||
use dom::htmlhrelement::HTMLHRElement;
|
||||
use dom::htmliframeelement::{IFrameSize, HTMLIFrameElement};
|
||||
use dom::htmlimageelement::HTMLImageElement;
|
||||
use dom::htmllinkelement::HTMLLinkElement;
|
||||
use dom::htmlmetaelement::HTMLMetaElement;
|
||||
use dom::htmlolistelement::HTMLOListElement;
|
||||
use dom::htmlscriptelement::HTMLScriptElement;
|
||||
use dom::htmlsourceelement::HTMLSourceElement;
|
||||
use dom::htmlstyleelement::HTMLStyleElement;
|
||||
use dom::htmltablecaptionelement::HTMLTableCaptionElement;
|
||||
use dom::htmltableelement::HTMLTableElement;
|
||||
use dom::htmltablerowelement::HTMLTableRowElement;
|
||||
use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||
use dom::htmltextareaelement::HTMLTextAreaElement;
|
||||
use dom::htmltimeelement::HTMLTimeElement;
|
||||
use dom::htmltitleelement::HTMLTitleElement;
|
||||
use dom::htmlulistelement::HTMLUListElement;
|
||||
use dom::element::Element;
|
||||
|
@ -225,9 +234,13 @@ fn js_script_listener(to_parent: SharedChan<HtmlDiscoveryMessage>,
|
|||
fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView> {
|
||||
// TODO (Issue #85): use atoms
|
||||
handle_element!(cx, tag, "a", HTMLAnchorElementTypeId, HTMLAnchorElement, []);
|
||||
handle_element!(cx, tag, "applet", HTMLAppletElementTypeId, HTMLAppletElement, []);
|
||||
handle_element!(cx, tag, "area", HTMLAreaElementTypeId, HTMLAreaElement, []);
|
||||
handle_element!(cx, tag, "base", HTMLBaseElementTypeId, HTMLBaseElement, []);
|
||||
handle_element!(cx, tag, "br", HTMLBRElementTypeId, HTMLBRElement, []);
|
||||
handle_element!(cx, tag, "body", HTMLBodyElementTypeId, HTMLBodyElement, []);
|
||||
handle_element!(cx, tag, "canvas", HTMLCanvasElementTypeId, HTMLCanvasElement, []);
|
||||
handle_element!(cx, tag, "data", HTMLDataElementTypeId, HTMLDataElement, []);
|
||||
handle_element!(cx, tag, "div", HTMLDivElementTypeId, HTMLDivElement, []);
|
||||
handle_element!(cx, tag, "dl", HTMLDListElementTypeId, HTMLDListElement, []);
|
||||
handle_element!(cx, tag, "font", HTMLFontElementTypeId, HTMLFontElement, []);
|
||||
|
@ -245,14 +258,17 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
|
|||
handle_element!(cx, tag, "script", HTMLScriptElementTypeId, HTMLScriptElement, []);
|
||||
handle_element!(cx, tag, "select", HTMLSelectElementTypeId, HTMLSelectElement, []);
|
||||
handle_element!(cx, tag, "small", HTMLSmallElementTypeId, HTMLSmallElement, []);
|
||||
handle_element!(cx, tag, "source", HTMLSourceElementTypeId, HTMLSourceElement, []);
|
||||
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, "time", HTMLTimeElementTypeId, HTMLTimeElement, []);
|
||||
handle_element!(cx, tag, "title", HTMLTitleElementTypeId, HTMLTitleElement, []);
|
||||
handle_element!(cx, tag, "tr", HTMLTableRowElementTypeId, HTMLTableRowElement, []);
|
||||
handle_element!(cx, tag, "ul", HTMLUListElementTypeId, HTMLUListElement, []);
|
||||
|
||||
handle_element!(cx, tag, "img", HTMLImageElementTypeId, HTMLImageElement, [(image: None)]);
|
||||
|
|
|
@ -43,10 +43,14 @@ pub mod dom {
|
|||
pub mod EventTargetBinding;
|
||||
pub mod FormDataBinding;
|
||||
pub mod HTMLAnchorElementBinding;
|
||||
pub mod HTMLAppletElementBinding;
|
||||
pub mod HTMLAreaElementBinding;
|
||||
pub mod HTMLBaseElementBinding;
|
||||
pub mod HTMLBodyElementBinding;
|
||||
pub mod HTMLBRElementBinding;
|
||||
pub mod HTMLCanvasElementBinding;
|
||||
pub mod HTMLCollectionBinding;
|
||||
pub mod HTMLDataElementBinding;
|
||||
pub mod HTMLDListElementBinding;
|
||||
pub mod HTMLDivElementBinding;
|
||||
pub mod HTMLDocumentBinding;
|
||||
|
@ -56,16 +60,20 @@ pub mod dom {
|
|||
pub mod HTMLHtmlElementBinding;
|
||||
pub mod HTMLIFrameElementBinding;
|
||||
pub mod HTMLImageElementBinding;
|
||||
pub mod HTMLLinkElementBinding;
|
||||
pub mod HTMLMetaElementBinding;
|
||||
pub mod HTMLOListElementBinding;
|
||||
pub mod HTMLParagraphElementBinding;
|
||||
pub mod HTMLScriptElementBinding;
|
||||
pub mod HTMLSourceElementBinding;
|
||||
pub mod HTMLSpanElementBinding;
|
||||
pub mod HTMLStyleElementBinding;
|
||||
pub mod HTMLTableCaptionElementBinding;
|
||||
pub mod HTMLTableElementBinding;
|
||||
pub mod HTMLTableRowElementBinding;
|
||||
pub mod HTMLTableSectionElementBinding;
|
||||
pub mod HTMLTextAreaElementBinding;
|
||||
pub mod HTMLTimeElementBinding;
|
||||
pub mod HTMLTitleElementBinding;
|
||||
pub mod HTMLUListElementBinding;
|
||||
pub mod MouseEventBinding;
|
||||
|
@ -89,24 +97,32 @@ pub mod dom {
|
|||
pub mod eventtarget;
|
||||
pub mod formdata;
|
||||
pub mod htmlanchorelement;
|
||||
pub mod htmlappletelement;
|
||||
pub mod htmlareaelement;
|
||||
pub mod htmlbaseelement;
|
||||
pub mod htmlbodyelement;
|
||||
pub mod htmlbrelement;
|
||||
pub mod htmlcanvaselement;
|
||||
pub mod htmlcollection;
|
||||
pub mod htmldataelement;
|
||||
pub mod htmldlistelement;
|
||||
pub mod htmldocument;
|
||||
pub mod htmlelement;
|
||||
pub mod htmlhrelement;
|
||||
pub mod htmliframeelement;
|
||||
pub mod htmlimageelement;
|
||||
pub mod htmllinkelement;
|
||||
pub mod htmlmetaelement;
|
||||
pub mod htmlolistelement;
|
||||
pub mod htmlscriptelement;
|
||||
pub mod htmlsourceelement;
|
||||
pub mod htmlstyleelement;
|
||||
pub mod htmltablecaptionelement;
|
||||
pub mod htmltableelement;
|
||||
pub mod htmltablerowelement;
|
||||
pub mod htmltablesectionelement;
|
||||
pub mod htmltextareaelement;
|
||||
pub mod htmltimeelement;
|
||||
pub mod htmltitleelement;
|
||||
pub mod htmlulistelement;
|
||||
pub mod mouseevent;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<head>
|
||||
<title>test_binding
|
||||
page </title>
|
||||
<base href="./"></base>
|
||||
<script src="test_bindings.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -22,6 +23,7 @@
|
|||
<iframe></iframe>
|
||||
<ol type="1"></ol>
|
||||
<table>
|
||||
<caption>sample table</caption>
|
||||
<tbody>
|
||||
<tr></tr>
|
||||
</tbody>
|
||||
|
@ -31,5 +33,12 @@
|
|||
<b>b</b>
|
||||
<i>i</i>
|
||||
<textarea>textarea</textarea>
|
||||
<time datetime="2014-02-14">Valentines day</time>
|
||||
<audio>
|
||||
<source src="horse.ogg" type="audio/ogg">
|
||||
<source src="horse.mp3" type="audio/mpeg">
|
||||
</audio>
|
||||
<area></area>
|
||||
<data></data>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -133,6 +133,9 @@ window.alert(document.links[0]);
|
|||
window.alert(document.getElementsByTagName('iframe')[0]);
|
||||
|
||||
window.alert(document.getElementsByTagName("body")[0]);
|
||||
window.alert(document.getElementsByTagName("area")[0]);
|
||||
window.alert(document.getElementsByTagName("base")[0]);
|
||||
window.alert(document.getElementsByTagName("data")[0]);
|
||||
|
||||
window.alert("OList:");
|
||||
let tags = document.getElementsByTagName("ol");
|
||||
|
@ -158,6 +161,27 @@ window.alert(tags.length);
|
|||
window.alert(tags[0].tagName);
|
||||
window.alert(tags[0] instanceof HTMLCanvasElement);
|
||||
|
||||
window.alert("HTMLSourceElement:");
|
||||
let tags = document.getElementsByTagName("source");
|
||||
window.alert(tags);
|
||||
window.alert(tags.length);
|
||||
window.alert(tags[0].tagName);
|
||||
window.alert(tags[0] instanceof HTMLSourceElement);
|
||||
|
||||
window.alert("HTMLTimeElement:");
|
||||
let tags = document.getElementsByTagName("time");
|
||||
window.alert(tags);
|
||||
window.alert(tags.length);
|
||||
window.alert(tags[0].tagName);
|
||||
window.alert(tags[0] instanceof HTMLTimeElement);
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue