Skip to main content

Builder

Struct Builder 

Source
struct Builder {
Show 23 fields nodes: Vec<N>, open: Vec<usize>, afe: Vec<Afe>, template_modes: Vec<Mode>, mode: Mode, original_mode: Mode, head_ptr: Option<usize>, form_ptr: Option<usize>, frameset_ok: bool, foster: bool, quirks: bool, scripting: bool, skip_lf: bool, pending_table: Vec<String>, context: Option<usize>, stopped: bool, new_state: Option<State>, count: usize, depth_capped: usize, implicit: BTreeSet<usize>, keep_implicit: bool, has_selectedcontent: bool, template_fs: Vec<bool>,
}

Fields§

§nodes: Vec<N>§open: Vec<usize>§afe: Vec<Afe>§template_modes: Vec<Mode>§mode: Mode§original_mode: Mode§head_ptr: Option<usize>§form_ptr: Option<usize>§frameset_ok: bool§foster: bool§quirks: bool§scripting: bool§skip_lf: bool§pending_table: Vec<String>§context: Option<usize>§stopped: bool§new_state: Option<State>§count: usize§depth_capped: usize§implicit: BTreeSet<usize>

ソースに書かれていないのに補った head / body(ブラウザ用の変換で、keep_implicit が偽ならこの殻を外す)。

§keep_implicit: bool

補った head / body の殻を木に残すか(文書の解析は残す。innerHTML 等の断片を文書として解析する経路は外す)。

§has_selectedcontent: bool

template を開いた時点の frameset-ok(template を閉じるとき戻す。中の文字で「不可」にならないようにする)。

§template_fs: Vec<bool>

Implementations§

Source§

impl Builder

Source

fn new() -> Self

Source

fn fix_selectedcontent(&mut self)

selectedcontent に、親の select の選ばれた option(最後の selected、無ければ最初)の中身を複製して入れる (HTML「clone an option into a selectedcontent」。構文解析のおわりに 1 回)。selectedcontent が無い文書では呼ばない。

Source

fn clone_subtree(&mut self, i: usize) -> usize

Source

fn nm(&self, i: usize) -> &str

Source

fn ns_of(&self, i: usize) -> u8

Source

fn is(&self, i: usize, name: &str) -> bool

Source

fn is_any(&self, i: usize, names: &[&str]) -> bool

Source

fn is_special(&self, i: usize) -> bool

Source

fn cur(&self) -> Option<usize>

Source

fn cur_is(&self, name: &str) -> bool

Source

fn cur_any(&self, names: &[&str]) -> bool

Source

fn adjusted_current(&self) -> Option<usize>

Source

fn attr_of(&self, i: usize, key: &str) -> Option<&str>

Source

fn new_el(&mut self, name: &str, ns: u8, attrs: Vec<(String, String)>) -> usize

Source

fn detach(&mut self, child: usize)

Source

fn place(&mut self, parent: usize, before: Option<usize>, child: usize)

parent の子として before の直前(None なら末尾)に付ける。

Source

fn appropriate_place( &self, override_target: Option<usize>, ) -> (usize, Option<usize>)

§13.2.6.1 「適切な挿入位置」。(親, 直前に置く兄弟)。

Source

fn insert_text_at(&mut self, parent: usize, before: Option<usize>, s: &str)

Source

fn insert_text(&mut self, s: &str)

Source

fn insert_comment(&mut self, kind: Kind)

コメント・処理命令(kind)を「適切な挿入位置」に置く。

Source

fn insert_comment_at(&mut self, p: usize, b: Option<usize>, kind: Kind)

Source

fn insert_el_nopush( &mut self, name: &str, ns: u8, attrs: Vec<(String, String)>, ) -> usize

Source

fn insert_el( &mut self, name: &str, ns: u8, attrs: Vec<(String, String)>, ) -> usize

Source

fn insert_implicit(&mut self, name: &str) -> usize

開始タグなしで補う head / body。

Source

fn insert_html(&mut self, t: &Tag) -> usize

Source

fn insert_void(&mut self, t: &Tag)

開始タグを入れてすぐ閉じる(void 要素)。

Source

fn pop_until(&mut self, name: &str)

Source

fn pop_until_any(&mut self, names: &[&str])

Source

fn has_template(&self) -> bool

Source

fn has_template_or_context(&self) -> bool

has_template に、断片の文脈要素が template の場合を足したもの(本文の <form> の入れ子だけ、html5lib の期待に合わせる)。

