mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Introduce HTMLObjectElement::new.
This commit is contained in:
parent
9fbc45ae9c
commit
b20461f253
2 changed files with 17 additions and 2 deletions
|
@ -2,10 +2,12 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
use dom::bindings::codegen::HTMLObjectElementBinding;
|
||||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||||
use dom::document::AbstractDocument;
|
use dom::document::AbstractDocument;
|
||||||
|
use dom::element::HTMLObjectElementTypeId;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::{AbstractNode, ScriptView};
|
use dom::node::{AbstractNode, Node, ScriptView};
|
||||||
use dom::validitystate::ValidityState;
|
use dom::validitystate::ValidityState;
|
||||||
use dom::windowproxy::WindowProxy;
|
use dom::windowproxy::WindowProxy;
|
||||||
|
|
||||||
|
@ -13,6 +15,19 @@ pub struct HTMLObjectElement {
|
||||||
htmlelement: HTMLElement
|
htmlelement: HTMLElement
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl HTMLObjectElement {
|
||||||
|
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLObjectElement {
|
||||||
|
HTMLObjectElement {
|
||||||
|
htmlelement: HTMLElement::new(HTMLObjectElementTypeId, localName, document)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
|
||||||
|
let element = HTMLObjectElement::new_inherited(localName, document);
|
||||||
|
Node::reflect_node(@mut element, document, HTMLObjectElementBinding::Wrap)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl HTMLObjectElement {
|
impl HTMLObjectElement {
|
||||||
pub fn Data(&self) -> DOMString {
|
pub fn Data(&self) -> DOMString {
|
||||||
None
|
None
|
||||||
|
|
|
@ -241,7 +241,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
|
||||||
handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []);
|
handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []);
|
||||||
handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []);
|
handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []);
|
||||||
handle_element!(cx, document, tag, "mod", HTMLModElementTypeId, HTMLModElement, []);
|
handle_element!(cx, document, tag, "mod", HTMLModElementTypeId, HTMLModElement, []);
|
||||||
handle_element!(cx, document, tag, "object", HTMLObjectElementTypeId, HTMLObjectElement, []);
|
|
||||||
|
|
||||||
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
|
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
|
||||||
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
|
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
|
||||||
|
@ -261,6 +260,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
|
||||||
handle_newable_element!(document, tag, "h6", HTMLHeadingElement, Heading6);
|
handle_newable_element!(document, tag, "h6", HTMLHeadingElement, Heading6);
|
||||||
handle_newable_element!(document, tag, "iframe", HTMLIFrameElement);
|
handle_newable_element!(document, tag, "iframe", HTMLIFrameElement);
|
||||||
handle_newable_element!(document, tag, "img", HTMLImageElement);
|
handle_newable_element!(document, tag, "img", HTMLImageElement);
|
||||||
|
handle_newable_element!(document, tag, "object", HTMLObjectElement);
|
||||||
handle_newable_element!(document, tag, "ol", HTMLOListElement);
|
handle_newable_element!(document, tag, "ol", HTMLOListElement);
|
||||||
handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement);
|
handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement);
|
||||||
handle_newable_element!(document, tag, "option", HTMLOptionElement);
|
handle_newable_element!(document, tag, "option", HTMLOptionElement);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue