@@ -19,22 +19,22 @@ use html::{Component, Scope};

/// `Listener` trait is an universal implementation of an event listener
/// which helps to bind Rust-listener to JS-listener (DOM).
pub trait Listener<CTX, COMP: Component<CTX>> {
pub trait Listener<COMP: Component> {
/// Returns standard name of DOM's event.
fn kind(&self) -> &'static str;
/// Attaches listener to the element and uses scope instance to send
/// prepaired event back to the yew main loop.
fn attach(&mut self, element: &Element, scope: Scope<CTX, COMP>) -> EventListenerHandle;
fn attach(&mut self, element: &Element, scope: Scope<COMP>) -> EventListenerHandle;
}

impl<CTX, COMP: Component<CTX>> fmt::Debug for Listener<CTX, COMP> {
impl<COMP: Component> fmt::Debug for Listener<COMP> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Listener {{ kind: {} }}", self.kind())
}
}

/// A list of event listeners.
type Listeners<CTX, COMP> = Vec<Box<Listener<CTX, COMP>>>;
type Listeners<COMP> = Vec<Box<Listener<COMP>>>;

/// A map of attributes.
type Attributes = HashMap<String, String>;
@@ -72,10 +72,8 @@ enum Reform {

/// This trait provides features to update a tree by other tree comparsion.
pub trait VDiff {
/// The context where this instance live.
type Context;
/// The component which this instance put into.
type Component: Component<Self::Context>;
type Component: Component;

/// Remove itself from parent and return the next sibling.
fn detach(&mut self, parent: &Node) -> Option<Node>;
@@ -105,7 +103,7 @@ pub trait VDiff {
&mut self,
parent: &Node,
precursor: Option<&Node>,
ancestor: Option<VNode<Self::Context, Self::Component>>,
scope: &Scope<Self::Context, Self::Component>,
ancestor: Option<VNode<Self::Component>>,
scope: &Scope<Self::Component>,
) -> Option<Node>;
}
@@ -15,28 +15,28 @@ use Hidden;
type AnyProps = (TypeId, *mut Hidden);

/// The method generates an instance of a (child) component.
type Generator<CTX> = FnMut(Scheduler<CTX>, Element, Option<Node>, AnyProps);
type Generator = FnMut(Scheduler<()>, Element, Option<Node>, AnyProps);

/// A reference to unknown activator which will be attached later with a generator function.
type LazyActivator<CTX, COMP> = Rc<RefCell<Option<Scope<CTX, COMP>>>>;
type LazyActivator<COMP> = Rc<RefCell<Option<Scope<COMP>>>>;

/// A virtual component.
pub struct VComp<CTX, COMP: Component<CTX>> {
pub struct VComp<COMP: Component> {
type_id: TypeId,
cell: NodeCell,
props: Option<(TypeId, *mut Hidden)>,
blind_sender: Box<FnMut(AnyProps)>,
generator: Box<Generator<CTX>>,
activators: Vec<LazyActivator<CTX, COMP>>,
generator: Box<Generator>,
activators: Vec<LazyActivator<COMP>>,
destroyer: Box<Fn()>,
_parent: PhantomData<COMP>,
}

impl<CTX: 'static, COMP: Component<CTX>> VComp<CTX, COMP> {
impl<COMP: Component> VComp<COMP> {
/// This method prepares a generator to make a new instance of the `Component`.
pub fn lazy<CHILD>() -> (CHILD::Properties, Self)
where
CHILD: Component<CTX> + Renderable<CTX, CHILD>,
CHILD: Component + Renderable<CHILD>,
{
let cell: NodeCell = Rc::new(RefCell::new(None));
let lazy_activator = Rc::new(RefCell::new(None));
@@ -53,7 +53,7 @@ impl<CTX: 'static, COMP: Component<CTX>> VComp<CTX, COMP> {
*Box::from_raw(raw)
};
let opposite = obsolete.map(VNode::VRef);
let scope: Scope<CTX, CHILD> = Scope::new(scheduler);
let scope: Scope<CHILD> = Scope::new(scheduler);
let env = scope.clone();
*lazy_activator.borrow_mut() = Some(env);
scope.mount_in_place(
@@ -120,7 +120,7 @@ impl<CTX: 'static, COMP: Component<CTX>> VComp<CTX, COMP> {

/// This method attach sender to a listeners, because created properties
/// know nothing about a parent.
fn activate_props(&mut self, sender: &Scope<CTX, COMP>) -> AnyProps {
fn activate_props(&mut self, sender: &Scope<COMP>) -> AnyProps {
for activator in &self.activators {
*activator.borrow_mut() = Some(sender.clone());
}
@@ -142,43 +142,42 @@ impl<CTX: 'static, COMP: Component<CTX>> VComp<CTX, COMP> {
/// Converts property and attach lazy components to it.
/// This type holds context and components types to store an activatior which
/// will be used later buring rendering state to attach component sender.
pub trait Transformer<CTX, COMP: Component<CTX>, FROM, TO> {
pub trait Transformer<COMP: Component, FROM, TO> {
/// Transforms one type to another.
fn transform(&mut self, from: FROM) -> TO;
}

impl<CTX, COMP, T> Transformer<CTX, COMP, T, T> for VComp<CTX, COMP>
impl<COMP, T> Transformer<COMP, T, T> for VComp<COMP>
where
COMP: Component<CTX>,
COMP: Component,
{
fn transform(&mut self, from: T) -> T {
from
}
}

impl<'a, CTX, COMP, T> Transformer<CTX, COMP, &'a T, T> for VComp<CTX, COMP>
impl<'a, COMP, T> Transformer<COMP, &'a T, T> for VComp<COMP>
where
COMP: Component<CTX>,
COMP: Component,
T: Clone,
{
fn transform(&mut self, from: &'a T) -> T {
from.clone()
}
}

impl<'a, CTX, COMP> Transformer<CTX, COMP, &'a str, String> for VComp<CTX, COMP>
impl<'a, COMP> Transformer<COMP, &'a str, String> for VComp<COMP>
where
COMP: Component<CTX>,
COMP: Component,
{
fn transform(&mut self, from: &'a str) -> String {
from.to_owned()
}
}

impl<'a, CTX, COMP, F, IN> Transformer<CTX, COMP, F, Option<Callback<IN>>> for VComp<CTX, COMP>
impl<'a, COMP, F, IN> Transformer<COMP, F, Option<Callback<IN>>> for VComp<COMP>
where
CTX: 'static,
COMP: Component<CTX> + Renderable<CTX, COMP>,
COMP: Component + Renderable<COMP>,
F: Fn(IN) -> COMP::Message + 'static,
{
fn transform(&mut self, from: F) -> Option<Callback<IN>> {
@@ -196,15 +195,14 @@ where
}
}

impl<CTX, COMP> VComp<CTX, COMP>
impl<COMP> VComp<COMP>
where
CTX: 'static,
COMP: Component<CTX> + 'static,
COMP: Component + 'static,
{
/// This methods mount a virtual component with a generator created with `lazy` call.
fn mount<T: INode>(
&mut self,
scheduler: Scheduler<CTX>,
scheduler: Scheduler<()>,
parent: &T,
opposite: Option<Node>,
props: AnyProps,
@@ -223,12 +221,10 @@ where
}
}

impl<CTX, COMP> VDiff for VComp<CTX, COMP>
impl<COMP> VDiff for VComp<COMP>
where
CTX: 'static,
COMP: Component<CTX> + 'static,
COMP: Component + 'static,
{
type Context = CTX;
type Component = COMP;

/// Remove VComp from parent.
@@ -252,8 +248,8 @@ where
&mut self,
parent: &Node,
_: Option<&Node>,
opposite: Option<VNode<Self::Context, Self::Component>>,
env: &Scope<Self::Context, Self::Component>,
opposite: Option<VNode<Self::Component>>,
env: &Scope<Self::Component>,
) -> Option<Node> {
let reform = {
match opposite {
@@ -299,8 +295,8 @@ where
}
}

impl<CTX, COMP: Component<CTX>> PartialEq for VComp<CTX, COMP> {
fn eq(&self, other: &VComp<CTX, COMP>) -> bool {
impl<COMP: Component> PartialEq for VComp<COMP> {
fn eq(&self, other: &VComp<COMP>) -> bool {
self.type_id == other.type_id
}
}
@@ -4,25 +4,24 @@ use html::{Component, Scope};
use stdweb::web::Node;

/// This struct represents a fragment of the Virtual DOM tree.
pub struct VList<CTX, COMP: Component<CTX>> {
pub struct VList<COMP: Component> {
/// The list of children nodes. Which also could have own children.
pub childs: Vec<VNode<CTX, COMP>>,
pub childs: Vec<VNode<COMP>>,
}

impl<CTX, COMP: Component<CTX>> VList<CTX, COMP> {
impl<COMP: Component> VList<COMP> {
/// Creates a new `VTag` instance with `tag` name (cannot be changed later in DOM).
pub fn new() -> Self {
VList { childs: Vec::new() }
}

/// Add `VNode` child.
pub fn add_child(&mut self, child: VNode<CTX, COMP>) {
pub fn add_child(&mut self, child: VNode<COMP>) {
self.childs.push(child);
}
}

impl<CTX: 'static, COMP: Component<CTX>> VDiff for VList<CTX, COMP> {
type Context = CTX;
impl<COMP: Component> VDiff for VList<COMP> {
type Component = COMP;

fn detach(&mut self, parent: &Node) -> Option<Node> {
@@ -37,8 +36,8 @@ impl<CTX: 'static, COMP: Component<CTX>> VDiff for VList<CTX, COMP> {
&mut self,
parent: &Node,
precursor: Option<&Node>,
opposite: Option<VNode<Self::Context, Self::Component>>,
env: &Scope<Self::Context, Self::Component>,
opposite: Option<VNode<Self::Component>>,
env: &Scope<Self::Component>,
) -> Option<Node> {
let mut rights = {
match opposite {
@@ -7,21 +7,20 @@ use std::fmt;
use stdweb::web::{INode, Node};

/// Bind virtual element to a DOM reference.
pub enum VNode<CTX, COMP: Component<CTX>> {
pub enum VNode<COMP: Component> {
/// A bind between `VTag` and `Element`.
VTag(VTag<CTX, COMP>),
VTag(VTag<COMP>),
/// A bind between `VText` and `TextNode`.
VText(VText<CTX, COMP>),
VText(VText<COMP>),
/// A bind between `VComp` and `Element`.
VComp(VComp<CTX, COMP>),
VComp(VComp<COMP>),
/// A holder for a list of other nodes.
VList(VList<CTX, COMP>),
VList(VList<COMP>),
/// A holder for any `Node` (necessary for replacing node).
VRef(Node),
}

impl<CTX: 'static, COMP: Component<CTX>> VDiff for VNode<CTX, COMP> {
type Context = CTX;
impl<COMP: Component> VDiff for VNode<COMP> {
type Component = COMP;

/// Remove VNode from parent.
@@ -45,8 +44,8 @@ impl<CTX: 'static, COMP: Component<CTX>> VDiff for VNode<CTX, COMP> {
&mut self,
parent: &Node,
precursor: Option<&Node>,
ancestor: Option<VNode<Self::Context, Self::Component>>,
env: &Scope<Self::Context, Self::Component>,
ancestor: Option<VNode<Self::Component>>,
env: &Scope<Self::Component>,
) -> Option<Node> {
match *self {
VNode::VTag(ref mut vtag) => vtag.apply(parent, precursor, ancestor, env),
@@ -72,43 +71,43 @@ impl<CTX: 'static, COMP: Component<CTX>> VDiff for VNode<CTX, COMP> {
}
}

impl<CTX, COMP: Component<CTX>> From<VText<CTX, COMP>> for VNode<CTX, COMP> {
fn from(vtext: VText<CTX, COMP>) -> Self {
impl<COMP: Component> From<VText<COMP>> for VNode<COMP> {
fn from(vtext: VText<COMP>) -> Self {
VNode::VText(vtext)
}
}

impl<CTX, COMP: Component<CTX>> From<VList<CTX, COMP>> for VNode<CTX, COMP> {
fn from(vlist: VList<CTX, COMP>) -> Self {
impl<COMP: Component> From<VList<COMP>> for VNode<COMP> {
fn from(vlist: VList<COMP>) -> Self {
VNode::VList(vlist)
}
}

impl<CTX, COMP: Component<CTX>> From<VTag<CTX, COMP>> for VNode<CTX, COMP> {
fn from(vtag: VTag<CTX, COMP>) -> Self {
impl<COMP: Component> From<VTag<COMP>> for VNode<COMP> {
fn from(vtag: VTag<COMP>) -> Self {
VNode::VTag(vtag)
}
}

impl<CTX, COMP: Component<CTX>> From<VComp<CTX, COMP>> for VNode<CTX, COMP> {
fn from(vcomp: VComp<CTX, COMP>) -> Self {
impl<COMP: Component> From<VComp<COMP>> for VNode<COMP> {
fn from(vcomp: VComp<COMP>) -> Self {
VNode::VComp(vcomp)
}
}

impl<CTX: 'static, COMP: Component<CTX>, T: ToString> From<T> for VNode<CTX, COMP> {
impl<COMP: Component, T: ToString> From<T> for VNode<COMP> {
fn from(value: T) -> Self {
VNode::VText(VText::new(value.to_string()))
}
}

impl<'a, CTX, COMP: Component<CTX>> From<&'a Renderable<CTX, COMP>> for VNode<CTX, COMP> {
fn from(value: &'a Renderable<CTX, COMP>) -> Self {
impl<'a, COMP: Component> From<&'a Renderable<COMP>> for VNode<COMP> {
fn from(value: &'a Renderable<COMP>) -> Self {
value.view()
}
}

impl<CTX, COMP: Component<CTX>> fmt::Debug for VNode<CTX, COMP> {
impl<COMP: Component> fmt::Debug for VNode<COMP> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
VNode::VTag(ref vtag) => vtag.fmt(f),
@@ -120,8 +119,8 @@ impl<CTX, COMP: Component<CTX>> fmt::Debug for VNode<CTX, COMP> {
}
}

impl<CTX, COMP: Component<CTX>> PartialEq for VNode<CTX, COMP> {
fn eq(&self, other: &VNode<CTX, COMP>) -> bool {
impl<COMP: Component> PartialEq for VNode<COMP> {
fn eq(&self, other: &VNode<COMP>) -> bool {
match *self {
VNode::VTag(ref vtag_a) => match *other {
VNode::VTag(ref vtag_b) => vtag_a == vtag_b,
@@ -14,17 +14,17 @@ use super::{Attributes, Classes, Listener, Listeners, Patch, Reform, VDiff, VNod
/// A type for a virtual
/// [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element)
/// representation.
pub struct VTag<CTX, COMP: Component<CTX>> {
pub struct VTag<COMP: Component> {
/// A tag of the element.
tag: Cow<'static, str>,
/// A reference to the `Element`.
pub reference: Option<Element>,
/// List of attached listeners.
pub listeners: Listeners<CTX, COMP>,
pub listeners: Listeners<COMP>,
/// List of attributes.
pub attributes: Attributes,
/// The list of children nodes. Which also could have own children.
pub childs: Vec<VNode<CTX, COMP>>,
pub childs: Vec<VNode<COMP>>,
/// List of attached classes.
pub classes: Classes,
/// Contains a value of an
@@ -45,7 +45,7 @@ pub struct VTag<CTX, COMP: Component<CTX>> {
captured: Vec<EventListenerHandle>,
}

impl<CTX, COMP: Component<CTX>> VTag<CTX, COMP> {
impl<COMP: Component> VTag<COMP> {
/// Creates a new `VTag` instance with `tag` name (cannot be changed later in DOM).
pub fn new<S: Into<Cow<'static, str>>>(tag: S) -> Self {
VTag {
@@ -70,7 +70,7 @@ impl<CTX, COMP: Component<CTX>> VTag<CTX, COMP> {
}

/// Add `VNode` child.
pub fn add_child(&mut self, child: VNode<CTX, COMP>) {
pub fn add_child(&mut self, child: VNode<COMP>) {
self.childs.push(child);
}

@@ -114,7 +114,7 @@ impl<CTX, COMP: Component<CTX>> VTag<CTX, COMP> {
/// Adds new listener to the node.
/// It's boxed because we want to keep it in a single list.
/// Lates `Listener::attach` called to attach actual listener to a DOM node.
pub fn add_listener(&mut self, listener: Box<Listener<CTX, COMP>>) {
pub fn add_listener(&mut self, listener: Box<Listener<COMP>>) {
self.listeners.push(listener);
}

@@ -314,8 +314,7 @@ impl<CTX, COMP: Component<CTX>> VTag<CTX, COMP> {
}
}

impl<CTX: 'static, COMP: Component<CTX>> VDiff for VTag<CTX, COMP> {
type Context = CTX;
impl<COMP: Component> VDiff for VTag<COMP> {
type Component = COMP;

/// Remove VTag from parent.
@@ -335,8 +334,8 @@ impl<CTX: 'static, COMP: Component<CTX>> VDiff for VTag<CTX, COMP> {
&mut self,
parent: &Node,
precursor: Option<&Node>,
ancestor: Option<VNode<Self::Context, Self::Component>>,
env: &Scope<Self::Context, Self::Component>,
ancestor: Option<VNode<Self::Component>>,
env: &Scope<Self::Component>,
) -> Option<Node> {
assert!(self.reference.is_none(), "reference is ignored so must not be set");
let (reform, mut ancestor) = {
@@ -449,7 +448,7 @@ impl<CTX: 'static, COMP: Component<CTX>> VDiff for VTag<CTX, COMP> {
}
}

impl<CTX, COMP: Component<CTX>> fmt::Debug for VTag<CTX, COMP> {
impl<COMP: Component> fmt::Debug for VTag<COMP> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "VTag {{ tag: {} }}", self.tag)
}
@@ -471,8 +470,8 @@ fn set_checked(input: &InputElement, value: bool) {
js!( @(no_return) @{input}.checked = @{value}; );
}

impl<CTX, COMP: Component<CTX>> PartialEq for VTag<CTX, COMP> {
fn eq(&self, other: &VTag<CTX, COMP>) -> bool {
impl<COMP: Component> PartialEq for VTag<COMP> {
fn eq(&self, other: &VTag<COMP>) -> bool {
if self.tag != other.tag {
return false;
}
@@ -10,29 +10,26 @@ use super::{Reform, VDiff, VNode};
/// A type for a virtual
/// [`TextNode`](https://developer.mozilla.org/en-US/docs/Web/API/Document/createTextNode)
/// represenation.
pub struct VText<CTX, COMP: Component<CTX>> {
pub struct VText<COMP: Component> {
/// Contains a text of the node.
pub text: String,
/// A reference to the `TextNode`.
pub reference: Option<TextNode>,
_ctx: PhantomData<CTX>,
_comp: PhantomData<COMP>,
}

impl<CTX: 'static, COMP: Component<CTX>> VText<CTX, COMP> {
impl<COMP: Component> VText<COMP> {
/// Creates new virtual text node with a content.
pub fn new(text: String) -> Self {
VText {
text,
reference: None,
_ctx: PhantomData,
_comp: PhantomData,
}
}
}

impl<CTX: 'static, COMP: Component<CTX>> VDiff for VText<CTX, COMP> {
type Context = CTX;
impl<COMP: Component> VDiff for VText<COMP> {
type Component = COMP;

/// Remove VTag from parent.
@@ -54,8 +51,8 @@ impl<CTX: 'static, COMP: Component<CTX>> VDiff for VText<CTX, COMP> {
&mut self,
parent: &Node,
_: Option<&Node>,
opposite: Option<VNode<Self::Context, Self::Component>>,
_: &Scope<Self::Context, Self::Component>,
opposite: Option<VNode<Self::Component>>,
_: &Scope<Self::Component>,
) -> Option<Node> {
assert!(self.reference.is_none(), "reference is ignored so must not be set");
let reform = {
@@ -95,14 +92,14 @@ impl<CTX: 'static, COMP: Component<CTX>> VDiff for VText<CTX, COMP> {
}
}

impl<CTX, COMP: Component<CTX>> fmt::Debug for VText<CTX, COMP> {
impl<COMP: Component> fmt::Debug for VText<COMP> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "VText {{ text: {} }}", self.text)
}
}

impl<CTX, COMP: Component<CTX>> PartialEq for VText<CTX, COMP> {
fn eq(&self, other: &VText<CTX, COMP>) -> bool {
impl<COMP: Component> PartialEq for VText<COMP> {
fn eq(&self, other: &VText<COMP>) -> bool {
self.text == other.text
}
}
@@ -4,16 +4,13 @@ extern crate yew;
use yew::html::{Component, ComponentLink, Html, Renderable, ShouldRender};
use yew::virtual_dom::VNode;

// TODO Reuse it from vtag test
type Ctx = ();

struct Comp;

impl Component<Ctx> for Comp {
impl Component for Comp {
type Message = ();
type Properties = ();

fn create(_: Self::Properties, _: ComponentLink<Ctx, Self>) -> Self {
fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self {
Comp
}

@@ -22,19 +19,19 @@ impl Component<Ctx> for Comp {
}
}

impl Renderable<Ctx, Comp> for Comp {
fn view(&self) -> Html<Ctx, Self> {
impl Renderable<Comp> for Comp {
fn view(&self) -> Html<Self> {
unimplemented!();
}
}

#[test]
fn check_fragments() {
let fragment: VNode<Ctx, Comp> = html! {
let fragment: VNode<Comp> = html! {
<>
</>
};
let _: VNode<Ctx, Comp> = html! {
let _: VNode<Comp> = html! {
<div>
{ fragment }
</div>
@@ -4,15 +4,13 @@ extern crate yew;
use yew::html::{Component, ComponentLink, Html, Renderable, ShouldRender};
use yew::virtual_dom::VNode;

type Ctx = ();

struct Comp;

impl Component<Ctx> for Comp {
impl Component for Comp {
type Message = ();
type Properties = ();

fn create(_: Self::Properties, _: ComponentLink<Ctx, Self>) -> Self {
fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self {
Comp
}

@@ -21,23 +19,23 @@ impl Component<Ctx> for Comp {
}
}

impl Renderable<Ctx, Comp> for Comp {
fn view(&self) -> Html<Ctx, Self> {
impl Renderable<Comp> for Comp {
fn view(&self) -> Html<Self> {
unimplemented!();
}
}

#[test]
fn it_compares_tags() {
let a: VNode<Ctx, Comp> = html! {
let a: VNode<Comp> = html! {
<div></div>
};

let b: VNode<Ctx, Comp> = html! {
let b: VNode<Comp> = html! {
<div></div>
};

let c: VNode<Ctx, Comp> = html! {
let c: VNode<Comp> = html! {
<p></p>
};

@@ -47,15 +45,15 @@ fn it_compares_tags() {

#[test]
fn it_compares_text() {
let a: VNode<Ctx, Comp> = html! {
let a: VNode<Comp> = html! {
<div>{ "correct" }</div>
};

let b: VNode<Ctx, Comp> = html! {
let b: VNode<Comp> = html! {
<div>{ "correct" }</div>
};

let c: VNode<Ctx, Comp> = html! {
let c: VNode<Comp> = html! {
<div>{ "incorrect" }</div>
};

@@ -65,15 +63,15 @@ fn it_compares_text() {

#[test]
fn it_compares_attributes() {
let a: VNode<Ctx, Comp> = html! {
let a: VNode<Comp> = html! {
<div a="test",></div>
};

let b: VNode<Ctx, Comp> = html! {
let b: VNode<Comp> = html! {
<div a="test",></div>
};

let c: VNode<Ctx, Comp> = html! {
let c: VNode<Comp> = html! {
<div a="fail",></div>
};

@@ -83,19 +81,19 @@ fn it_compares_attributes() {

#[test]
fn it_compares_children() {
let a: VNode<Ctx, Comp> = html! {
let a: VNode<Comp> = html! {
<div>
<p></p>
</div>
};

let b: VNode<Ctx, Comp> = html! {
let b: VNode<Comp> = html! {
<div>
<p></p>
</div>
};

let c: VNode<Ctx, Comp> = html! {
let c: VNode<Comp> = html! {
<div>
<span></span>
</div>
@@ -107,15 +105,15 @@ fn it_compares_children() {

#[test]
fn it_compares_classes() {
let a: VNode<Ctx, Comp> = html! {
let a: VNode<Comp> = html! {
<div class="test",></div>
};

let b: VNode<Ctx, Comp> = html! {
let b: VNode<Comp> = html! {
<div class="test",></div>
};

let c: VNode<Ctx, Comp> = html! {
let c: VNode<Comp> = html! {
<div class="fail",></div>
};

@@ -125,15 +123,15 @@ fn it_compares_classes() {

#[test]
fn it_compares_values() {
let a: VNode<Ctx, Comp> = html! {
let a: VNode<Comp> = html! {
<input value="test",/>
};

let b: VNode<Ctx, Comp> = html! {
let b: VNode<Comp> = html! {
<input value="test",/>
};

let c: VNode<Ctx, Comp> = html! {
let c: VNode<Comp> = html! {
<input value="fail",/>
};

@@ -143,15 +141,15 @@ fn it_compares_values() {

#[test]
fn it_compares_kinds() {
let a: VNode<Ctx, Comp> = html! {
let a: VNode<Comp> = html! {
<input type="text",/>
};

let b: VNode<Ctx, Comp> = html! {
let b: VNode<Comp> = html! {
<input type="text",/>
};

let c: VNode<Ctx, Comp> = html! {
let c: VNode<Comp> = html! {
<input type="hidden",/>
};

@@ -161,15 +159,15 @@ fn it_compares_kinds() {

#[test]
fn it_compares_checked() {
let a: VNode<Ctx, Comp> = html! {
let a: VNode<Comp> = html! {
<input type="checkbox", checked=false,/>
};

let b: VNode<Ctx, Comp> = html! {
let b: VNode<Comp> = html! {
<input type="checkbox", checked=false,/>
};

let c: VNode<Ctx, Comp> = html! {
let c: VNode<Comp> = html! {
<input type="checkbox", checked=true,/>
};

@@ -179,7 +177,7 @@ fn it_compares_checked() {

#[test]
fn it_allows_aria_attributes() {
let a: VNode<Ctx, Comp> = html! {
let a: VNode<Comp> = html! {
<p aria-controls="it-works",>
<a class="btn btn-primary",
data-toggle="collapse",