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: booltemplate を開いた時点の frameset-ok(template を閉じるとき戻す。中の文字で「不可」にならないようにする)。
template_fs: Vec<bool>Implementations§
Source§impl Builder
impl Builder
fn new() -> Self
Sourcefn fix_selectedcontent(&mut self)
fn fix_selectedcontent(&mut self)
selectedcontent に、親の select の選ばれた option(最後の selected、無ければ最初)の中身を複製して入れる
(HTML「clone an option into a selectedcontent」。構文解析のおわりに 1 回)。selectedcontent が無い文書では呼ばない。
fn clone_subtree(&mut self, i: usize) -> usize
fn nm(&self, i: usize) -> &str
fn ns_of(&self, i: usize) -> u8
fn is(&self, i: usize, name: &str) -> bool
fn is_any(&self, i: usize, names: &[&str]) -> bool
fn is_special(&self, i: usize) -> bool
fn cur(&self) -> Option<usize>
fn cur_is(&self, name: &str) -> bool
fn cur_any(&self, names: &[&str]) -> bool
fn adjusted_current(&self) -> Option<usize>
fn attr_of(&self, i: usize, key: &str) -> Option<&str>
fn new_el(&mut self, name: &str, ns: u8, attrs: Vec<(String, String)>) -> usize
fn detach(&mut self, child: usize)
Sourcefn place(&mut self, parent: usize, before: Option<usize>, child: usize)
fn place(&mut self, parent: usize, before: Option<usize>, child: usize)
parent の子として before の直前(None なら末尾)に付ける。
Sourcefn appropriate_place(
&self,
override_target: Option<usize>,
) -> (usize, Option<usize>)
fn appropriate_place( &self, override_target: Option<usize>, ) -> (usize, Option<usize>)
§13.2.6.1 「適切な挿入位置」。(親, 直前に置く兄弟)。
fn insert_text_at(&mut self, parent: usize, before: Option<usize>, s: &str)
fn insert_text(&mut self, s: &str)
Sourcefn insert_comment(&mut self, kind: Kind)
fn insert_comment(&mut self, kind: Kind)
コメント・処理命令(kind)を「適切な挿入位置」に置く。
fn insert_comment_at(&mut self, p: usize, b: Option<usize>, kind: Kind)
fn insert_el_nopush( &mut self, name: &str, ns: u8, attrs: Vec<(String, String)>, ) -> usize
fn insert_el( &mut self, name: &str, ns: u8, attrs: Vec<(String, String)>, ) -> usize
Sourcefn insert_implicit(&mut self, name: &str) -> usize
fn insert_implicit(&mut self, name: &str) -> usize
開始タグなしで補う head / body。
fn insert_html(&mut self, t: &Tag) -> usize
Sourcefn insert_void(&mut self, t: &Tag)
fn insert_void(&mut self, t: &Tag)
開始タグを入れてすぐ閉じる(void 要素)。
fn pop_until(&mut self, name: &str)
fn pop_until_any(&mut self, names: &[&str])
fn has_template(&self) -> bool
Sourcefn has_template_or_context(&self) -> bool
fn has_template_or_context(&self) -> bool
has_template に、断片の文脈要素が template の場合を足したもの(本文の <form> の入れ子だけ、html5lib の期待に合わせる)。
fn in_scope_any(&self, names: &[&str], kind: Scope) -> bool
fn in_scope(&self, name: &str, kind: Scope) -> bool
fn in_scope_idx(&self, target: usize) -> bool
fn generate_implied(&mut self, except: Option<&str>, thorough: bool)
fn close_p(&mut self)
fn clear_to_context(&mut self, names: &[&str])
fn afe_pos_of(&self, el: usize) -> Option<usize>
fn afe_find_after_marker(&self, name: &str) -> Option<(usize, usize)>
fn clone_spec(&self, i: usize) -> (String, Vec<(String, String)>)
fn push_afe(&mut self, el: usize)
fn clear_afe_to_marker(&mut self)
fn reconstruct_afe(&mut self)
Sourcefn adoption(&mut self, subject: &str) -> bool
fn adoption(&mut self, subject: &str) -> bool
§13.2.6.4.7 の養子縁組アルゴリズム。false は「その他の終了タグとして処理せよ」。
fn reset_mode(&mut self)
fn is_mathml_text_integration(&self, i: usize) -> bool
fn is_html_integration(&self, i: usize) -> bool
Sourcefn use_html_rules(
&self,
start_name: Option<&str>,
is_chars: bool,
is_eof: bool,
) -> bool
fn use_html_rules( &self, start_name: Option<&str>, is_chars: bool, is_eof: bool, ) -> bool
§13.2.6 の分岐: 今のトークンを HTML の規則(挿入モード)で扱うか。
fn chars(&mut self, s: &str)
fn chars_group(&mut self, cls: Class, g: &str)
fn chars_body(&mut self, cls: Class, g: &str)
fn flush_table_text(&mut self)
Sourcefn comment(&mut self, kind: Kind)
fn comment(&mut self, kind: Kind)
コメントトークン、および処理命令トークン(どの挿入モードでもコメントと同じ位置に入る)。
kind は Kind::Comment か Kind::Pi。
fn doctype( &mut self, name: Option<String>, public_id: Option<String>, system_id: Option<String>, force: bool, )
fn start_tag(&mut self, t: Tag)
fn end_tag(&mut self, name: String)
fn eof(&mut self)
fn generic_text(&mut self, t: &Tag, state: State)
fn add_missing_attrs(&mut self, target: usize, attrs: &[(String, String)])
fn start(&mut self, mode: Mode, t: &Tag)
fn close_caption(&mut self)
fn close_cell(&mut self)
fn start_table(&mut self, t: &Tag)
fn start_body(&mut self, t: &Tag)
fn end(&mut self, mode: Mode, name: &str)
fn end_template(&mut self)
fn any_other_end(&mut self, name: &str)
fn end_body(&mut self, name: &str)
fn foreign_start(&mut self, t: Tag)
fn foreign_end(&mut self, name: &str)
Sourcefn flat_children(&self, parent: usize, compat: bool) -> Vec<usize>
fn flat_children(&self, parent: usize, compat: bool) -> Vec<usize>
parent の子の番号を並べる。ブラウザ用(compat)では、補った head / body の殻は外して中身を直接並べる。
殻の入れ子も明示のスタックでたどる(再帰しない)。
Sourcefn element_shell_ordered(
&self,
name: &str,
ns: u8,
attrs: &[(String, String)],
compat: bool,
) -> (Node, Vec<String>)
fn element_shell_ordered( &self, name: &str, ns: u8, attrs: &[(String, String)], compat: bool, ) -> (Node, Vec<String>)
要素 i の、子を持たない Node と属性名順を作る(名前・属性だけ)。
Sourcefn to_node_ordered(
&self,
root: usize,
compat: bool,
in_pre: bool,
) -> Option<(Node, AttrOrderNode)>
fn to_node_ordered( &self, root: usize, compat: bool, in_pre: bool, ) -> Option<(Node, AttrOrderNode)>
配列の木を Node の木と属性順の木へ変換する。深い木(MAX_DOM_DEPTH 近く)でもスタックを使い切らないよう、
再帰せず明示のスタックで後順にたどる(2026-11-19。デバッグビルドの試験で再帰版がスタックあふれした)。