mirror of
https://github.com/servo/servo.git
synced 2025-06-23 08:34:42 +01:00
Generate bindings for HTMLBRElement
This commit is contained in:
parent
1da9f34082
commit
bc49686c3b
9 changed files with 60 additions and 10 deletions
|
@ -547,6 +547,7 @@ def addHTMLElement(element):
|
|||
|
||||
addHTMLElement('HTMLAnchorElement')
|
||||
addHTMLElement('HTMLBodyElement')
|
||||
addHTMLElement('HTMLBRElement')
|
||||
addHTMLElement('HTMLDivElement')
|
||||
addHTMLElement('HTMLElement')
|
||||
addHTMLElement('HTMLHeadElement')
|
||||
|
|
|
@ -4619,6 +4619,7 @@ class CGBindingRoot(CGThing):
|
|||
'dom::element::{HTMLDivElement, HTMLSpanElement, HTMLParagraphElement}', #XXXjdm
|
||||
'dom::htmlanchorelement::HTMLAnchorElement', #XXXjdm
|
||||
'dom::htmlbodyelement::HTMLBodyElement',
|
||||
'dom::htmlbrelement::HTMLBRElement', #XXXrecrack
|
||||
'dom::htmlelement::HTMLElement', #XXXjdm
|
||||
'dom::htmldocument::HTMLDocument', #XXXjdm
|
||||
'dom::htmlhrelement::HTMLHRElement',
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
/* -*- 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-br-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-br-element
|
||||
interface HTMLBRElement : HTMLElement {};
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
partial interface HTMLBRElement {
|
||||
[SetterThrows]
|
||||
attribute DOMString clear;
|
||||
};
|
|
@ -10,6 +10,7 @@ use dom::element::{HTMLElementTypeId};
|
|||
use dom::element::{HTMLHeadElementTypeId, HTMLHtmlElementTypeId, HTMLAnchorElementTypeId};
|
||||
use dom::element::{HTMLDivElementTypeId, HTMLImageElementTypeId, HTMLSpanElementTypeId};
|
||||
use dom::element::{HTMLBodyElementTypeId, HTMLHRElementTypeId, HTMLIframeElementTypeId};
|
||||
use dom::element::{HTMLBRElementTypeId};
|
||||
use dom::element::{HTMLParagraphElementTypeId, HTMLScriptElementTypeId, HTMLMetaElementTypeId};
|
||||
use dom::element::{HTMLOListElementTypeId, HTMLStyleElementTypeId, HTMLTableElementTypeId};
|
||||
use dom::element::{HTMLTableSectionElementTypeId};
|
||||
|
@ -19,6 +20,7 @@ use dom::htmlelement::HTMLElement;
|
|||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlhrelement::HTMLHRElement;
|
||||
use dom::htmlbrelement::HTMLBRElement;
|
||||
use dom::htmliframeelement::HTMLIFrameElement;
|
||||
use dom::htmlimageelement::HTMLImageElement;
|
||||
use dom::htmlmetaelement::HTMLMetaElement;
|
||||
|
@ -95,6 +97,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
|||
ElementNodeTypeId(HTMLElementTypeId) => generate_element!(HTMLElement),
|
||||
ElementNodeTypeId(HTMLAnchorElementTypeId) => generate_element!(HTMLAnchorElement),
|
||||
ElementNodeTypeId(HTMLBodyElementTypeId) => generate_element!(HTMLBodyElement),
|
||||
ElementNodeTypeId(HTMLBRElementTypeId) => generate_element!(HTMLBRElement),
|
||||
ElementNodeTypeId(HTMLDivElementTypeId) => generate_element!(HTMLDivElement),
|
||||
ElementNodeTypeId(HTMLHeadElementTypeId) => generate_element!(HTMLHeadElement),
|
||||
ElementNodeTypeId(HTMLHRElementTypeId) => generate_element!(HTMLHRElement),
|
||||
|
|
|
@ -617,7 +617,7 @@ pub extern fn ThrowingConstructor(_cx: *JSContext, _argc: uint, _vp: *JSVal) ->
|
|||
}
|
||||
|
||||
pub fn initialize_global(global: *JSObject) {
|
||||
let protoArray = @mut ([0 as *JSObject, ..46]);
|
||||
let protoArray = @mut ([0 as *JSObject, ..47]);
|
||||
assert!(protoArray.len() == PrototypeList::id::_ID_Count as uint);
|
||||
unsafe {
|
||||
//XXXjdm we should be storing the box pointer instead of the inner
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
//! Element nodes.
|
||||
|
||||
use dom::bindings::codegen::{HTMLHeadElementBinding, HTMLHtmlElementBinding};
|
||||
use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLBodyElementBinding};
|
||||
use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLBRElementBinding};
|
||||
use dom::bindings::codegen::{HTMLBodyElementBinding, HTMLDivElementBinding, HTMLSpanElementBinding};
|
||||
use dom::bindings::codegen::{HTMLHRElementBinding, HTMLIFrameElementBinding};
|
||||
use dom::bindings::codegen::{HTMLParagraphElementBinding, HTMLScriptElementBinding};
|
||||
use dom::bindings::codegen::{HTMLDivElementBinding, HTMLSpanElementBinding};
|
||||
use dom::bindings::codegen::{HTMLImageElementBinding, HTMLOListElementBinding};
|
||||
use dom::bindings::codegen::{HTMLMetaElementBinding, HTMLStyleElementBinding};
|
||||
use dom::bindings::codegen::{HTMLTableElementBinding};
|
||||
|
@ -19,6 +19,7 @@ use dom::clientrect::ClientRect;
|
|||
use dom::clientrectlist::ClientRectList;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlbrelement::HTMLBRElement;
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::htmlhrelement::HTMLHRElement;
|
||||
|
@ -104,7 +105,6 @@ pub enum ElementTypeId {
|
|||
// Regular old elements
|
||||
//
|
||||
|
||||
pub struct HTMLBRElement { parent: HTMLElement }
|
||||
pub struct HTMLDivElement { parent: HTMLElement }
|
||||
pub struct HTMLFontElement { parent: HTMLElement }
|
||||
pub struct HTMLFormElement { parent: HTMLElement }
|
||||
|
@ -178,14 +178,16 @@ pub macro_rules! generate_binding_object(
|
|||
|
||||
generate_cacheable_wrapper!(HTMLHeadElement, HTMLHeadElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLHeadElement)
|
||||
generate_cacheable_wrapper!(HTMLHRElement, HTMLHRElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLHRElement)
|
||||
generate_cacheable_wrapper!(HTMLHtmlElement, HTMLHtmlElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLHtmlElement)
|
||||
generate_cacheable_wrapper!(HTMLAnchorElement, HTMLAnchorElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLAnchorElement)
|
||||
generate_cacheable_wrapper!(HTMLBodyElement, HTMLBodyElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLBodyElement)
|
||||
generate_cacheable_wrapper!(HTMLBRElement, HTMLBRElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLBRElement)
|
||||
generate_cacheable_wrapper!(HTMLHRElement, HTMLHRElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLHRElement)
|
||||
generate_cacheable_wrapper!(HTMLHtmlElement, HTMLHtmlElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLHtmlElement)
|
||||
generate_cacheable_wrapper!(HTMLDivElement, HTMLDivElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLDivElement)
|
||||
generate_cacheable_wrapper!(HTMLIFrameElement, HTMLIFrameElementBinding::Wrap)
|
||||
|
|
19
src/components/script/dom/htmlbrelement.rs
Normal file
19
src/components/script/dom/htmlbrelement.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 HTMLBRElement {
|
||||
parent: HTMLElement,
|
||||
}
|
||||
|
||||
impl HTMLBRElement {
|
||||
pub fn Clear(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetClear(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
}
|
|
@ -16,8 +16,7 @@ use dom::element::{HTMLElementTypeId,
|
|||
HTMLTableCellElementTypeId, HTMLTableElementTypeId,
|
||||
HTMLTableRowElementTypeId, HTMLTitleElementTypeId, HTMLUListElementTypeId,
|
||||
UnknownElementTypeId};
|
||||
use dom::element::{HTMLBRElement,
|
||||
HTMLDivElement, HTMLFontElement, HTMLFormElement,
|
||||
use dom::element::{HTMLDivElement, HTMLFontElement, HTMLFormElement,
|
||||
HTMLHeadElement, HTMLHeadingElement, HTMLHtmlElement,
|
||||
HTMLInputElement, HTMLLinkElement,
|
||||
HTMLOptionElement, HTMLParagraphElement, HTMLListItemElement,
|
||||
|
@ -27,6 +26,7 @@ use dom::element::{HTMLBRElement,
|
|||
HTMLTitleElement, HTMLUListElement};
|
||||
use dom::element::{HTMLHeadingElementTypeId, Heading1, Heading2, Heading3, Heading4, Heading5,
|
||||
Heading6};
|
||||
use dom::htmlbrelement::HTMLBRElement;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlhrelement::HTMLHRElement;
|
||||
|
|
|
@ -44,6 +44,7 @@ pub mod dom {
|
|||
pub mod FormDataBinding;
|
||||
pub mod HTMLAnchorElementBinding;
|
||||
pub mod HTMLBodyElementBinding;
|
||||
pub mod HTMLBRElementBinding;
|
||||
pub mod HTMLCollectionBinding;
|
||||
pub mod HTMLDivElementBinding;
|
||||
pub mod HTMLDocumentBinding;
|
||||
|
@ -83,6 +84,7 @@ pub mod dom {
|
|||
pub mod formdata;
|
||||
pub mod htmlanchorelement;
|
||||
pub mod htmlbodyelement;
|
||||
pub mod htmlbrelement;
|
||||
pub mod htmlcollection;
|
||||
pub mod htmldocument;
|
||||
pub mod htmlelement;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue