Skip to content

Commit

Permalink
Generate bindings for HTMLPreElement.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetsuharu OHZEKI committed Aug 31, 2013
1 parent 22e02b5 commit e55b3d6
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/codegen/Bindings.conf
Expand Up @@ -593,6 +593,7 @@ addHTMLElement('HTMLOptionElement')
addHTMLElement('HTMLOutputElement')
addHTMLElement('HTMLParagraphElement')
addHTMLElement('HTMLParamElement')
addHTMLElement('HTMLPreElement')
addHTMLElement('HTMLProgressElement')
addHTMLElement('HTMLQuoteElement')
addHTMLElement('HTMLScriptElement')
Expand Down
24 changes: 24 additions & 0 deletions src/components/script/dom/bindings/codegen/HTMLPreElement.webidl
@@ -0,0 +1,24 @@
/* -*- 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-pre-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.
*/

// import from http://mxr.mozilla.org/mozilla-central/source/dom/webidl/

// http://www.whatwg.org/specs/web-apps/current-work/#the-pre-element
interface HTMLPreElement : HTMLElement {
};

// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLPreElement {
[SetterThrows]
attribute long width;
};
2 changes: 2 additions & 0 deletions src/components/script/dom/bindings/element.rs
Expand Up @@ -118,6 +118,8 @@ generate_cacheable_wrapper!(HTMLParagraphElement, HTMLParagraphElementBinding::W
generate_binding_object!(HTMLParagraphElement)
generate_cacheable_wrapper!(HTMLParamElement, HTMLParamElementBinding::Wrap)
generate_binding_object!(HTMLParamElement)
generate_cacheable_wrapper!(HTMLPreElement, HTMLPreElementBinding::Wrap)
generate_binding_object!(HTMLPreElement)
generate_cacheable_wrapper!(HTMLProgressElement, HTMLProgressElementBinding::Wrap)
generate_binding_object!(HTMLProgressElement)
generate_cacheable_wrapper!(HTMLQuoteElement, HTMLQuoteElementBinding::Wrap)
Expand Down
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/node.rs
Expand Up @@ -62,6 +62,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLOutputElementTypeId) => generate_element!(HTMLOutputElement),
ElementNodeTypeId(HTMLParagraphElementTypeId) => generate_element!(HTMLParagraphElement),
ElementNodeTypeId(HTMLParamElementTypeId) => generate_element!(HTMLParamElement),
ElementNodeTypeId(HTMLPreElementTypeId) => generate_element!(HTMLPreElement),
ElementNodeTypeId(HTMLProgressElementTypeId) => generate_element!(HTMLProgressElement),
ElementNodeTypeId(HTMLQuoteElementTypeId) => generate_element!(HTMLQuoteElement),
ElementNodeTypeId(HTMLScriptElementTypeId) => generate_element!(HTMLScriptElement),
Expand Down
1 change: 1 addition & 0 deletions src/components/script/dom/element.rs
Expand Up @@ -86,6 +86,7 @@ pub enum ElementTypeId {
HTMLOutputElementTypeId,
HTMLParagraphElementTypeId,
HTMLParamElementTypeId,
HTMLPreElementTypeId,
HTMLProgressElementTypeId,
HTMLQuoteElementTypeId,
HTMLScriptElementTypeId,
Expand Down
19 changes: 19 additions & 0 deletions src/components/script/dom/htmlpreelement.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::{ErrorResult};
use dom::htmlelement::HTMLElement;

pub struct HTMLPreElement {
parent: HTMLElement,
}

impl HTMLPreElement {
pub fn Width(&self) -> i32 {
0
}

pub fn SetWidth(&mut self, _width: i32, _rv: &mut ErrorResult) {
}
}
1 change: 1 addition & 0 deletions src/components/script/html/hubbub_html_parser.rs
Expand Up @@ -221,6 +221,7 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
handle_element!(cx, tag, "output", HTMLOutputElementTypeId, HTMLOutputElement, []);
handle_element!(cx, tag, "p", HTMLParagraphElementTypeId, HTMLParagraphElement, []);
handle_element!(cx, tag, "param", HTMLParamElementTypeId, HTMLParamElement, []);
handle_element!(cx, tag, "pre", HTMLPreElementTypeId, HTMLPreElement, []);
handle_element!(cx, tag, "progress",HTMLProgressElementTypeId, HTMLProgressElement, []);
handle_element!(cx, tag, "q", HTMLQuoteElementTypeId, HTMLQuoteElement, []);
handle_element!(cx, tag, "script", HTMLScriptElementTypeId, HTMLScriptElement, []);
Expand Down
1 change: 1 addition & 0 deletions src/components/script/script.rc
Expand Up @@ -97,6 +97,7 @@ pub mod dom {
pub mod htmloutputelement;
pub mod htmlparagraphelement;
pub mod htmlparamelement;
pub mod htmlpreelement;
pub mod htmlprogresselement;
pub mod htmlquoteelement;
pub mod htmlscriptelement;
Expand Down

0 comments on commit e55b3d6

Please sign in to comment.