mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Implement JSManaged for DOM objects.
This commit is contained in:
parent
061269f963
commit
625325434b
137 changed files with 3644 additions and 2778 deletions
|
@ -3,28 +3,41 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::HTMLFrameElementBinding;
|
||||
use dom::bindings::codegen::InheritTypes::HTMLFrameElementDerived;
|
||||
use dom::bindings::js::JS;
|
||||
use dom::bindings::utils::ErrorResult;
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::document::Document;
|
||||
use dom::element::HTMLFrameElementTypeId;
|
||||
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{AbstractNode, Node};
|
||||
use dom::node::{Node, ElementNodeTypeId};
|
||||
use dom::windowproxy::WindowProxy;
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
#[deriving(Encodable)]
|
||||
pub struct HTMLFrameElement {
|
||||
htmlelement: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLFrameElementDerived for EventTarget {
|
||||
fn is_htmlframeelement(&self) -> bool {
|
||||
match self.type_id {
|
||||
NodeTargetTypeId(ElementNodeTypeId(HTMLFrameElementTypeId)) => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl HTMLFrameElement {
|
||||
pub fn new_inherited(localName: DOMString, document: AbstractDocument) -> HTMLFrameElement {
|
||||
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLFrameElement {
|
||||
HTMLFrameElement {
|
||||
htmlelement: HTMLElement::new_inherited(HTMLFrameElementTypeId, localName, document)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(localName: DOMString, document: AbstractDocument) -> AbstractNode {
|
||||
let element = HTMLFrameElement::new_inherited(localName, document);
|
||||
Node::reflect_node(@mut element, document, HTMLFrameElementBinding::Wrap)
|
||||
pub fn new(localName: DOMString, document: &JS<Document>) -> JS<HTMLFrameElement> {
|
||||
let element = HTMLFrameElement::new_inherited(localName, document.clone());
|
||||
Node::reflect_node(~element, document, HTMLFrameElementBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,11 +90,11 @@ impl HTMLFrameElement {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetContentDocument(&self) -> Option<AbstractDocument> {
|
||||
pub fn GetContentDocument(&self) -> Option<JS<Document>> {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn GetContentWindow(&self) -> Option<@mut WindowProxy> {
|
||||
pub fn GetContentWindow(&self) -> Option<JS<WindowProxy>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue