[][src]Struct stdweb::web::Document

pub struct Document(_);

The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.

(JavaScript docs)

Methods

impl Document[src]

pub fn create_document_fragment(&self) -> DocumentFragment[src]

In an HTML document, the Document.createDocumentFragment() method creates a new empty DocumentFragment.

(JavaScript docs)

pub fn create_element(
    &self,
    tag: &str
) -> Result<Element, InvalidCharacterError>
[src]

In an HTML document, the Document.createElement() method creates the HTML element specified by tag, or an HTMLUnknownElement if tag isn't recognized. In other documents, it creates an element with a null namespace URI.

(JavaScript docs)

pub fn create_element_ns(
    &self,
    namespace_uri: &str,
    tag: &str
) -> Result<Element, CreateElementNsError>
[src]

Creates an element with the specified namespace URI and qualified name. To create an element without specifying a namespace URI, use the createElement method.

(JavaScript docs)

pub fn create_text_node(&self, text: &str) -> TextNode[src]

Creates a new text node.

(JavaScript docs)

pub fn location(&self) -> Option<Location>[src]

Returns a Location object which contains information about the URL of the document and provides methods for changing that URL and loading another URL.

(JavaScript docs)

pub fn body(&self) -> Option<HtmlElement>[src]

Returns the <body> or <frameset> node of the current document, or null if no such element exists.

(JavaScript docs)

pub fn head(&self) -> Option<HtmlElement>[src]

Returns the <head> element of the current document. If there are more than one <head> elements, the first one is returned.

(JavaScript docs)

pub fn title(&self) -> String[src]

Gets the title of the document.

(JavaScript docs)

pub fn set_title(&self, title: &str)[src]

Sets the title of the document.

(JavaScript docs)

pub fn document_element(&self) -> Option<Element>[src]

Returns the Element that is the root element of the document (for example, the <html> element for HTML documents).

(JavaScript docs)

pub fn pointer_lock_element(&self) -> Option<Element>[src]

Returns the Element that the pointer is locked to, if it is locked to any

(JavaScript docs)

pub fn exit_pointer_lock(&self)[src]

Exit the pointer lock on the current element

(JavaScript docs)

pub fn import_node<N: INode>(
    &self,
    n: &N,
    kind: CloneKind
) -> Result<Node, NotSupportedError>
[src]

Import node from another document

(JavaScript docs)

pub fn fullscreen_enabled(&self) -> bool[src]

Check if the fullscreen API is enabled

(JavaScript docs)

pub fn fullscreen_element(&self) -> Option<Element>[src]

Get the current fullscreen element, or None if there is nothing fullscreen

(JavaScript docs)

Trait Implementations

impl JsSerialize for Document[src]

impl TryFrom<EventTarget> for Document[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Node> for Document[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Document> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

impl TryFrom<Reference> for Document[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for Document[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for Document[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for Document[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for Document[src]

impl ReferenceType for Document[src]

impl IEventTarget for Document[src]

impl INode for Document[src]

impl IParentNode for Document[src]

impl INonElementParentNode for Document[src]

impl AsRef<Reference> for Document[src]

impl From<Document> for EventTarget[src]

impl From<Document> for Node[src]

impl From<Document> for Reference[src]

impl Clone for Document[src]

impl Eq for Document[src]

impl PartialEq<Document> for Document[src]

impl Debug for Document[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]