mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Generate bindings for HTMLPreElement.
This commit is contained in:
parent
22e02b573d
commit
e55b3d6b86
8 changed files with 50 additions and 0 deletions
|
@ -593,6 +593,7 @@ addHTMLElement('HTMLOptionElement')
|
|||
addHTMLElement('HTMLOutputElement')
|
||||
addHTMLElement('HTMLParagraphElement')
|
||||
addHTMLElement('HTMLParamElement')
|
||||
addHTMLElement('HTMLPreElement')
|
||||
addHTMLElement('HTMLProgressElement')
|
||||
addHTMLElement('HTMLQuoteElement')
|
||||
addHTMLElement('HTMLScriptElement')
|
||||
|
|
|
@ -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;
|
||||
};
|
|
@ -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)
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -86,6 +86,7 @@ pub enum ElementTypeId {
|
|||
HTMLOutputElementTypeId,
|
||||
HTMLParagraphElementTypeId,
|
||||
HTMLParamElementTypeId,
|
||||
HTMLPreElementTypeId,
|
||||
HTMLProgressElementTypeId,
|
||||
HTMLQuoteElementTypeId,
|
||||
HTMLScriptElementTypeId,
|
||||
|
|
19
src/components/script/dom/htmlpreelement.rs
Normal file
19
src/components/script/dom/htmlpreelement.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::{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) {
|
||||
}
|
||||
}
|
|
@ -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, []);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue