Implemention of HTMLMainElement

This commit is contained in:
Marcos Caceres 2013-10-18 22:03:58 +01:00
parent 284ad5ee8e
commit faf53fd05c
9 changed files with 40 additions and 0 deletions

View file

@ -611,6 +611,7 @@ addHTMLElement('HTMLLegendElement')
addHTMLElement('HTMLLIElement')
addHTMLElement('HTMLLinkElement')
addHTMLElement('HTMLMapElement')
addHTMLElement('HTMLMainElement')
addHTMLElement('HTMLMediaElement')
addHTMLElement('HTMLMetaElement')
addHTMLElement('HTMLMeterElement')

View file

@ -0,0 +1,14 @@
/* -*- 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 HTMLMainElement : HTMLElement {};

View file

@ -209,6 +209,9 @@ generate_traceable_htmlelement!(HTMLLIElement)
generate_cacheable_wrapper_htmlelement!(HTMLLinkElement, HTMLLinkElementBinding::Wrap)
generate_traceable_htmlelement!(HTMLLinkElement)
generate_cacheable_wrapper_htmlelement!(HTMLMainElement, HTMLMainElementBinding::Wrap)
generate_traceable_htmlelement!(HTMLMainElement)
generate_cacheable_wrapper_htmlelement!(HTMLMapElement, HTMLMapElementBinding::Wrap)
generate_traceable_htmlelement!(HTMLMapElement)

View file

@ -55,6 +55,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLLegendElementTypeId) => generate_element!(HTMLLegendElement),
ElementNodeTypeId(HTMLLIElementTypeId) => generate_element!(HTMLLIElement),
ElementNodeTypeId(HTMLLinkElementTypeId) => generate_element!(HTMLLinkElement),
ElementNodeTypeId(HTMLMainElementTypeId) => generate_element!(HTMLMainElement),
ElementNodeTypeId(HTMLMapElementTypeId) => generate_element!(HTMLMapElement),
ElementNodeTypeId(HTMLMediaElementTypeId) => generate_element!(HTMLMediaElement),
ElementNodeTypeId(HTMLMetaElementTypeId) => generate_element!(HTMLMetaElement),

View file

@ -82,6 +82,7 @@ pub enum ElementTypeId {
HTMLLegendElementTypeId,
HTMLLinkElementTypeId,
HTMLLIElementTypeId,
HTMLMainElementTypeId,
HTMLMapElementTypeId,
HTMLMediaElementTypeId,
HTMLMetaElementTypeId,

View file

@ -0,0 +1,9 @@
/* 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::htmlelement::HTMLElement;
pub struct HTMLMainElement {
htmlelement: HTMLElement
}

View file

@ -249,6 +249,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_element!(cx, document, tag, "link", HTMLLinkElementTypeId, HTMLLinkElement, []);
handle_element!(cx, document, tag, "li", HTMLLIElementTypeId, HTMLLIElement, []);
handle_element!(cx, document, tag, "map", HTMLMapElementTypeId, HTMLMapElement, []);
handle_element!(cx, document, tag, "main", HTMLMainElementTypeId, HTMLMainElement, []);
handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []);
handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []);
handle_element!(cx, document, tag, "mod", HTMLModElementTypeId, HTMLModElement, []);

View file

@ -90,6 +90,7 @@ pub mod dom {
pub mod htmllegendelement;
pub mod htmllielement;
pub mod htmllinkelement;
pub mod htmlmainelement;
pub mod htmlmapelement;
pub mod htmlmediaelement;
pub mod htmlmetaelement;

View file

@ -0,0 +1,9 @@
<html>
<head>
<script src="harness.js"></script>
<main>
<script>
var main = document.getElementsByTagName("main")[0];
is_a(main, HTMLMainElement);
finish();
</script>