Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic HTMLDialogElement interface
- Loading branch information
Showing
7 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* 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::codegen::Bindings::HTMLDialogElementBinding; | ||
use dom::bindings::codegen::InheritTypes::HTMLDialogElementDerived; | ||
use dom::bindings::js::{JSRef, Temporary}; | ||
use dom::document::Document; | ||
use dom::element::ElementTypeId; | ||
use dom::eventtarget::{EventTarget, EventTargetTypeId}; | ||
use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; | ||
use dom::node::{Node, NodeTypeId}; | ||
use util::str::DOMString; | ||
|
||
#[dom_struct] | ||
pub struct HTMLDialogElement { | ||
htmlelement: HTMLElement, | ||
} | ||
|
||
impl HTMLDialogElementDerived for EventTarget { | ||
fn is_htmldialogelement(&self) -> bool { | ||
*self.type_id() == EventTargetTypeId::Node(NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLDialogElement))) | ||
} | ||
} | ||
|
||
impl HTMLDialogElement { | ||
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLDialogElement { | ||
HTMLDialogElement { | ||
htmlelement: HTMLElement::new_inherited(HTMLElementTypeId::HTMLDialogElement, localName, prefix, document) | ||
} | ||
} | ||
|
||
#[allow(unrooted_must_root)] | ||
pub fn new(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> Temporary<HTMLDialogElement> { | ||
let element = HTMLDialogElement::new_inherited(localName, prefix, document); | ||
Node::reflect_node(box element, document, HTMLDialogElementBinding::Wrap) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* -*- 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/. */ | ||
|
||
// http://www.whatwg.org/html/#htmldialogelement | ||
interface HTMLDialogElement : HTMLElement { | ||
//attribute boolean open; | ||
//attribute DOMString returnValue; | ||
//void show(optional (MouseEvent or Element) anchor); | ||
//void showModal(optional (MouseEvent or Element) anchor); | ||
//void close(optional DOMString returnValue); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78de6b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from Manishearth
at https://github.com/dhodder/servo/commit/78de6b2db1a9c1dc4c49d4fa3d26d71b28a259bb
78de6b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging dhodder/servo/master = 78de6b2 into auto
78de6b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dhodder/servo/master = 78de6b2 merged ok, testing candidate = 05371a8
78de6b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://build.servo.org/builders/linux2/builds/1291