diff --git a/gosub_engine/html5_parser/node/index.html b/gosub_engine/html5_parser/node/index.html index b6a73c298..786651c19 100644 --- a/gosub_engine/html5_parser/node/index.html +++ b/gosub_engine/html5_parser/node/index.html @@ -1 +1 @@ -gosub_engine::html5_parser::node - Rust

Structs

  • Node that resembles a DOM node
  • Id used to identify a node

Enums

Constants

Statics

Traits

\ No newline at end of file +gosub_engine::html5_parser::node - Rust

Structs

  • Node that resembles a DOM node
  • Id used to identify a node

Enums

Constants

Statics

Traits

\ No newline at end of file diff --git a/gosub_engine/html5_parser/node/struct.Node.html b/gosub_engine/html5_parser/node/struct.Node.html index 09f1dca12..2d4fcfa75 100644 --- a/gosub_engine/html5_parser/node/struct.Node.html +++ b/gosub_engine/html5_parser/node/struct.Node.html @@ -21,18 +21,18 @@
source

pub fn new_comment(value: &str) -> Self

Create a new comment node

source

pub fn new_text(value: &str) -> Self

Create a new text node

source

pub fn is_special(&self) -> bool

Returns true if the given node is “special” node based on the namespace and name

-
source

pub fn contains_attribute(&self, name: String) -> Result<bool, String>

Check if an attribute exists

+
source

pub fn contains_attribute(&self, name: &str) -> Result<bool, String>

Check if an attribute exists

source

pub fn insert_attribute( &mut self, - name: String, - value: String + name: &str, + value: &str ) -> Result<(), String>

Add or update a an attribute

-
source

pub fn remove_attribute(&mut self, name: String) -> Result<(), String>

Remove an attribute. If attribute doesn’t exist, nothing happens.

-
source

pub fn get_attribute(&self, name: String) -> Result<Option<&String>, String>

Get a constant reference to the attribute value +

source

pub fn remove_attribute(&mut self, name: &str) -> Result<(), String>

Remove an attribute. If attribute doesn’t exist, nothing happens.

+
source

pub fn get_attribute(&self, name: &str) -> Result<Option<&String>, String>

Get a constant reference to the attribute value (or None if attribute doesn’t exist)

source

pub fn get_mut_attribute( &mut self, - name: String + name: &str ) -> Result<Option<&mut String>, String>

Get a mutable reference to the attribute value (or None if the attribute doesn’t exist)

source

pub fn clear_attributes(&mut self) -> Result<(), String>

Remove all attributes

diff --git a/gosub_engine/html5_parser/tokenizer/index.html b/gosub_engine/html5_parser/tokenizer/index.html index 45e2adf11..506f80c7a 100644 --- a/gosub_engine/html5_parser/tokenizer/index.html +++ b/gosub_engine/html5_parser/tokenizer/index.html @@ -1 +1 @@ -gosub_engine::html5_parser::tokenizer - Rust
\ No newline at end of file +gosub_engine::html5_parser::tokenizer - Rust
\ No newline at end of file diff --git a/gosub_engine/html5_parser/tokenizer/struct.Tokenizer.html b/gosub_engine/html5_parser/tokenizer/struct.Tokenizer.html index 2b2c84fc8..f7302a49e 100644 --- a/gosub_engine/html5_parser/tokenizer/struct.Tokenizer.html +++ b/gosub_engine/html5_parser/tokenizer/struct.Tokenizer.html @@ -1,24 +1,24 @@ Tokenizer in gosub_engine::html5_parser::tokenizer - Rust
pub struct Tokenizer<'a> {
     pub stream: &'a mut InputStream,
     pub state: State,
-    pub consumed: Vec<char>,
+    pub consumed: String,
     pub current_attr_name: String,
     pub current_attr_value: String,
     pub current_attrs: HashMap<String, String>,
     pub current_token: Option<Token>,
-    pub temporary_buffer: Vec<char>,
+    pub temporary_buffer: String,
     pub token_queue: Vec<Token>,
     pub last_start_token: String,
     pub error_logger: Rc<RefCell<ErrorLogger>>,
-}

Fields§

§stream: &'a mut InputStream§state: State§consumed: Vec<char>§current_attr_name: String§current_attr_value: String§current_attrs: HashMap<String, String>§current_token: Option<Token>§temporary_buffer: Vec<char>§token_queue: Vec<Token>§last_start_token: String§error_logger: Rc<RefCell<ErrorLogger>>

Implementations§

source§

impl<'a> Tokenizer<'a>

source

pub fn consume_character_reference( +}

Fields§

§stream: &'a mut InputStream§state: State§consumed: String§current_attr_name: String§current_attr_value: String§current_attrs: HashMap<String, String>§current_token: Option<Token>§temporary_buffer: String§token_queue: Vec<Token>§last_start_token: String§error_logger: Rc<RefCell<ErrorLogger>>

Implementations§

source§

impl<'a> Tokenizer<'a>

source

pub fn consume_character_reference( &mut self, _additional_allowed_char: Option<Element>, as_attribute: bool -)

source§

impl<'a> Tokenizer<'a>

source

pub fn new( +)

source§

impl<'a> Tokenizer<'a>

source

pub fn new( input: &'a mut InputStream, opts: Option<Options>, error_logger: Rc<RefCell<ErrorLogger>> -) -> Self

source

pub fn next_token(&mut self) -> Token

source

pub fn get_error_logger(&self) -> Ref<'_, ErrorLogger>

source

pub fn get_consumed_str(&self) -> String

source

pub fn has_consumed_data(&self) -> bool

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Tokenizer<'a>

§

impl<'a> !Send for Tokenizer<'a>

§

impl<'a> !Sync for Tokenizer<'a>

§

impl<'a> Unpin for Tokenizer<'a>

§

impl<'a> !UnwindSafe for Tokenizer<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere +) -> Self

source

pub fn next_token(&mut self) -> Token

source

pub fn get_error_logger(&self) -> Ref<'_, ErrorLogger>

source

pub fn get_consumed_str(&self) -> &str

source

pub fn has_consumed_data(&self) -> bool

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Tokenizer<'a>

§

impl<'a> !Send for Tokenizer<'a>

§

impl<'a> !Sync for Tokenizer<'a>

§

impl<'a> Unpin for Tokenizer<'a>

§

impl<'a> !UnwindSafe for Tokenizer<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/help.html b/help.html index c2876662b..e983e7655 100644 --- a/help.html +++ b/help.html @@ -1 +1 @@ -Rustdoc help

Rustdoc help

Back
\ No newline at end of file +Rustdoc help

Rustdoc help

Back
\ No newline at end of file diff --git a/search-index.js b/search-index.js index 98dbb8fa3..2945d7037 100644 --- a/search-index.js +++ b/search-index.js @@ -1,6 +1,6 @@ var searchIndex = JSON.parse('{\ "gosub_browser":{"doc":"","t":"F","n":["main"],"q":[[0,"gosub_browser"]],"d":[""],"i":[0],"f":[[[],[[3,[[2,[1]]]]]]],"c":[],"p":[[8,"Error"],[3,"Box"],[4,"Result"]]},\ -"gosub_engine":{"doc":"","t":"AOAAAAAAANDDNNNDEEMMMMMLLLLLLLLLLMMMMMMMLLLLLMMMMMMLLLLLMMMMMMMMMMMMMMMMMMMMLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNDNNNNNNNNNNNNNNNNNNNNNNNNNDENNNNNNNNNNLLLLLLLLLLLLMLLLLLLLLLMMLMLLLLLLLLLLLNNEEENDDNNENNNNNLLLLLLLLLLLLLLLLMMLLMLLLLLLLLLLLLLLLLLMLLLLLLLLLLMMLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNRRDEDIESHHHRNNRRRLLLLLLLLMLLLLLLLLMLLLLLLLLLLLLLLLLLLMLLLLLLLLMMLLLLLMLLLLLLLLLLLLLLLLLLKLMMMMDLLALLLLLLLLLDENNLLLLLLLLLMLLLLLLLLLLLMLLLLLLLLRRRRRRRDDLLLLLMMMMMMLLLLLMLLMMLLAMMMAMLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNENNLLLLLLLLLLLDNNNNNNNNNNNNEIELLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLKLMMMMMMMMMMMMMADRDDDLLLLLLLLLLLLLLLLMMLLLMLLLMLLLMFFFFLLLLLLLMMLLLLMMMLLLMLLLLLLLLLLLLLLL","n":["html5_parser","read_char","testing","dom","error_logger","input_stream","node","parser","tokenizer","Closed","Element","HtmlElement","Manual","Named","Open","ShadowRoot","ShadowRootMode","SlotAssignmentMode","access_key","access_key_label","attributes","attributes","autocapitalize","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","class_list","class_list","class_name","class_name","delegates_focus","dir","draggable","from","from","from","from","from","hidden","host","id","id","inner_text","insert","into","into","into","into","into","lang","local_name","local_name","mode","namespace_uri","namespace_uri","outer_text","popover","prefix","prefix","shadow_root","shadow_root","slot","slot","slot_assignment","spellcheck","tag_name","tag_name","title","translate","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","AbruptClosingOfEmptyComment","AbruptDoctypePublicIdentifier","AbruptDoctypeSystemIdentifier","AbsenceOfDigitsInNumericCharacterReference","CdataInHtmlContent","CharacterReferenceOutsideUnicodeRange","ControlCharacterInInputStream","ControlCharacterReference","DuplicateAttribute","EndTagWithAttributes","EndTagWithTrailingSolidus","EofBeforeTagName","EofInCdata","EofInComment","EofInDoctype","EofInScriptHtmlCommentLikeText","EofInTag","ErrorLogger","ExpectedDocTypeButGotChars","ExpectedDocTypeButGotEndTag","ExpectedDocTypeButGotStartTag","IncorrectlyClosedComment","IncorrectlyOpenedComment","InvalidCharacterSequenceAfterDoctypeName","InvalidFirstCharacterOfTagName","MissingAttributeValue","MissingDoctypeName","MissingDoctypePublicIdentifier","MissingDoctypeSystemIdentifier","MissingEndTagName","MissingQuoteBeforeDoctypePublicIdentifier","MissingQuoteBeforeDoctypeSystemIdentifier","MissingSemicolonAfterCharacterReference","MissingWhitespaceAfterDoctypePublicKeyword","MissingWhitespaceAfterDoctypeSystemKeyword","MissingWhitespaceBeforeDoctypeName","MissingWhitespaceBetweenAttributes","MissingWhitespaceBetweenDoctypePublicAndSystemIdentifiers","NestedComment","NonVoidHtmlElementStartTagWithTrailingSolidus","NoncharacterCharacterReference","NoncharacterInInputStream","NullCharacterReference","ParseError","ParserError","SurrogateCharacterReference","SurrogateInInputStream","UnexpectedCharacterAfterDoctypeSystemIdentifier","UnexpectedCharacterInAttributeName","UnexpectedCharacterInUnquotedAttributeValue","UnexpectedEqualsSignBeforeAttributeName","UnexpectedNullCharacter","UnexpectedQuestionMarkInsteadOfTagName","UnexpectedSolidusInTag","UnknownNamedCharacterReference","add_error","as_str","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","col","default","eq","from","from","from","get_errors","into","into","into","line","message","new","offset","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","ASCII","Certain","Confidence","Element","Encoding","Eof","InputStream","Position","SeekCur","SeekEnd","SeekMode","SeekSet","Surrogate","Tentative","UTF8","Utf8","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","col","confidence","default","detect_encoding","encoding","eof","eq","eq","eq","eq","fmt","fmt","fmt","fmt","force_set_encoding","from","from","from","from","from","from","get_previous_position","has_read_eof","into","into","into","into","into","into","is_certain_encoding","is_eof","is_surrogate","is_utf8","length","line","new","new","offset","position","read_from_file","read_from_str","reset","seek","set_confidence","set_encoding","tell","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","u32","utf8","Comment","Comment","Document","Document","Element","Element","HTML_NAMESPACE","MATHML_NAMESPACE","Node","NodeData","NodeId","NodeTrait","NodeType","ROOT_NODE","SPECIAL_HTML_ELEMENTS","SPECIAL_MATHML_ELEMENTS","SPECIAL_SVG_ELEMENTS","SVG_NAMESPACE","Text","Text","XLINK_NAMESPACE","XMLNS_NAMESPACE","XML_NAMESPACE","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","children","clear_attributes","clone","clone","clone","clone_into","clone_into","clone_into","contains_attribute","data","default","default","eq","eq","eq","equivalent","fmt","fmt","fmt","from","from","from","from","from","get_attribute","get_mut_attribute","has_attributes","hash","id","insert_attribute","into","into","into","into","is_positive","is_root","is_special","name","namespace","new_comment","new_document","new_element","new_text","next","parent","prev","remove_attribute","root","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_of","type_of","attributes","name","value","value","Html5Parser","borrow","borrow_mut","document","from","get_parse_errors","into","new","parse","run_adoption_agency","try_from","try_into","type_id","Document","DocumentType","HTML","IframeSrcDoc","add_node","append","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default","doctype","eq","fmt","fmt","from","from","get_mut_node_by_id","get_node_by_id","get_root","into","into","new","quirks_mode","to_owned","to_string","try_from","try_from","try_into","try_into","type_id","type_id","CHAR_CR","CHAR_FF","CHAR_LF","CHAR_NUL","CHAR_REPLACEMENT","CHAR_SPACE","CHAR_TAB","Options","Tokenizer","borrow","borrow","borrow_mut","borrow_mut","consume_character_reference","consumed","current_attr_name","current_attr_value","current_attrs","current_token","error_logger","from","from","get_consumed_str","get_error_logger","has_consumed_data","initial_state","into","into","last_start_tag","last_start_token","new","next_token","state","state","stream","temporary_buffer","token","token_queue","try_from","try_from","try_into","try_into","type_id","type_id","AfterAttributeNameState","AfterAttributeValueQuotedState","AfterDocTypeNameState","AfterDocTypePublicKeywordState","AfterDocTypeSystemIdentifierState","AfterDocTypeSystemKeywordState","AfterDoctypePublicIdentifierState","AttributeNameState","AttributeValueDoubleQuotedState","AttributeValueSingleQuotedState","AttributeValueUnquotedState","BeforeAttributeNameState","BeforeAttributeValueState","BeforeDocTypeNameState","BeforeDocTypePublicIdentifierState","BeforeDocTypeSystemIdentifierState","BetweenDocTypePublicAndSystemIdentifiersState","BogusCommentState","BogusDocTypeState","CDataSectionBracketState","CDataSectionEndState","CDataSectionState","CharacterReferenceInAttributeValueState","CharacterReferenceInDataState","CharacterReferenceInRcDataState","CommentEndBangState","CommentEndDashState","CommentEndState","CommentLessThanSignBangDashDashState","CommentLessThanSignBangDashState","CommentLessThanSignBangState","CommentLessThanSignState","CommentStartDashState","CommentStartState","CommentState","DataState","DocTypeNameState","DocTypePublicIdentifierDoubleQuotedState","DocTypePublicIdentifierSingleQuotedState","DocTypeState","DocTypeSystemIdentifierDoubleQuotedState","DocTypeSystemIdentifierSingleQuotedState","EndTagOpenState","MarkupDeclarationOpenState","PlaintextState","RawTextEndTagNameState","RawTextEndTagOpenState","RawTextLessThanSignState","RawTextState","RcDataEndTagNameState","RcDataEndTagOpenState","RcDataLessThanSignState","RcDataState","ScriptDataDoubleEscapeEndState","ScriptDataDoubleEscapeStartState","ScriptDataDoubleEscapedDashDashState","ScriptDataDoubleEscapedDashState","ScriptDataDoubleEscapedLessThanSignState","ScriptDataDoubleEscapedState","ScriptDataEndTagNameState","ScriptDataEndTagOpenState","ScriptDataEscapeStartDashState","ScriptDataEscapeStartState","ScriptDataEscapedDashDashState","ScriptDataEscapedDashState","ScriptDataEscapedEndTagNameState","ScriptDataEscapedEndTagOpenState","ScriptDataEscapedLessThanSignState","ScriptDataEscapedState","ScriptDataLessThenSignState","ScriptDataState","SelfClosingStartState","State","TagNameState","TagOpenState","borrow","borrow_mut","clone","clone_into","fmt","from","into","to_owned","try_from","try_into","type_id","Attribute","CommentToken","CommentToken","DocTypeToken","DocTypeToken","EndTagToken","EndTagToken","EofToken","EofToken","StartTagToken","StartTagToken","TextToken","TextToken","Token","TokenTrait","TokenType","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","eq","eq","eq","equivalent","fmt","fmt","fmt","from","from","from","hash","into","into","into","is_empty_or_white","is_eof","is_null","name","to_owned","to_owned","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","type_of","type_of","value","attributes","attributes","force_quirks","is_self_closing","is_self_closing","name","name","name","pub_identifier","sys_identifier","value","value","tokenizer","Error","FIXTURE_ROOT","Root","Test","TokenizerBuilder","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","builders","clone","clone","clone","clone_into","clone_into","clone_into","code","col","default","default","default","description","deserialize","deserialize","deserialize","double_escaped","eq","eq","eq","errors","escape","fixture_from_filename","fixture_from_path","fixtures","fmt","fmt","fmt","from","from","from","from","initial_states","input","into","into","into","into","last_start_tag","line","output","serialize","serialize","serialize","tests","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id"],"q":[[0,"gosub_engine"],[3,"gosub_engine::html5_parser"],[9,"gosub_engine::html5_parser::dom"],[91,"gosub_engine::html5_parser::error_logger"],[183,"gosub_engine::html5_parser::input_stream"],[285,"gosub_engine::html5_parser::node"],[381,"gosub_engine::html5_parser::node::NodeData"],[385,"gosub_engine::html5_parser::parser"],[398,"gosub_engine::html5_parser::parser::document"],[432,"gosub_engine::html5_parser::tokenizer"],[476,"gosub_engine::html5_parser::tokenizer::state"],[562,"gosub_engine::html5_parser::tokenizer::token"],[621,"gosub_engine::html5_parser::tokenizer::token::Token"],[633,"gosub_engine::testing"],[634,"gosub_engine::testing::tokenizer"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","We are certain to use this encoding","","","Encoding defines the way the buffer stream is read, as …","","HTML(5) input stream structure","","Seek from the current stream position","Seek (backwards) from the end of the stream","","Seek from the start of the stream","","This encoding might be the one we need","Stream is of UTF8 characters","","","","","","","","","","","","","","","","","","","How confident are we that this is the correct encoding?","","Detect the given encoding from stream analysis","Current encoding","Returns true when the stream pointer is at the end of the …","","","","","","","","","Sets the encoding for this stream, and decodes the …","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","If all things are ok, both buffer and u8_buffer should …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns true when the encoding encountered is defined as …","","","","Length (in chars) of the buffer","","Create a new default empty input stream","Create a new position","","Current positions","Populates the current buffer with the contents of given …","Populates the current buffer with the contents of the …","Reset the stream reader back to the start","Seek explicit offset in the stream (based on chars)","Set the given confidence of the input stream encoding","Changes the encoding and if necessary, decodes the u8 …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Node that resembles a DOM node","Different type of node data","Id used to identify a node","","Different types of nodes","","","","","","","","","","","","","","","","","","","children of the node","Remove all attributes","","","","","","","Check if an attribute exists","actual data of the node","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Get a constant reference to the attribute value (or None …","Get a mutable reference to the attribute value (or None if …","Check if node has any attributes (NOTE: if node is not …","","ID of the node, 0 is always the root / document node","Add or update a an attribute","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Returns true if the given node is “special” node based …","name of the node, or empty when it’s not a tag","namespace of the node","Create a new comment node","Create a new document node","Create a new element node with the given name and …","Create a new text node","","parent of the node, if any","","Remove an attribute. If attribute doesn’t exist, nothing …","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,53,0,0,54,54,53,0,0,0,55,55,56,55,55,57,54,53,56,55,57,54,53,56,55,56,55,56,55,57,55,55,57,54,53,56,55,55,57,56,55,55,55,57,54,53,56,55,55,56,55,57,56,55,55,55,56,55,56,55,56,55,57,55,56,55,55,55,57,54,53,56,55,57,54,53,56,55,57,54,53,56,55,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,6,6,6,6,6,6,6,6,6,6,3,6,6,7,3,6,7,3,7,3,7,3,7,3,7,6,7,3,3,6,7,3,7,7,3,7,7,3,6,7,3,6,7,3,6,7,3,12,13,0,0,0,10,0,0,20,20,0,20,10,13,12,10,11,20,12,13,4,10,11,20,12,13,4,10,4,10,4,10,4,11,11,11,11,11,12,13,4,10,4,4,10,10,11,11,20,12,13,4,10,11,11,11,20,12,13,4,10,11,10,10,10,11,4,11,4,4,11,11,11,11,11,11,11,11,4,10,4,10,11,20,12,13,4,10,11,20,12,13,4,10,11,20,12,13,4,10,10,10,28,26,28,26,28,26,0,0,0,0,0,0,0,27,0,0,0,0,28,26,0,0,0,25,28,26,27,25,28,26,27,25,25,25,26,27,25,26,27,25,25,27,27,28,26,27,27,28,26,27,25,28,26,27,27,25,25,25,27,25,25,25,28,26,27,27,27,25,25,25,25,25,25,25,27,25,27,25,27,25,26,27,25,28,26,27,25,28,26,27,25,28,26,27,58,25,59,59,60,61,0,31,31,0,31,31,31,31,31,31,31,31,31,0,0,34,34,33,33,33,34,33,34,34,34,33,33,34,33,34,33,34,33,33,33,33,34,33,33,34,33,33,34,33,34,33,34,0,0,0,0,0,0,0,0,0,35,37,35,37,35,35,35,35,35,35,35,35,37,35,35,35,37,35,37,37,35,35,35,0,35,35,35,0,35,35,37,35,37,35,37,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,0,40,40,40,40,40,40,40,40,40,40,40,40,40,0,42,32,42,32,42,32,42,32,42,32,42,32,0,0,0,42,41,32,42,41,32,41,32,41,32,42,41,32,41,42,41,32,42,41,32,41,42,41,32,32,32,32,41,41,32,32,42,41,32,42,41,32,42,41,32,62,32,41,63,64,65,63,64,65,63,64,65,65,66,67,0,0,0,0,0,0,43,45,46,44,43,45,46,44,43,44,45,46,44,45,46,44,46,46,45,46,44,44,45,46,44,44,45,46,44,44,0,0,0,0,45,46,44,43,45,46,44,44,44,43,45,46,44,44,46,44,45,46,44,45,45,46,44,43,45,46,44,43,45,46,44,43,45,46,44],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],2],[[],2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[3,4,5]],[6,5],[[]],[[]],[[]],[[]],[[]],[[]],[7,7],[3,3],[[]],[[]],0,[[],3],[[7,7],8],[[]],[[]],[[]],[3,[[9,[7]]]],[[]],[[]],[[]],0,0,[[],3],0,[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[4,4],[10,10],[[]],[[]],0,0,[[],11],[11],0,[11,8],[[12,12],8],[[13,13],8],[[4,4],8],[[10,10],8],[[4,14],15],[[4,14],15],[[10,14],15],[[10,14],15],[[11,12]],[[]],[[]],[[]],[[]],[[]],[[]],[11,4],0,[[]],[[]],[[]],[[]],[[]],[[]],[11,8],[10,8],[10,8],[10,8],0,0,[[],11],[[16,16,16],4],0,0,[[11,17,[18,[12]]],19],[[11,5,[18,[12]]]],[11],[[11,20,21]],[[11,13]],[[11,12]],[11,16],[[]],[[]],[[],22],[[],22],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[10,23],[10,24],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[25,[[1,[22]]]],[25,25],[26,26],[27,27],[[]],[[]],[[]],[[25,22],[[1,[8,22]]]],0,[[],27],[[],27],[[28,28],8],[[26,26],8],[[27,27],8],[[],8],[[28,14],15],[[26,14],15],[[27,14],15],[[]],[[]],[[]],[16,27],[[]],[[25,22],[[1,[[18,[22]],22]]]],[[25,22],[[1,[[18,[22]],22]]]],[25,8],[[27,29]],0,[[25,22,22],[[1,[22]]]],[[]],[[]],[[]],[[]],[27,8],[27,8],[25,8],0,0,[5,25],[[],25],[[5,[30,[22,22]],5],25],[5,25],[27,27],0,[27,27],[[25,22],[[1,[22]]]],[[],27],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],2],[[],28],[25,28],0,0,0,0,0,[[]],[[]],0,[[]],[31,[[9,[7]]]],[[]],[11,31],[31],[[31,32]],[[],1],[[],1],[[],2],0,0,0,0,[[33,25,27],27],[[33,27,27]],[[]],[[]],[[]],[[]],[34,34],[[]],[[],33],0,[[34,34],8],[[33,14],15],[[34,14],15],[[]],[[]],[[33,27],[[18,[25]]]],[[33,27],[[18,[25]]]],[33,25],[[]],[[]],[[],33],0,[[]],[[],22],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[35,[18,[10]],8]],0,0,0,0,0,0,[[]],[[]],[35,22],[35,[[36,[3]]]],[35,8],0,[[]],[[]],0,0,[[11,[18,[37]],[39,[[38,[3]]]]],35],[35,32],0,0,0,0,0,0,[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[40,40],[[]],[[40,14],15],[[]],[[]],[[]],[[],1],[[],1],[[],2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[41,41],[32,32],[[]],[[]],[[42,42],8],[[41,41],8],[[32,32],8],[[],8],[[42,14],15],[[41,14],15],[[32,14],15],[[]],[[]],[[]],[[41,29]],[[]],[[]],[[]],[32,8],[32,8],[32,8],0,[[]],[[]],[[],22],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],42],[32,42],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[43,35],[44,[[9,[43]]]],[45,45],[46,46],[44,44],[[]],[[]],[[]],0,0,[[],45],[[],46],[[],44],0,[47,[[1,[45]]]],[47,[[1,[46]]]],[47,[[1,[44]]]],0,[[45,45],8],[[46,46],8],[[44,44],8],0,[5,22],[5,[[1,[45,48]]]],[[[50,[49]]],[[1,[45,48]]]],[[],51],[[45,14],15],[[46,14],15],[[44,14],15],[[]],[[]],[[]],[[]],0,0,[[]],[[]],[[]],[[]],0,0,0,[[45,52],1],[[46,52],1],[[44,52],1],0,[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],2]],"c":[],"p":[[4,"Result"],[3,"TypeId"],[3,"ErrorLogger"],[3,"Position"],[15,"str"],[4,"ParserError"],[3,"ParseError"],[15,"bool"],[3,"Vec"],[4,"Element"],[3,"InputStream"],[4,"Encoding"],[4,"Confidence"],[3,"Formatter"],[6,"Result"],[15,"usize"],[3,"File"],[4,"Option"],[6,"Result"],[4,"SeekMode"],[15,"isize"],[3,"String"],[15,"u32"],[15,"char"],[3,"Node"],[4,"NodeData"],[3,"NodeId"],[4,"NodeType"],[8,"Hasher"],[3,"HashMap"],[3,"Html5Parser"],[4,"Token"],[3,"Document"],[4,"DocumentType"],[3,"Tokenizer"],[3,"Ref"],[3,"Options"],[3,"RefCell"],[3,"Rc"],[4,"State"],[3,"Attribute"],[4,"TokenType"],[3,"TokenizerBuilder"],[3,"Test"],[3,"Root"],[3,"Error"],[8,"Deserializer"],[3,"Error"],[3,"Path"],[8,"AsRef"],[8,"Iterator"],[8,"Serializer"],[4,"ShadowRootMode"],[4,"SlotAssignmentMode"],[3,"HtmlElement"],[3,"Element"],[3,"ShadowRoot"],[8,"NodeTrait"],[13,"Element"],[13,"Text"],[13,"Comment"],[8,"TokenTrait"],[13,"StartTagToken"],[13,"EndTagToken"],[13,"DocTypeToken"],[13,"CommentToken"],[13,"TextToken"]]},\ +"gosub_engine":{"doc":"","t":"AOAAAAAAANDDNNNDEEMMMMMLLLLLLLLLLMMMMMMMLLLLLMMMMMMLLLLLMMMMMMMMMMMMMMMMMMMMLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNDNNNNNNNNNNNNNNNNNNNNNNNNNDENNNNNNNNNNLLLLLLLLLLLLMLLLLLLLLLMMLMLLLLLLLLLLLNNEEENDDNNENNNNNLLLLLLLLLLLLLLLLMMLLMLLLLLLLLLLLLLLLLLMLLLLLLLLLLMMLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNRRDEDIESHHHRNNRRRLLLLLLLLMLLLLLLLLMLLLLLLLLLLLLLLLLLLMLLLLLLLLMMLLLLLMLLLLLLLLLLLLLLLLLLKLMMMMDLLALLLLLLLLLDENNLLLLLLLLLMLLLLLLLLLLLMLLLLLLLLRRRRRRRDDLLLLLMMMMMMLLLLLMLLMMLLAMMMAMLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNENNLLLLLLLLLLLDNNNNNNNNNNNNEIELLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLKLMMMMMMMMMMMMMADRDDDLLLLLLLLLLLLLLLLMMLLLMLLLMLLLMFFFFLLLLLLLMMLLLLMMMLLLMLLLLLLLLLLLLLLL","n":["html5_parser","read_char","testing","dom","error_logger","input_stream","node","parser","tokenizer","Closed","Element","HtmlElement","Manual","Named","Open","ShadowRoot","ShadowRootMode","SlotAssignmentMode","access_key","access_key_label","attributes","attributes","autocapitalize","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","class_list","class_list","class_name","class_name","delegates_focus","dir","draggable","from","from","from","from","from","hidden","host","id","id","inner_text","insert","into","into","into","into","into","lang","local_name","local_name","mode","namespace_uri","namespace_uri","outer_text","popover","prefix","prefix","shadow_root","shadow_root","slot","slot","slot_assignment","spellcheck","tag_name","tag_name","title","translate","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","AbruptClosingOfEmptyComment","AbruptDoctypePublicIdentifier","AbruptDoctypeSystemIdentifier","AbsenceOfDigitsInNumericCharacterReference","CdataInHtmlContent","CharacterReferenceOutsideUnicodeRange","ControlCharacterInInputStream","ControlCharacterReference","DuplicateAttribute","EndTagWithAttributes","EndTagWithTrailingSolidus","EofBeforeTagName","EofInCdata","EofInComment","EofInDoctype","EofInScriptHtmlCommentLikeText","EofInTag","ErrorLogger","ExpectedDocTypeButGotChars","ExpectedDocTypeButGotEndTag","ExpectedDocTypeButGotStartTag","IncorrectlyClosedComment","IncorrectlyOpenedComment","InvalidCharacterSequenceAfterDoctypeName","InvalidFirstCharacterOfTagName","MissingAttributeValue","MissingDoctypeName","MissingDoctypePublicIdentifier","MissingDoctypeSystemIdentifier","MissingEndTagName","MissingQuoteBeforeDoctypePublicIdentifier","MissingQuoteBeforeDoctypeSystemIdentifier","MissingSemicolonAfterCharacterReference","MissingWhitespaceAfterDoctypePublicKeyword","MissingWhitespaceAfterDoctypeSystemKeyword","MissingWhitespaceBeforeDoctypeName","MissingWhitespaceBetweenAttributes","MissingWhitespaceBetweenDoctypePublicAndSystemIdentifiers","NestedComment","NonVoidHtmlElementStartTagWithTrailingSolidus","NoncharacterCharacterReference","NoncharacterInInputStream","NullCharacterReference","ParseError","ParserError","SurrogateCharacterReference","SurrogateInInputStream","UnexpectedCharacterAfterDoctypeSystemIdentifier","UnexpectedCharacterInAttributeName","UnexpectedCharacterInUnquotedAttributeValue","UnexpectedEqualsSignBeforeAttributeName","UnexpectedNullCharacter","UnexpectedQuestionMarkInsteadOfTagName","UnexpectedSolidusInTag","UnknownNamedCharacterReference","add_error","as_str","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","col","default","eq","from","from","from","get_errors","into","into","into","line","message","new","offset","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","ASCII","Certain","Confidence","Element","Encoding","Eof","InputStream","Position","SeekCur","SeekEnd","SeekMode","SeekSet","Surrogate","Tentative","UTF8","Utf8","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","col","confidence","default","detect_encoding","encoding","eof","eq","eq","eq","eq","fmt","fmt","fmt","fmt","force_set_encoding","from","from","from","from","from","from","get_previous_position","has_read_eof","into","into","into","into","into","into","is_certain_encoding","is_eof","is_surrogate","is_utf8","length","line","new","new","offset","position","read_from_file","read_from_str","reset","seek","set_confidence","set_encoding","tell","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","u32","utf8","Comment","Comment","Document","Document","Element","Element","HTML_NAMESPACE","MATHML_NAMESPACE","Node","NodeData","NodeId","NodeTrait","NodeType","ROOT_NODE","SPECIAL_HTML_ELEMENTS","SPECIAL_MATHML_ELEMENTS","SPECIAL_SVG_ELEMENTS","SVG_NAMESPACE","Text","Text","XLINK_NAMESPACE","XMLNS_NAMESPACE","XML_NAMESPACE","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","children","clear_attributes","clone","clone","clone","clone_into","clone_into","clone_into","contains_attribute","data","default","default","eq","eq","eq","equivalent","fmt","fmt","fmt","from","from","from","from","from","get_attribute","get_mut_attribute","has_attributes","hash","id","insert_attribute","into","into","into","into","is_positive","is_root","is_special","name","namespace","new_comment","new_document","new_element","new_text","next","parent","prev","remove_attribute","root","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_of","type_of","attributes","name","value","value","Html5Parser","borrow","borrow_mut","document","from","get_parse_errors","into","new","parse","run_adoption_agency","try_from","try_into","type_id","Document","DocumentType","HTML","IframeSrcDoc","add_node","append","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default","doctype","eq","fmt","fmt","from","from","get_mut_node_by_id","get_node_by_id","get_root","into","into","new","quirks_mode","to_owned","to_string","try_from","try_from","try_into","try_into","type_id","type_id","CHAR_CR","CHAR_FF","CHAR_LF","CHAR_NUL","CHAR_REPLACEMENT","CHAR_SPACE","CHAR_TAB","Options","Tokenizer","borrow","borrow","borrow_mut","borrow_mut","consume_character_reference","consumed","current_attr_name","current_attr_value","current_attrs","current_token","error_logger","from","from","get_consumed_str","get_error_logger","has_consumed_data","initial_state","into","into","last_start_tag","last_start_token","new","next_token","state","state","stream","temporary_buffer","token","token_queue","try_from","try_from","try_into","try_into","type_id","type_id","AfterAttributeNameState","AfterAttributeValueQuotedState","AfterDocTypeNameState","AfterDocTypePublicKeywordState","AfterDocTypeSystemIdentifierState","AfterDocTypeSystemKeywordState","AfterDoctypePublicIdentifierState","AttributeNameState","AttributeValueDoubleQuotedState","AttributeValueSingleQuotedState","AttributeValueUnquotedState","BeforeAttributeNameState","BeforeAttributeValueState","BeforeDocTypeNameState","BeforeDocTypePublicIdentifierState","BeforeDocTypeSystemIdentifierState","BetweenDocTypePublicAndSystemIdentifiersState","BogusCommentState","BogusDocTypeState","CDataSectionBracketState","CDataSectionEndState","CDataSectionState","CharacterReferenceInAttributeValueState","CharacterReferenceInDataState","CharacterReferenceInRcDataState","CommentEndBangState","CommentEndDashState","CommentEndState","CommentLessThanSignBangDashDashState","CommentLessThanSignBangDashState","CommentLessThanSignBangState","CommentLessThanSignState","CommentStartDashState","CommentStartState","CommentState","DataState","DocTypeNameState","DocTypePublicIdentifierDoubleQuotedState","DocTypePublicIdentifierSingleQuotedState","DocTypeState","DocTypeSystemIdentifierDoubleQuotedState","DocTypeSystemIdentifierSingleQuotedState","EndTagOpenState","MarkupDeclarationOpenState","PlaintextState","RawTextEndTagNameState","RawTextEndTagOpenState","RawTextLessThanSignState","RawTextState","RcDataEndTagNameState","RcDataEndTagOpenState","RcDataLessThanSignState","RcDataState","ScriptDataDoubleEscapeEndState","ScriptDataDoubleEscapeStartState","ScriptDataDoubleEscapedDashDashState","ScriptDataDoubleEscapedDashState","ScriptDataDoubleEscapedLessThanSignState","ScriptDataDoubleEscapedState","ScriptDataEndTagNameState","ScriptDataEndTagOpenState","ScriptDataEscapeStartDashState","ScriptDataEscapeStartState","ScriptDataEscapedDashDashState","ScriptDataEscapedDashState","ScriptDataEscapedEndTagNameState","ScriptDataEscapedEndTagOpenState","ScriptDataEscapedLessThanSignState","ScriptDataEscapedState","ScriptDataLessThenSignState","ScriptDataState","SelfClosingStartState","State","TagNameState","TagOpenState","borrow","borrow_mut","clone","clone_into","fmt","from","into","to_owned","try_from","try_into","type_id","Attribute","CommentToken","CommentToken","DocTypeToken","DocTypeToken","EndTagToken","EndTagToken","EofToken","EofToken","StartTagToken","StartTagToken","TextToken","TextToken","Token","TokenTrait","TokenType","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","eq","eq","eq","equivalent","fmt","fmt","fmt","from","from","from","hash","into","into","into","is_empty_or_white","is_eof","is_null","name","to_owned","to_owned","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","type_of","type_of","value","attributes","attributes","force_quirks","is_self_closing","is_self_closing","name","name","name","pub_identifier","sys_identifier","value","value","tokenizer","Error","FIXTURE_ROOT","Root","Test","TokenizerBuilder","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","builders","clone","clone","clone","clone_into","clone_into","clone_into","code","col","default","default","default","description","deserialize","deserialize","deserialize","double_escaped","eq","eq","eq","errors","escape","fixture_from_filename","fixture_from_path","fixtures","fmt","fmt","fmt","from","from","from","from","initial_states","input","into","into","into","into","last_start_tag","line","output","serialize","serialize","serialize","tests","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id"],"q":[[0,"gosub_engine"],[3,"gosub_engine::html5_parser"],[9,"gosub_engine::html5_parser::dom"],[91,"gosub_engine::html5_parser::error_logger"],[183,"gosub_engine::html5_parser::input_stream"],[285,"gosub_engine::html5_parser::node"],[381,"gosub_engine::html5_parser::node::NodeData"],[385,"gosub_engine::html5_parser::parser"],[398,"gosub_engine::html5_parser::parser::document"],[432,"gosub_engine::html5_parser::tokenizer"],[476,"gosub_engine::html5_parser::tokenizer::state"],[562,"gosub_engine::html5_parser::tokenizer::token"],[621,"gosub_engine::html5_parser::tokenizer::token::Token"],[633,"gosub_engine::testing"],[634,"gosub_engine::testing::tokenizer"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","We are certain to use this encoding","","","Encoding defines the way the buffer stream is read, as …","","HTML(5) input stream structure","","Seek from the current stream position","Seek (backwards) from the end of the stream","","Seek from the start of the stream","","This encoding might be the one we need","Stream is of UTF8 characters","","","","","","","","","","","","","","","","","","","How confident are we that this is the correct encoding?","","Detect the given encoding from stream analysis","Current encoding","Returns true when the stream pointer is at the end of the …","","","","","","","","","Sets the encoding for this stream, and decodes the …","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","If all things are ok, both buffer and u8_buffer should …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns true when the encoding encountered is defined as …","","","","Length (in chars) of the buffer","","Create a new default empty input stream","Create a new position","","Current positions","Populates the current buffer with the contents of given …","Populates the current buffer with the contents of the …","Reset the stream reader back to the start","Seek explicit offset in the stream (based on chars)","Set the given confidence of the input stream encoding","Changes the encoding and if necessary, decodes the u8 …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Node that resembles a DOM node","Different type of node data","Id used to identify a node","","Different types of nodes","","","","","","","","","","","","","","","","","","","children of the node","Remove all attributes","","","","","","","Check if an attribute exists","actual data of the node","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Get a constant reference to the attribute value (or None …","Get a mutable reference to the attribute value (or None if …","Check if node has any attributes (NOTE: if node is not …","","ID of the node, 0 is always the root / document node","Add or update a an attribute","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Returns true if the given node is “special” node based …","name of the node, or empty when it’s not a tag","namespace of the node","Create a new comment node","Create a new document node","Create a new element node with the given name and …","Create a new text node","","parent of the node, if any","","Remove an attribute. If attribute doesn’t exist, nothing …","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,53,0,0,54,54,53,0,0,0,55,55,56,55,55,57,54,53,56,55,57,54,53,56,55,56,55,56,55,57,55,55,57,54,53,56,55,55,57,56,55,55,55,57,54,53,56,55,55,56,55,57,56,55,55,55,56,55,56,55,56,55,57,55,56,55,55,55,57,54,53,56,55,57,54,53,56,55,57,54,53,56,55,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,6,6,6,6,6,6,6,6,6,6,3,6,6,7,3,6,7,3,7,3,7,3,7,3,7,6,7,3,3,6,7,3,7,7,3,7,7,3,6,7,3,6,7,3,6,7,3,12,13,0,0,0,10,0,0,20,20,0,20,10,13,12,10,11,20,12,13,4,10,11,20,12,13,4,10,4,10,4,10,4,11,11,11,11,11,12,13,4,10,4,4,10,10,11,11,20,12,13,4,10,11,11,11,20,12,13,4,10,11,10,10,10,11,4,11,4,4,11,11,11,11,11,11,11,11,4,10,4,10,11,20,12,13,4,10,11,20,12,13,4,10,11,20,12,13,4,10,10,10,28,26,28,26,28,26,0,0,0,0,0,0,0,27,0,0,0,0,28,26,0,0,0,25,28,26,27,25,28,26,27,25,25,25,26,27,25,26,27,25,25,27,27,28,26,27,27,28,26,27,25,28,26,27,27,25,25,25,27,25,25,25,28,26,27,27,27,25,25,25,25,25,25,25,27,25,27,25,27,25,26,27,25,28,26,27,25,28,26,27,25,28,26,27,58,25,59,59,60,61,0,31,31,0,31,31,31,31,31,31,31,31,31,0,0,34,34,33,33,33,34,33,34,34,34,33,33,34,33,34,33,34,33,33,33,33,34,33,33,34,33,33,34,33,34,33,34,0,0,0,0,0,0,0,0,0,35,37,35,37,35,35,35,35,35,35,35,35,37,35,35,35,37,35,37,37,35,35,35,0,35,35,35,0,35,35,37,35,37,35,37,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,0,40,40,40,40,40,40,40,40,40,40,40,40,40,0,42,32,42,32,42,32,42,32,42,32,42,32,0,0,0,42,41,32,42,41,32,41,32,41,32,42,41,32,41,42,41,32,42,41,32,41,42,41,32,32,32,32,41,41,32,32,42,41,32,42,41,32,42,41,32,62,32,41,63,64,65,63,64,65,63,64,65,65,66,67,0,0,0,0,0,0,43,45,46,44,43,45,46,44,43,44,45,46,44,45,46,44,46,46,45,46,44,44,45,46,44,44,45,46,44,44,0,0,0,0,45,46,44,43,45,46,44,44,44,43,45,46,44,44,46,44,45,46,44,45,45,46,44,43,45,46,44,43,45,46,44,43,45,46,44],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],2],[[],2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[3,4,5]],[6,5],[[]],[[]],[[]],[[]],[[]],[[]],[7,7],[3,3],[[]],[[]],0,[[],3],[[7,7],8],[[]],[[]],[[]],[3,[[9,[7]]]],[[]],[[]],[[]],0,0,[[],3],0,[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[4,4],[10,10],[[]],[[]],0,0,[[],11],[11],0,[11,8],[[12,12],8],[[13,13],8],[[4,4],8],[[10,10],8],[[4,14],15],[[4,14],15],[[10,14],15],[[10,14],15],[[11,12]],[[]],[[]],[[]],[[]],[[]],[[]],[11,4],0,[[]],[[]],[[]],[[]],[[]],[[]],[11,8],[10,8],[10,8],[10,8],0,0,[[],11],[[16,16,16],4],0,0,[[11,17,[18,[12]]],19],[[11,5,[18,[12]]]],[11],[[11,20,21]],[[11,13]],[[11,12]],[11,16],[[]],[[]],[[],22],[[],22],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[10,23],[10,24],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[25,[[1,[22]]]],[25,25],[26,26],[27,27],[[]],[[]],[[]],[[25,5],[[1,[8,22]]]],0,[[],27],[[],27],[[28,28],8],[[26,26],8],[[27,27],8],[[],8],[[28,14],15],[[26,14],15],[[27,14],15],[[]],[[]],[[]],[16,27],[[]],[[25,5],[[1,[[18,[22]],22]]]],[[25,5],[[1,[[18,[22]],22]]]],[25,8],[[27,29]],0,[[25,5,5],[[1,[22]]]],[[]],[[]],[[]],[[]],[27,8],[27,8],[25,8],0,0,[5,25],[[],25],[[5,[30,[22,22]],5],25],[5,25],[27,27],0,[27,27],[[25,5],[[1,[22]]]],[[],27],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],2],[[],28],[25,28],0,0,0,0,0,[[]],[[]],0,[[]],[31,[[9,[7]]]],[[]],[11,31],[31],[[31,32]],[[],1],[[],1],[[],2],0,0,0,0,[[33,25,27],27],[[33,27,27]],[[]],[[]],[[]],[[]],[34,34],[[]],[[],33],0,[[34,34],8],[[33,14],15],[[34,14],15],[[]],[[]],[[33,27],[[18,[25]]]],[[33,27],[[18,[25]]]],[33,25],[[]],[[]],[[],33],0,[[]],[[],22],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[35,[18,[10]],8]],0,0,0,0,0,0,[[]],[[]],[35,5],[35,[[36,[3]]]],[35,8],0,[[]],[[]],0,0,[[11,[18,[37]],[39,[[38,[3]]]]],35],[35,32],0,0,0,0,0,0,[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[40,40],[[]],[[40,14],15],[[]],[[]],[[]],[[],1],[[],1],[[],2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[41,41],[32,32],[[]],[[]],[[42,42],8],[[41,41],8],[[32,32],8],[[],8],[[42,14],15],[[41,14],15],[[32,14],15],[[]],[[]],[[]],[[41,29]],[[]],[[]],[[]],[32,8],[32,8],[32,8],0,[[]],[[]],[[],22],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],42],[32,42],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[43,35],[44,[[9,[43]]]],[45,45],[46,46],[44,44],[[]],[[]],[[]],0,0,[[],45],[[],46],[[],44],0,[47,[[1,[45]]]],[47,[[1,[46]]]],[47,[[1,[44]]]],0,[[45,45],8],[[46,46],8],[[44,44],8],0,[5,22],[5,[[1,[45,48]]]],[[[50,[49]]],[[1,[45,48]]]],[[],51],[[45,14],15],[[46,14],15],[[44,14],15],[[]],[[]],[[]],[[]],0,0,[[]],[[]],[[]],[[]],0,0,0,[[45,52],1],[[46,52],1],[[44,52],1],0,[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],2],[[],2],[[],2],[[],2]],"c":[],"p":[[4,"Result"],[3,"TypeId"],[3,"ErrorLogger"],[3,"Position"],[15,"str"],[4,"ParserError"],[3,"ParseError"],[15,"bool"],[3,"Vec"],[4,"Element"],[3,"InputStream"],[4,"Encoding"],[4,"Confidence"],[3,"Formatter"],[6,"Result"],[15,"usize"],[3,"File"],[4,"Option"],[6,"Result"],[4,"SeekMode"],[15,"isize"],[3,"String"],[15,"u32"],[15,"char"],[3,"Node"],[4,"NodeData"],[3,"NodeId"],[4,"NodeType"],[8,"Hasher"],[3,"HashMap"],[3,"Html5Parser"],[4,"Token"],[3,"Document"],[4,"DocumentType"],[3,"Tokenizer"],[3,"Ref"],[3,"Options"],[3,"RefCell"],[3,"Rc"],[4,"State"],[3,"Attribute"],[4,"TokenType"],[3,"TokenizerBuilder"],[3,"Test"],[3,"Root"],[3,"Error"],[8,"Deserializer"],[3,"Error"],[3,"Path"],[8,"AsRef"],[8,"Iterator"],[8,"Serializer"],[4,"ShadowRootMode"],[4,"SlotAssignmentMode"],[3,"HtmlElement"],[3,"Element"],[3,"ShadowRoot"],[8,"NodeTrait"],[13,"Element"],[13,"Text"],[13,"Comment"],[8,"TokenTrait"],[13,"StartTagToken"],[13,"EndTagToken"],[13,"DocTypeToken"],[13,"CommentToken"],[13,"TextToken"]]},\ "parser_test":{"doc":"","t":"DENNNDDMLLLLLLLLMMMMMLLMMMMLLLLLLLLMMFFFFFFMMLLLLLLLLLLLL","n":["Error","ErrorResult","Failure","PositionFailure","Success","Test","TestResults","assertions","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","code","col","data","document","document_fragment","eq","eq","errors","failed","failed_position","file_path","from","from","from","from","into","into","into","into","line","line","main","match_document_tree","match_error","match_node","read_tests","run_tree_test","succeeded","tests","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id"],"q":[[0,"parser_test"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","Element nodes must be represented by a “<” then the …","","","","","","","","","","","","","","","","","",""],"i":[0,0,1,1,1,0,0,14,14,13,1,3,14,13,1,3,3,3,13,13,13,1,3,13,14,14,13,14,13,1,3,14,13,1,3,13,3,0,0,0,0,0,0,14,14,14,13,1,3,14,13,1,3,14,13,1,3],"f":[0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,[[1,1],2],[[3,3],2],0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[],4],[[5,[7,[6]]],2],[[3,3],1],[[8,9,9,5,[7,[6]]],[[11,[10]]]],[12,[[4,[[7,[13]]]]]],[[10,13,14]],0,0,[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],16],[[],16],[[],16],[[],16]],"c":[],"p":[[4,"ErrorResult"],[15,"bool"],[3,"Error"],[6,"Result"],[3,"Document"],[3,"String"],[3,"Vec"],[3,"NodeId"],[15,"isize"],[15,"usize"],[4,"Option"],[3,"PathBuf"],[3,"Test"],[3,"TestResults"],[4,"Result"],[3,"TypeId"]]},\ "test_user_agent":{"doc":"","t":"FFFF","n":["display_node","get_node","get_node_by_path","main"],"q":[[0,"test_user_agent"]],"d":["","","",""],"i":[0,0,0,0],"f":[[[1,2]],[[1,2,3],[[4,[2]]]],[[1,[5,[3]]],[[4,[2]]]],[[],[[8,[[7,[6]]]]]]],"c":[],"p":[[3,"Document"],[3,"Node"],[15,"str"],[4,"Option"],[3,"Vec"],[8,"Error"],[3,"Box"],[4,"Result"]]}\ }'); diff --git a/settings.html b/settings.html index a3f4c78ab..f5919b018 100644 --- a/settings.html +++ b/settings.html @@ -1 +1 @@ -Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file +Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src/gosub_engine/html5_parser/node.rs.html b/src/gosub_engine/html5_parser/node.rs.html index e3f561805..598bc28ea 100644 --- a/src/gosub_engine/html5_parser/node.rs.html +++ b/src/gosub_engine/html5_parser/node.rs.html @@ -725,37 +725,6 @@ 725 726 727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758
use std::collections::HashMap;
 
 pub const HTML_NAMESPACE: &str = "http://www.w3.org/1999/xhtml";
@@ -948,13 +917,13 @@
     }
 
     /// Check if an attribute exists
