Skip to main content

WebEngine

Struct WebEngine 

Source
pub struct WebEngine {
Show 79 fields pub engine_id: u64, pub active: bool, pub current_is_https: bool, pub current_host: String, pub current_path: String, pub current_url_with_hash: String, pub title: String, pub scroll_y: i32, pub max_scroll_y: i32, pub scroll_smooth: bool, pub scrollbar_width_none: bool, pub scroll_anim_active: bool, pub scroll_anim_from: i32, pub scroll_anim_to: i32, pub scroll_anim_start_ms: f32, pub pending_fragment: String, pub elements: Vec<RenderElement>, pub dirty_reason: &'static str, pub links: Vec<HyperlinkArea>, pub history: Vec<(bool, String, String)>, pub forward_history: Vec<(bool, String, String)>, pub dirty: bool, pub form_values: BTreeMap<String, String>, pub initial_form_values: BTreeMap<String, String>, pub field_names: BTreeMap<String, String>, pub dom_contents: BTreeMap<String, String>, pub executing_script: bool, pub dom_needs_rebuild: bool, pub pending_reflow_since: usize, pub pending_reflow_last: usize, pub focused_id: Option<String>, pub focus_value: String, pub hovered_id: Option<String>, pub cursor_pos: usize, pub env: Env, pub js_runtime: JsRuntime, pub video_playing: bool, pub video_tick: u32, pub background_image_urls: BTreeSet<String>, pub loading: bool, pub loading_tick: u32, pub mouse_x: i32, pub mouse_y: i32, pub hovered_cursor_is_text: bool, pub hovered_cursor_kind: String, pub prev_btn_left: bool, pub mouse_btn_left_down: bool, pub prev_btn_right: bool, pub last_click_id: Option<String>, pub last_click_tick: usize, pub win_w: u32, pub win_h: u32, pub top_offset: i32, pub editor_wrap: bool, pub editor_scroll_y: i32, pub editor_scroll_x: i32, pub last_html: String, pub dragging_scrollbar: bool, pub image_cache: BTreeMap<String, Arc<DecodedImage>>, pub image_attempted: BTreeSet<String>, pub active_text_box: Option<TextBox>, pub focus_cursor_pos: usize, pub focus_caret_owner: String, pub page_bg_color: Option<u32>, pub page_text_color: Option<u32>, pub anim_engine: AnimationEngine, pub anim_specs: BTreeMap<String, (String, String)>, pub anim_prev_values: BTreeMap<String, BTreeMap<String, String>>, pub in_anim_relayout: bool, pub inherited_paint_z: i32, pub inherited_paint_depth: u32, pub last_anim_layout_ms: f32, pub last_anim_relayout_end_ms: f32, pub scroll_regions: BTreeMap<String, i32>, pub dragging_sub_scrollbar: Option<String>, pub scroll_containers: Vec<(String, i32, i32, i32, i32, i32)>, pub cached_css_key: String, pub cached_stylesheet: Option<StyleSheet>, pub external_css_cache: Option<String>,
}

Fields§

§engine_id: u64

このエンジン(タブ)の一意 ID。非同期ロードの結果分離に使う。

§active: bool§current_is_https: bool§current_host: String§current_path: String§current_url_with_hash: String

現在ページの完全URL(フラグメント #hash を含む)。アンカーナビの hashchange 発火で oldURL/newURL を組み立てる基準として使う。

§title: String§scroll_y: i32§max_scroll_y: i32§scroll_smooth: bool

html{scroll-behavior:smooth} が指定されているか(ルート要素の算出値から判定)。 アンカー/フラグメントナビゲーションのスクロールのみを対象とし、ホイール/スクロール バードラッグは対象外(実ブラウザでも scrollIntoView/アンカー遷移のみが対象)。

§scrollbar_width_none: bool

html{scrollbar-width:none}(CSS Scrollbars Module Level 1。ルート要素の 算出値から判定する簡略実装で、scroll-behavior:smoothと同じ方式)。 thin/autoは見た目の太さの違いを描画で区別する手段が無いため 両方とも通常描画(既定太さ)にフォールバックし、noneのみを 「非表示」として扱う。丸ごと未対応だった。2026-07-18 発見・実装。

§scroll_anim_active: bool

スムーススクロール進行中かどうか。

§scroll_anim_from: i32§scroll_anim_to: i32§scroll_anim_start_ms: f32§pending_fragment: String

【2026-08-03】URL のフラグメント(#id)。レイアウト完了後に 対象要素までスクロールするために保持する。適用したら空にする。

§elements: Vec<RenderElement>§dirty_reason: &'static str

【2026-08-01計測】dirty を最後に立てた箇所(ファイル:行)。 再描画が毎フレーム走る原因を特定するため。

§links: Vec<HyperlinkArea>§history: Vec<(bool, String, String)>§forward_history: Vec<(bool, String, String)>§dirty: bool§form_values: BTreeMap<String, String>§initial_form_values: BTreeMap<String, String>

element_id → HTML 由来の初期値。フォーム reset でこの値へ戻す。

§field_names: BTreeMap<String, String>

element_id → input の name 属性。フォーム送信時のパラメータ名に使う。

§dom_contents: BTreeMap<String, String>§executing_script: bool§dom_needs_rebuild: bool

次の parse_and_layout で DOM ブリッジを再構築するか(新ページ読込時に true)。

§pending_reflow_since: usize

リソース到着による再レイアウトを溜めておく(0 なら保留なし)。

【2026-08-05】フォントは 4 並列で 1 本ずつ届くため、 到着のたびに再レイアウトすると1 回 4.6 秒をその回数だけ払う。 実測では 100 フレーム中 5972 tick(全体の 44%)が draw() 内の再レイアウトだった。 少し待ってまとめて 1 回にする。値は最初の到着時刻(tick)。

§pending_reflow_last: usize

直近の到着時刻(tick)。これが止まったらまとめて実行する。

§focused_id: Option<String>§focus_value: String

フォーカス取得時の入力値(blur 時の change 判定用)。

§hovered_id: Option<String>

現在マウスが乗っている要素 id(mouseover/mouseout 判定用)。

§cursor_pos: usize§env: Env§js_runtime: JsRuntime

組込み JavaScript ランタイム(