stdweb/webapi/
text_node.rs

1use webcore::value::Reference;
2use webapi::event_target::{IEventTarget, EventTarget};
3use webapi::node::{INode, Node};
4use webapi::slotable::ISlotable;
5
6/// The `TextNode` represents the textual content of an [IElement](trait.IElement.html)
7///
8/// If an element has no markup within its content, it has
9/// a single child `TextNode` that contains the element's
10/// text. However, if the element contains markup, it is parsed
11/// into information items and `TextNode`s that form its children.
12///
13/// [(JavaScript docs)](https://developer.mozilla.org/en-US/docs/Web/API/Text)
14// https://dom.spec.whatwg.org/#text
15#[derive(Clone, Debug, PartialEq, Eq, ReferenceType)]
16#[reference(instance_of = "Text")]
17#[reference(subclass_of(EventTarget, Node))]
18pub struct TextNode( Reference );
19
20impl IEventTarget for TextNode {}
21impl INode for TextNode {}
22impl ISlotable for TextNode {}