-    pub fn contains_attribute(&self, name: String) -> Result<bool, String> {
+    pub fn contains_attribute(&self, name: &str) -> Result<bool, String> {
         if self.type_of() != NodeType::Element {
-            return Err(String::from(ATTRIBUTE_NODETYPE_ERR_MSG));
+            return Err(ATTRIBUTE_NODETYPE_ERR_MSG.into());
         }
 
         let contains: bool = match &self.data {
-            NodeData::Element { attributes, .. } => attributes.contains_key(&name),
+            NodeData::Element { attributes, .. } => attributes.contains_key(name),
             _ => false,
         };
 
@@ -962,26 +931,26 @@
     }
 
     /// Add or update a an attribute
-    pub fn insert_attribute(&mut self, name: String, value: String) -> Result<(), String> {
+    pub fn insert_attribute(&mut self, name: &str, value: &str) -> Result<(), String> {
         if self.type_of() != NodeType::Element {
-            return Err(String::from(ATTRIBUTE_NODETYPE_ERR_MSG));
+            return Err(ATTRIBUTE_NODETYPE_ERR_MSG.into());
         }
 
         if let NodeData::Element { attributes, .. } = &mut self.data {
-            attributes.insert(name, value);
+            attributes.insert(name.to_owned(), value.to_owned());
         }
 
         Ok(())
     }
 
     /// Remove an attribute. If attribute doesn't exist, nothing happens.
-    pub fn remove_attribute(&mut self, name: String) -> Result<(), String> {
+    pub fn remove_attribute(&mut self, name: &str) -> Result<(), String> {
         if self.type_of() != NodeType::Element {
-            return Err(String::from(ATTRIBUTE_NODETYPE_ERR_MSG));
+            return Err(ATTRIBUTE_NODETYPE_ERR_MSG.into());
         }
 
         if let NodeData::Element { attributes, .. } = &mut self.data {
-            attributes.remove(&name);
+            attributes.remove(name);
         }
 
         Ok(())
@@ -989,14 +958,14 @@
 
     /// Get a constant reference to the attribute value
     /// (or None if attribute doesn't exist)
-    pub fn get_attribute(&self, name: String) -> Result<Option<&String>, String> {
+    pub fn get_attribute(&self, name: &str) -> Result<Option<&String>, String> {
         if self.type_of() != NodeType::Element {
-            return Err(String::from(ATTRIBUTE_NODETYPE_ERR_MSG));
+            return Err(ATTRIBUTE_NODETYPE_ERR_MSG.into());
         }
 
         let mut value: Option<&String> = None;
         if let NodeData::Element { attributes, .. } = &self.data {
-            value = attributes.get(&name);
+            value = attributes.get(name);
         }
 
         Ok(value)
@@ -1004,14 +973,14 @@
 
     /// Get a mutable reference to the attribute value
     /// (or None if the attribute doesn't exist)
-    pub fn get_mut_attribute(&mut self, name: String) -> Result<Option<&mut String>, String> {
+    pub fn get_mut_attribute(&mut self, name: &str) -> Result<Option<&mut String>, String> {
         if self.type_of() != NodeType::Element {
-            return Err(String::from(ATTRIBUTE_NODETYPE_ERR_MSG));
+            return Err(ATTRIBUTE_NODETYPE_ERR_MSG.into());
         }
 
         let mut value: Option<&mut String> = None;
         if let NodeData::Element { attributes, .. } = &mut self.data {
-            value = attributes.get_mut(&name);
+            value = attributes.get_mut(name);
         }
 
         Ok(value)
@@ -1152,11 +1121,11 @@
 pub static SPECIAL_SVG_ELEMENTS: [&str; 3] = ["foreignObject", "desc", "title"];
 
 #[cfg(test)]
-mod test {
+mod tests {
     use super::*;
 
     #[test]
-    fn test_new_document() {
+    fn new_document() {
         let node = Node::new_document();
         assert_eq!(node.id, NodeId::default());
         assert_eq!(node.parent, None);
@@ -1167,7 +1136,7 @@
     }
 
     #[test]
-    fn test_new_element() {
+    fn new_element() {
         let mut attributes = HashMap::new();
         attributes.insert("id".to_string(), "test".to_string());
         let node = Node::new_element("div", attributes.clone(), HTML_NAMESPACE);
@@ -1186,7 +1155,7 @@
     }
 
     #[test]
-    fn test_new_comment() {
+    fn new_comment() {
         let node = Node::new_comment("test");
         assert_eq!(node.id, NodeId::default());
         assert_eq!(node.parent, None);
@@ -1202,7 +1171,7 @@
     }
 
     #[test]
-    fn test_new_text() {
+    fn new_text() {
         let node = Node::new_text("test");
         assert_eq!(node.id, NodeId::default());
         assert_eq!(node.parent, None);
@@ -1218,7 +1187,7 @@
     }
 
     #[test]
-    fn test_is_special() {
+    fn is_special() {
         let mut attributes = HashMap::new();
         attributes.insert("id".to_string(), "test".to_string());
         let node = Node::new_element("div", attributes, HTML_NAMESPACE);
@@ -1226,7 +1195,7 @@
     }
 
     #[test]
-    fn test_type_of() {
+    fn type_of() {
         let node = Node::new_document();
         assert_eq!(node.type_of(), NodeType::Document);
         let node = Node::new_text("test");
@@ -1240,7 +1209,7 @@
     }
 
     #[test]
-    fn test_special_html_elements() {
+    fn special_html_elements() {
         for element in SPECIAL_HTML_ELEMENTS.iter() {
             let mut attributes = HashMap::new();
             attributes.insert("id".to_string(), "test".to_string());
@@ -1250,7 +1219,7 @@
     }
 
     #[test]
-    fn test_special_mathml_elements() {
+    fn special_mathml_elements() {
         for element in SPECIAL_MATHML_ELEMENTS.iter() {
             let mut attributes = HashMap::new();
             attributes.insert("id".to_string(), "test".to_string());
@@ -1260,7 +1229,7 @@
     }
 
     #[test]
-    fn test_special_svg_elements() {
+    fn special_svg_elements() {
         for element in SPECIAL_SVG_ELEMENTS.iter() {
             let mut attributes = HashMap::new();
             attributes.insert("id".to_string(), "test".to_string());
@@ -1270,7 +1239,7 @@
     }
 
     #[test]
-    fn test_type_of_node() {
+    fn type_of_node() {
         let node = Node::new_document();
         assert_eq!(node.type_of(), NodeType::Document);
         let node = Node::new_text("test");
@@ -1284,7 +1253,7 @@
     }
 
     #[test]
-    fn test_type_of_node_data() {
+    fn type_of_node_data() {
         let node = Node::new_document();
         assert_eq!(node.data, NodeData::Document {});
         let node = Node::new_text("test");
@@ -1314,7 +1283,7 @@
     }
 
     #[test]
-    fn test_type_of_node_data_element() {
+    fn type_of_node_data_element() {
         let mut attributes = HashMap::new();
         attributes.insert("id".to_string(), "test".to_string());
         let node = Node::new_element("div", attributes.clone(), HTML_NAMESPACE);
@@ -1328,7 +1297,7 @@
     }
 
     #[test]
-    fn test_type_of_node_data_text() {
+    fn type_of_node_data_text() {
         let node = Node::new_text("test");
         assert_eq!(
             node.data,
@@ -1339,7 +1308,7 @@
     }
 
     #[test]
-    fn test_type_of_node_data_comment() {
+    fn type_of_node_data_comment() {
         let node = Node::new_comment("test");
         assert_eq!(
             node.data,
@@ -1350,168 +1319,137 @@
     }
 
     #[test]
-    fn test_type_of_node_data_document() {
+    fn type_of_node_data_document() {
         let node = Node::new_document();
         assert_eq!(node.data, NodeData::Document {});
     }
 
     #[test]
-    fn test_contains_attribute_non_element() {
+    fn contains_attribute_non_element() {
         let node = Node::new_document();
-        let result = node.contains_attribute("x".to_string());
+        let result = node.contains_attribute("x");
         assert!(result.is_err())
     }
 
     #[test]
-    fn test_contains_attribute() {
+    fn contains_attribute() {
         let mut attr = HashMap::new();
         attr.insert("x".to_string(), "value".to_string());
 
         let node = Node::new_element("node", attr.clone(), HTML_NAMESPACE);
 
-        match node.contains_attribute("x".to_string()) {
-            Err(_) => assert!(false),
-            Ok(result) => {
-                assert_eq!(result, true);
-            }
-        }
-
-        match node.contains_attribute("z".to_string()) {
-            Err(_) => assert!(false),
-            Ok(result) => {
-                assert_eq!(result, false);
-            }
-        }
+        assert!(node.contains_attribute("x").unwrap());
+        assert!(!node.contains_attribute("z").unwrap());
     }
 
     #[test]
-    fn test_insert_attrubte_non_element() {
+    fn insert_attrubte_non_element() {
         let mut node = Node::new_document();
-        let result = node.insert_attribute("name".to_string(), "value".to_string());
+        let result = node.insert_attribute("name", "value");
         assert!(result.is_err());
     }
 
     #[test]
-    fn test_insert_attribute() {
+    fn insert_attribute() {
         let attr = HashMap::new();
         let mut node = Node::new_element("name", attr.clone(), HTML_NAMESPACE);
-        if let Ok(_) = node.insert_attribute("key".to_string(), "value".to_string()) {
-            if let Ok(value) = node.get_attribute("key".to_string()) {
-                match value {
-                    None => assert!(false),
-                    Some(val) => assert_eq!(*val, "value".to_string()),
-                }
-            }
-        }
+
+        assert!(node.insert_attribute("key", "value").is_ok());
+        let value = node.get_attribute("key").unwrap().unwrap();
+        assert_eq!(value, "value");
     }
 
     #[test]
-    fn test_remove_attribute_non_element() {
+    fn remove_attribute_non_element() {
         let mut node = Node::new_document();
-        let result = node.remove_attribute("name".to_string());
+        let result = node.remove_attribute("name");
         assert!(result.is_err());
     }
 
     #[test]
-    fn test_remove_attribute() {
+    fn remove_attribute() {
         let mut attr = HashMap::new();
         attr.insert("key".to_string(), "value".to_string());
 
         let mut node = Node::new_element("name", attr.clone(), HTML_NAMESPACE);
 
-        if let Ok(_) = node.remove_attribute("key".to_string()) {
-            if let Ok(result) = node.contains_attribute("key".to_string()) {
-                assert_eq!(result, false);
-            }
-        }
+        assert!(node.remove_attribute("key").is_ok());
+        let result = node.contains_attribute("key").unwrap();
+        assert!(!result);
     }
 
     #[test]
-    fn test_get_attribute_non_element() {
+    fn get_attribute_non_element() {
         let node = Node::new_document();
-        let result = node.get_attribute("name".to_string());
+        let result = node.get_attribute("name");
         assert!(result.is_err());
     }
 
     #[test]
-    fn test_get_attribute() {
+    fn get_attribute() {
         let mut attr = HashMap::new();
         attr.insert("key".to_string(), "value".to_string());
 
         let node = Node::new_element("name", attr.clone(), HTML_NAMESPACE);
 
-        if let Ok(value) = node.get_attribute("key".to_string()) {
-            match value {
-                None => assert!(false),
-                Some(value_str) => assert_eq!(*value_str, "value".to_string()),
-            }
-        }
+        let value = node.get_attribute("key").unwrap().unwrap();
+        assert_eq!(value, "value");
     }
 
     #[test]
-    fn test_get_mut_attribute_non_element() {
+    fn get_mut_attribute_non_element() {
         let mut node = Node::new_document();
-        let result = node.get_mut_attribute("key".to_string());
+        let result = node.get_mut_attribute("key");
         assert!(result.is_err());
     }
 
     #[test]
-    fn test_get_mut_attribute() {
+    fn get_mut_attribute() {
         let mut attr = HashMap::new();
         attr.insert("key".to_string(), "value".to_string());
 
         let mut node = Node::new_element("name", attr.clone(), HTML_NAMESPACE);
 
-        if let Ok(value) = node.get_mut_attribute("key".to_string()) {
-            match value {
-                None => assert!(false),
-                Some(value_str) => (*value_str).push_str(" appended"),
-            }
+        let value = node.get_mut_attribute("key").unwrap().unwrap();
+        value.push_str(" appended");
 
-            if let Ok(value2) = node.get_attribute("key".to_string()) {
-                match value2 {
-                    None => assert!(false),
-                    Some(value_str) => assert_eq!(*value_str, "value appended"),
-                }
-            }
-        }
+        let value = node.get_attribute("key").unwrap().unwrap();
+        assert_eq!(value, "value appended");
     }
 
     #[test]
-    fn test_clear_attributes_non_element() {
+    fn clear_attributes_non_element() {
         let mut node = Node::new_document();
         let result = node.clear_attributes();
         assert!(result.is_err());
     }
 
     #[test]
-    fn test_clear_attributes() {
+    fn clear_attributes() {
         let mut attr = HashMap::new();
         attr.insert("key".to_string(), "value".to_string());
 
         let mut node = Node::new_element("name", attr.clone(), HTML_NAMESPACE);
-        if let Ok(_) = node.clear_attributes() {
-            assert_eq!(node.has_attributes(), false);
-        }
+        assert!(node.clear_attributes().is_ok());
+        assert!(!node.has_attributes());
     }
 
     #[test]
-    fn test_has_attributes_non_element() {
+    fn has_attributes_non_element() {
         // if node is a non-element, will always return false
         let node = Node::new_document();
-        assert_eq!(node.has_attributes(), false);
+        assert!(!node.has_attributes());
     }
 
     #[test]
-    fn test_has_attributes() {
+    fn has_attributes() {
         let attr = HashMap::new();
 
         let mut node = Node::new_element("name", attr.clone(), HTML_NAMESPACE);
         assert_eq!(node.has_attributes(), false);
 
-        if let Ok(_) = node.insert_attribute("key".to_string(), "value".to_string()) {
-            assert_eq!(node.has_attributes(), true);
-        }
+        assert!(node.insert_attribute("key", "value").is_ok());
+        assert!(node.has_attributes());
     }
 }
 
\ No newline at end of file diff --git a/src/gosub_engine/html5_parser/tokenizer/character_reference.rs.html b/src/gosub_engine/html5_parser/tokenizer/character_reference.rs.html index b307c9b2b..8cb83d382 100644 --- a/src/gosub_engine/html5_parser/tokenizer/character_reference.rs.html +++ b/src/gosub_engine/html5_parser/tokenizer/character_reference.rs.html @@ -517,12 +517,10 @@ macro_rules! consume_temp_buffer { ($self:expr, $as_attribute:expr) => { - for c in $self.temporary_buffer.clone() { - if $as_attribute { - $self.current_attr_value.push(c); - } else { - $self.consume(c); - } + if $as_attribute { + $self.current_attr_value.push_str(&$self.temporary_buffer); + } else { + $self.consumed.push_str(&$self.temporary_buffer); } $self.temporary_buffer.clear(); }; @@ -544,7 +542,8 @@ loop { match ccr_state { CcrState::CharacterReference => { - self.temporary_buffer = vec!['&']; + self.temporary_buffer.clear(); + self.temporary_buffer.push('&'); let c = read_char!(self); match c { @@ -793,8 +792,9 @@ } } - self.temporary_buffer = - vec![char::from_u32(char_ref_code).unwrap_or(CHAR_REPLACEMENT)]; + self.temporary_buffer.clear(); + let c = char::from_u32(char_ref_code).unwrap_or(CHAR_REPLACEMENT); + self.temporary_buffer.push(c); consume_temp_buffer!(self, as_attribute); return; diff --git a/src/gosub_engine/html5_parser/tokenizer/mod.rs.html b/src/gosub_engine/html5_parser/tokenizer/mod.rs.html index 2e02950b9..a8099339b 100644 --- a/src/gosub_engine/html5_parser/tokenizer/mod.rs.html +++ b/src/gosub_engine/html5_parser/tokenizer/mod.rs.html @@ -2326,48 +2326,6 @@ 2326 2327 2328 -2329 -2330 -2331 -2332 -2333 -2334 -2335 -2336 -2337 -2338 -2339 -2340 -2341 -2342 -2343 -2344 -2345 -2346 -2347 -2348 -2349 -2350 -2351 -2352 -2353 -2354 -2355 -2356 -2357 -2358 -2359 -2360 -2361 -2362 -2363 -2364 -2365 -2366 -2367 -2368 -2369 -2370
pub mod state;
 pub mod token;
 
@@ -2397,12 +2355,12 @@
 pub struct Tokenizer<'a> {
     pub stream: &'a mut InputStream, // HTML character input stream
     pub state: State,                // Current state of the tokenizer
-    pub consumed: Vec<char>,         // Current consumed characters for current token
+    pub consumed: String,            // Current consumed characters for current token
     pub current_attr_name: String, // Current attribute name that we need to store temporary in case we are parsing attributes
     pub current_attr_value: String, // Current attribute value that we need to store temporary in case we are parsing attributes
     pub current_attrs: HashMap<String, String>, // Current attributes
     pub current_token: Option<Token>, // Token that is currently in the making (if any)
-    pub temporary_buffer: Vec<char>, // Temporary buffer
+    pub temporary_buffer: String,   // Temporary buffer
     pub token_queue: Vec<Token>, // Queue of emitted tokens. Needed because we can generate multiple tokens during iteration
     pub last_start_token: String, // The last emitted start token (or empty if none)
     pub error_logger: Rc<RefCell<ErrorLogger>>, // Parse errors
@@ -2553,9 +2511,8 @@
 
         // If there is any consumed data, emit this first as a text token
         if $self.has_consumed_data() {
-            $self.token_queue.push(Token::TextToken {
-                value: $self.get_consumed_str(),
-            });
+            let value = $self.get_consumed_str().to_string();
+            $self.token_queue.push(Token::TextToken { value });
             $self.clear_consume_buffer();
         }
 
@@ -2576,13 +2533,13 @@
             last_start_token: opts
                 .as_ref()
                 .map_or(String::new(), |o| o.last_start_tag.clone()),
-            consumed: vec![],
+            consumed: String::new(),
             current_token: None,
             token_queue: vec![],
             current_attr_name: String::new(),
             current_attr_value: String::new(),
             current_attrs: HashMap::new(),
-            temporary_buffer: vec![],
+            temporary_buffer: String::new(),
             error_logger,
         };
     }
@@ -2833,7 +2790,7 @@
                     let c = read_char!(self);
                     match c {
                         Element::Utf8('/') => {
-                            self.temporary_buffer = vec![];
+                            self.temporary_buffer.clear();
                             self.state = State::RcDataEndTagOpenState;
                         }
                         _ => {
@@ -2898,8 +2855,7 @@
                         }
                         Element::Utf8('>') => {
                             if self.is_appropriate_end_token(&self.temporary_buffer) {
-                                let s: String = self.temporary_buffer.iter().collect::<String>();
-                                self.set_name_in_current_token(s);
+                                self.set_name_in_current_token(self.temporary_buffer.clone());
 
                                 self.last_start_token = String::new();
                                 emit_current_token!(self);
@@ -2920,22 +2876,14 @@
                     }
 
                     if consume_anything_else {
-                        self.consume('<');
-                        self.consume('/');
-                        for c in self.temporary_buffer.clone() {
-                            self.consume(c);
-                        }
-                        self.temporary_buffer.clear();
-
-                        self.stream.unread();
-                        self.state = State::RcDataState;
+                        self.transition_to(State::RcDataState);
                     }
                 }
                 State::RawTextLessThanSignState => {
                     let c = read_char!(self);
                     match c {
                         Element::Utf8('/') => {
-                            self.temporary_buffer = vec![];
+                            self.temporary_buffer.clear();
                             self.state = State::RawTextEndTagOpenState;
                         }
                         _ => {
@@ -3002,8 +2950,7 @@
                         }
                         Element::Utf8('>') => {
                             if self.is_appropriate_end_token(&self.temporary_buffer) {
-                                let s: String = self.temporary_buffer.iter().collect::<String>();
-                                self.set_name_in_current_token(s);
+                                self.set_name_in_current_token(self.temporary_buffer.clone());
                                 self.last_start_token = String::new();
                                 emit_current_token!(self);
                                 self.state = State::DataState;
@@ -3025,22 +2972,14 @@
                     }
 
                     if consume_anything_else {
-                        self.consume('<');
-                        self.consume('/');
-                        for c in self.temporary_buffer.clone() {
-                            self.consume(c);
-                        }
-                        self.temporary_buffer.clear();
-
-                        self.stream.unread();
-                        self.state = State::RawTextState;
+                        self.transition_to(State::RawTextState);
                     }
                 }
                 State::ScriptDataLessThenSignState => {
                     let c = read_char!(self);
                     match c {
                         Element::Utf8('/') => {
-                            self.temporary_buffer = vec![];
+                            self.temporary_buffer.clear();
                             self.state = State::ScriptDataEndTagOpenState;
                         }
                         Element::Utf8('!') => {
@@ -3107,8 +3046,7 @@
                         }
                         Element::Utf8('>') => {
                             if self.is_appropriate_end_token(&self.temporary_buffer) {
-                                let s: String = self.temporary_buffer.iter().collect::<String>();
-                                self.set_name_in_current_token(s);
+                                self.set_name_in_current_token(self.temporary_buffer.clone());
 
                                 self.last_start_token = String::new();
                                 emit_current_token!(self);
@@ -3129,15 +3067,7 @@
                     }
 
                     if consume_anything_else {
-                        self.consume('<');
-                        self.consume('/');
-                        for c in self.temporary_buffer.clone() {
-                            self.consume(c);
-                        }
-                        self.temporary_buffer.clear();
-
-                        self.stream.unread();
-                        self.state = State::ScriptDataState;
+                        self.transition_to(State::ScriptDataState);
                     }
                 }
                 State::ScriptDataEscapeStartState => {
@@ -3246,12 +3176,12 @@
                     let c = read_char!(self);
                     match c {
                         Element::Utf8('/') => {
-                            self.temporary_buffer = vec![];
+                            self.temporary_buffer.clear();
                             self.state = State::ScriptDataEscapedEndTagOpenState;
                         }
                         _ => {
                             if c.is_utf8() && c.utf8().is_ascii_alphabetic() {
-                                self.temporary_buffer = vec![];
+                                self.temporary_buffer.clear();
                                 self.consume('<');
                                 self.stream.unread();
                                 self.state = State::ScriptDataDoubleEscapeStartState;
@@ -3311,9 +3241,7 @@
                         }
                         Element::Utf8('>') => {
                             if self.is_appropriate_end_token(&self.temporary_buffer) {
-                                let s: String = self.temporary_buffer.iter().collect::<String>();
-                                self.set_name_in_current_token(s);
-
+                                self.set_name_in_current_token(self.temporary_buffer.clone());
                                 self.last_start_token = String::new();
                                 emit_current_token!(self);
                                 self.state = State::DataState;
@@ -3333,15 +3261,7 @@
                     }
 
                     if consume_anything_else {
-                        self.consume('<');
-                        self.consume('/');
-                        for c in self.temporary_buffer.clone() {
-                            self.consume(c);
-                        }
-                        self.temporary_buffer.clear();
-
-                        self.stream.unread();
-                        self.state = State::ScriptDataEscapedState;
+                        self.transition_to(State::ScriptDataEscapedState);
                     }
                 }
                 State::ScriptDataDoubleEscapeStartState => {
@@ -3353,12 +3273,7 @@
                         | Element::Utf8(CHAR_SPACE)
                         | Element::Utf8('/')
                         | Element::Utf8('>') => {
-                            if self
-                                .temporary_buffer
-                                .iter()
-                                .collect::<String>()
-                                .eq("script")
-                            {
+                            if self.temporary_buffer == "script" {
                                 self.state = State::ScriptDataDoubleEscapedState;
                             } else {
                                 self.state = State::ScriptDataEscapedState;
@@ -3458,7 +3373,7 @@
                     let c = read_char!(self);
                     match c {
                         Element::Utf8('/') => {
-                            self.temporary_buffer = vec![];
+                            self.temporary_buffer.clear();
                             self.consume('/');
                             self.state = State::ScriptDataDoubleEscapeEndState;
                         }
@@ -3477,12 +3392,7 @@
                         | Element::Utf8(CHAR_SPACE)
                         | Element::Utf8('/')
                         | Element::Utf8('>') => {
-                            if self
-                                .temporary_buffer
-                                .iter()
-                                .collect::<String>()
-                                .eq("script")
-                            {
+                            if self.temporary_buffer == "script" {
                                 self.state = State::ScriptDataEscapedState;
                             } else {
                                 self.state = State::ScriptDataDoubleEscapedState;
@@ -4611,23 +4521,29 @@
         self.consumed.push(c)
     }
 
+    fn transition_to(&mut self, state: State) {
+        self.consumed.push_str("</");
+        self.consumed.push_str(&self.temporary_buffer);
+        self.temporary_buffer.clear();
+        self.stream.unread();
+        self.state = state;
+    }
+
     // Consumes the given string
-    pub(crate) fn consume_string(&mut self, s: &str) {
-        // Add c to the current token data
-        for c in s.chars() {
-            self.consumed.push(c)
-        }
+    pub(crate) fn consume_str(&mut self, s: &str) {
+        // Add s to the current token data
+        self.consumed.push_str(s);
     }
 
-    // Return true when the given end_token matches the stored start token (ie: 'table' matches when last_start_token = 'table')
-    fn is_appropriate_end_token(&self, end_token: &[char]) -> bool {
-        let s: String = end_token.iter().collect();
-        self.last_start_token == s
+    // Return true when the given end_token matches the stored start token (ie: 'table' matches when
+    // last_start_token = 'table')
+    fn is_appropriate_end_token(&self, end_token: &str) -> bool {
+        self.last_start_token == end_token
     }
 
     // Return the consumed string as a String
-    pub fn get_consumed_str(&self) -> String {
-        return self.consumed.iter().collect();
+    pub fn get_consumed_str(&self) -> &str {
+        &self.consumed
     }
 
     // Returns true if there is anything in the consume buffer
@@ -4674,9 +4590,9 @@
     }
 
     // Adds a new attribute to the current token
-    fn set_add_attribute_to_current_token(&mut self, name: String, value: String) {
+    fn set_add_attribute_to_current_token(&mut self, name: &str, value: &str) {
         if let Token::StartTagToken { attributes, .. } = &mut self.current_token.as_mut().unwrap() {
-            attributes.insert(name.clone(), value.clone());
+            attributes.insert(name.into(), value.into());
         }
 
         self.current_attr_name.clear()
@@ -4686,10 +4602,10 @@
     fn set_name_in_current_token(&mut self, new_name: String) {
         match &mut self.current_token.as_mut().unwrap() {
             Token::StartTagToken { name, .. } => {
-                *name = new_name.clone();
+                *name = new_name;
             }
             Token::EndTagToken { name, .. } => {
-                *name = new_name.clone();
+                *name = new_name;
             }
             _ => panic!("trying to set the name of a non start/end tag token"),
         }