Source

fn in_scope_any(&self, names: &[&str], kind: Scope) -> bool

Source

fn in_scope(&self, name: &str, kind: Scope) -> bool

Source

fn in_scope_idx(&self, target: usize) -> bool

Source

fn generate_implied(&mut self, except: Option<&str>, thorough: bool)

Source

fn close_p(&mut self)

Source

fn close_p_if_button_scope(&mut self)

Source

fn clear_to_context(&mut self, names: &[&str])

Source

fn afe_pos_of(&self, el: usize) -> Option<usize>

Source

fn afe_find_after_marker(&self, name: &str) -> Option<(usize, usize)>

Source

fn clone_spec(&self, i: usize) -> (String, Vec<(String, String)>)

Source

fn push_afe(&mut self, el: usize)

Source

fn clear_afe_to_marker(&mut self)

Source

fn reconstruct_afe(&mut self)

Source

fn adoption(&mut self, subject: &str) -> bool

§13.2.6.4.7 の養子縁組アルゴリズム。false は「その他の終了タグとして処理せよ」。

Source

fn reset_mode(&mut self)

Source

fn is_mathml_text_integration(&self, i: usize) -> bool

Source

fn is_html_integration(&self, i: usize) -> bool

Source

fn use_html_rules( &self, start_name: Option<&str>, is_chars: bool, is_eof: bool, ) -> bool

§13.2.6 の分岐: 今のトークンを HTML の規則(挿入モード)で扱うか。

Source

fn chars(&mut self, s: &str)

Source

fn chars_group(&mut self, cls: Class, g: &str)

Source

fn chars_body(&mut self, cls: Class, g: &str)

Source

fn flush_table_text(&mut self)

Source

fn comment(&mut self, kind: Kind)

コメントトークン、および処理命令トークン(どの挿入モードでもコメントと同じ位置に入る)。 kind は Kind::Comment か Kind::Pi。

Source

fn doctype( &mut self, name: Option<String>, public_id: Option<String>, system_id: Option<String>, force: bool, )

Source

fn start_tag(&mut self, t: Tag)

Source

fn end_tag(&mut self, name: String)

Source

fn eof(&mut self)

Source

fn eof_mode(&mut self, m: Mode) -> bool

EOF を挿入モード m で扱う。モードを変えて再処理するなら true。

Source

fn generic_text(&mut self, t: &Tag, state: State)

Source

fn add_missing_attrs(&mut self, target: usize, attrs: &[(String, String)])

Source

fn start(&mut self, mode: Mode, t: &Tag)

Source

fn close_caption(&mut self)

Source

fn close_cell(&mut self)

Source

fn start_table(&mut self, t: &Tag)

Source

fn start_body(&mut self, t: &Tag)

Source

fn end(&mut self, mode: Mode, name: &str)

Source

fn end_template(&mut self)

Source

fn any_other_end(&mut self, name: &str)

Source

fn end_body(&mut self, name: &str)

Source

fn foreign_start(&mut self, t: Tag)

Source

fn foreign_end(&mut self, name: &str)

Source

fn flat_children(&self, parent: usize, compat: bool) -> Vec<usize>

parent の子の番号を並べる。ブラウザ用(compat)では、補った head / body の殻は外して中身を直接並べる。 殻の入れ子も明示のスタックでたどる(再帰しない)。

Source

fn element_shell_ordered( &self, name: &str, ns: u8, attrs: &[(String, String)], compat: bool, ) -> (Node, Vec<String>)

要素 i の、子を持たない Node と属性名順を作る(名前・属性だけ)。

Source

fn to_node_ordered( &self, root: usize, compat: bool, in_pre: bool, ) -> Option<(Node, AttrOrderNode)>

配列の木を Node の木と属性順の木へ変換する。深い木(MAX_DOM_DEPTH 近く)でもスタックを使い切らないよう、 再帰せず明示のスタックで後順にたどる(2026-11-19。デバッグビルドの試験で再帰版がスタックあふれした)。

Source

fn to_node(&self, root: usize, compat: bool, in_pre: bool) -> Option<Node>

Source

fn leaf_node( &self, c: usize, compat: bool, in_pre: bool, parent_name: &str, in_doc: bool, ) -> Option<Node>

要素以外のノード(文字・コメント・DOCTYPE)を変換する。in_doc は親が #document(文字を整形しない)。

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.