Auto merge of #6044 - Ms2ger:cleanup, r=jdm

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6044)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-05-14 07:16:42 -05:00
commit 7bda431e61
14 changed files with 80 additions and 54 deletions

View file

@ -9,7 +9,8 @@ use dom::bindings::codegen::Bindings::HTMLFormElementBinding::HTMLFormElementMet
use dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementMethods;
use dom::bindings::codegen::Bindings::HTMLButtonElementBinding::HTMLButtonElementMethods;
use dom::bindings::codegen::InheritTypes::{EventTargetCast, HTMLFormElementDerived, NodeCast};
use dom::bindings::codegen::InheritTypes::{HTMLInputElementCast, HTMLTextAreaElementCast, HTMLFormElementCast};
use dom::bindings::codegen::InheritTypes::{HTMLInputElementCast, HTMLTextAreaElementCast};
use dom::bindings::codegen::InheritTypes::{HTMLFormElementCast, HTMLDataListElementCast};
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JSRef, OptionalRootable, Rootable, Temporary};
use dom::document::{Document, DocumentHelpers};
@ -260,7 +261,7 @@ impl<'a> HTMLFormElementHelpers for JSRef<'a, HTMLFormElement> {
return None;
}
if child.r().ancestors()
.any(|a| a.root().r().type_id() == NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLDataListElement))) {
.any(|a| HTMLDataListElementCast::to_temporary(a).is_some()) {
return None;
}
// XXXManishearth don't include it if it is a button but not the submitter

View file

@ -26,7 +26,9 @@ impl HTMLMediaElementDerived for EventTarget {
}
impl HTMLMediaElement {
pub fn new_inherited(type_id: HTMLMediaElementTypeId, tag_name: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLMediaElement {
pub fn new_inherited(type_id: HTMLMediaElementTypeId, tag_name: DOMString,
prefix: Option<DOMString>, document: JSRef<Document>)
-> HTMLMediaElement {
HTMLMediaElement {
htmlelement: HTMLElement::new_inherited(HTMLElementTypeId::HTMLMediaElement(type_id), tag_name, prefix, document)
}

View file

@ -2234,13 +2234,18 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
match node.type_id() {
// Step 3.
NodeTypeId::DocumentType if !is_equal_doctype(this, node) => return false,
NodeTypeId::Element(..) if !is_equal_element(this, node) => return false,
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) if !is_equal_processinginstruction(this, node) => return false,
NodeTypeId::DocumentType
if !is_equal_doctype(this, node) => return false,
NodeTypeId::Element(..)
if !is_equal_element(this, node) => return false,
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction)
if !is_equal_processinginstruction(this, node) => return false,
NodeTypeId::CharacterData(CharacterDataTypeId::Text) |
NodeTypeId::CharacterData(CharacterDataTypeId::Comment) if !is_equal_characterdata(this, node) => return false,
NodeTypeId::CharacterData(CharacterDataTypeId::Comment)
if !is_equal_characterdata(this, node) => return false,
// Step 4.
NodeTypeId::Element(..) if !is_equal_element_attrs(this, node) => return false,
NodeTypeId::Element(..)
if !is_equal_element_attrs(this, node) => return false,
_ => ()
}

View file

@ -156,7 +156,8 @@ impl<'a> WebSocketMethods for JSRef<'a, WebSocket> {
fn Send(self, data: Option<DOMString>)-> Fallible<()>{
/*TODO: This is not up to spec see http://html.spec.whatwg.org/multipage/comms.html search for "If argument is a string"
TODO: Need to buffer data
TODO: bufferedAmount attribute returns the size of the buffer in bytes - this is a required attribute defined in the websocket.webidle file
TODO: bufferedAmount attribute returns the size of the buffer in bytes -
this is a required attribute defined in the websocket.webidl file
TODO: The send function needs to flag when full by using the following
self.full.set(true). This needs to be done when the buffer is full
*/