pub struct RenderElement {Show 159 fields
pub text: String,
pub font_size: u32,
pub color: u32,
pub bg_color: Option<u32>,
pub hover_bg_color: Option<u32>,
pub hover_color: Option<u32>,
pub hover_border_color: Option<u32>,
pub focus_bg_color: Option<u32>,
pub focus_color: Option<u32>,
pub focus_border_color: Option<u32>,
pub active_bg_color: Option<u32>,
pub active_color: Option<u32>,
pub active_border_color: Option<u32>,
pub marker_color: Option<u32>,
pub marker_font_size: Option<u32>,
pub marker_content: Option<String>,
pub border_color: Option<u32>,
pub border_style: BorderStyle,
pub font_bold: bool,
pub font_italic: bool,
pub underline: bool,
pub line_through: bool,
pub overline: bool,
pub decoration_color: Option<u32>,
pub decoration_style: String,
pub decoration_thickness: i32,
pub decoration_underline_offset: i32,
pub scroll_margin_top: i32,
pub client_insets: Option<(i32, i32, i32, i32)>,
pub caret_color: Option<u32>,
pub accent_color: Option<u32>,
pub placeholder_color: Option<u32>,
pub placeholder: String,
pub is_video: bool,
pub video_src: String,
pub is_link: bool,
pub pointer_events_none: bool,
pub href: String,
pub is_hr: bool,
pub is_img: bool,
pub img_alt: String,
pub canvas_ctx_id: Option<u32>,
pub aspect_ratio: Option<f32>,
pub is_input: bool,
pub is_textarea: bool,
pub is_button: bool,
pub is_reset: bool,
pub input_kind: u8,
pub radio_group: String,
pub input_value: String,
pub select_options: Vec<(String, String)>,
pub label_for: String,
pub button_icon: u8,
pub element_id: String,
pub onclick: String,
pub form_action: String,
pub form_method: String,
pub width: i32,
pub x_offset: i32,
pub y_offset: i32,
pub height: i32,
pub border_radius: (i32, i32, i32, i32),
pub is_li: bool,
pub li_num: Option<u32>,
pub list_style_type: ListStyleType,
pub list_style_inside: bool,
pub list_style_image: String,
pub is_blockquote: bool,
pub border_top_width: i32,
pub border_right_width: i32,
pub border_bottom_width: i32,
pub border_left_width: i32,
pub border_top_color: Option<u32>,
pub border_right_color: Option<u32>,
pub border_bottom_color: Option<u32>,
pub border_left_color: Option<u32>,
pub border_top_style: BorderStyle,
pub border_right_style: BorderStyle,
pub border_bottom_style: BorderStyle,
pub border_left_style: BorderStyle,
pub padding_top: i32,
pub padding_right: i32,
pub padding_bottom: i32,
pub padding_left: i32,
pub bg_clip: String,
pub bg_origin: String,
pub bg_attachment: String,
pub bg_image: Option<String>,
pub bg_images: Vec<String>,
pub background_blend_mode: String,
pub bg_layers: Vec<(BgSizeMode, BgRepeatMode, BgRepeatMode, f32, f32)>,
pub pos_top: Option<i32>,
pub pos_left: Option<i32>,
pub pos_right: Option<i32>,
pub pos_bottom: Option<i32>,
pub z_index: i32,
pub paint_depth: u32,
pub is_fixed: bool,
pub overflow_hidden: bool,
pub clip_x0: i32,
pub clip_y0: i32,
pub clip_x1: i32,
pub clip_y1: i32,
pub box_shadow: Vec<(i32, i32, i32, u32, bool)>,
pub white_space_nowrap: bool,
pub text_overflow_ellipsis: bool,
pub text_overflow_rtl: bool,
pub linear_gradient: Option<LinearGradient>,
pub radial_gradient: Option<RadialGradient>,
pub conic_gradient: Option<Vec<GradientStop>>,
pub repeating_linear_gradient: Option<(Vec<u32>, i32, bool)>,
pub repeating_radial_gradient: Option<(Vec<u32>, i32)>,
pub opacity: u8,
pub visibility_hidden: bool,
pub text_shadow: Vec<(i32, i32, i32, u32)>,
pub before_content: String,
pub after_content: String,
pub font_family: String,
pub before_font_family: String,
pub transform_tx: i32,
pub transform_ty: i32,
pub transform_scale_x: f32,
pub transform_scale_y: f32,
pub transform_rotate_deg: f32,
pub transform_skew_x: f32,
pub transform_skew_y: f32,
pub transform_origin_x: f32,
pub transform_origin_y: f32,
pub letter_spacing: i32,
pub word_spacing: i32,
pub text_emphasis_style: String,
pub text_emphasis_color: Option<u32>,
pub cursor_style: String,
pub scroll_container_id: String,
pub clip_path: String,
pub is_sticky: bool,
pub sticky_top: Option<i32>,
pub sticky_bottom: Option<i32>,
pub sticky_bound_max_y: i32,
pub bg_size: BgSizeMode,
pub bg_repeat_x: BgRepeatMode,
pub bg_repeat_y: BgRepeatMode,
pub bg_pos_x: f32,
pub bg_pos_y: f32,
pub outline_color: Option<u32>,
pub outline_width: i32,
pub outline_offset: i32,
pub outline_style: String,
pub object_fit: ObjectFit,
pub object_pos_x: f32,
pub object_pos_y: f32,
pub filter: String,
pub mix_blend_mode: String,
pub backdrop_filter: String,
pub image_rendering: String,
pub text_stroke_width: i32,
pub text_stroke_color: Option<u32>,
pub line_clamp: i32,
pub node_idx: Option<usize>,
}Fields§
§text: String§font_size: u32§color: u32§bg_color: Option<u32>§hover_bg_color: Option<u32>§hover_color: Option<u32>§hover_border_color: Option<u32>§focus_bg_color: Option<u32>:focus 時の算出値差分(hover 系と同じ仕組み。実際の適用可否は 描画側で focused_id と element_id の一致を見て選ぶ)。
focus_color: Option<u32>§focus_border_color: Option<u32>§active_bg_color: Option<u32>:active 時の算出値差分(hover/focus 系と同じ仕組み。実際の適用可否は 描画側で「ホバー中 かつ マウス左ボタン押下中」を見て選ぶ)。
active_color: Option<u32>§active_border_color: Option<u32>§marker_color: Option<u32>::marker{color:...} による箇条書き/番号マーカーの色上書き(無指定なら color を継承)。
marker_font_size: Option<u32>::marker{font-size:...} によるマーカーのフォントサイズ上書き(無指定なら周囲のサイズを継承)。
marker_content: Option<String>::marker{content:...} によるマーカー文字列そのものの上書き(無指定なら
list-style-type から導出した既定の記号/番号を使う)。
border_color: Option<u32>§border_style: BorderStyle§font_bold: bool§font_italic: bool§underline: bool§line_through: bool§overline: bool§decoration_color: Option<u32>text-decoration-color(未指定なら文字色を使う)。
decoration_style: Stringtext-decoration-style(solid/dotted/dashed/wavy/double、既定 solid)。
decoration_thickness: i32text-decoration-thickness(px。auto/未指定は1px相当)。
decoration_underline_offset: i32text-underline-offset(px。underline のみに適用、0/負値も可。auto/未指定は0)。
scroll_margin_top: i32scroll-margin-top(px。アンカー/フラグメントナビゲーションのスクロール位置から
この分だけ引く。固定ヘッダーの下にターゲットが隠れないようにする用途)。
client_insets: Option<(i32, i32, i32, i32)>§caret_color: Option<u32>caret-color(テキスト入力のキャレット色。未指定なら IME 状態に応じた既定色を使う)。
accent_color: Option<u32>accent-color(checkbox/radio のチェック時の塗り色。未指定ならテーマ既定色を使う)。
placeholder_color: Option<u32>::placeholder{color:...}(合成プロパティ x-placeholder-color 経由)。
未指定ならテーマの薄色(editor_dim_fg)を使う。
placeholder: String<input>/<textarea> の placeholder 属性(値が空のときだけ薄色で表示する)。
is_video: bool§video_src: String§is_link: bool§pointer_events_none: boolpointer-events:none — true ならこの要素はクリック/ホバー判定の対象から除外する
(リンク登録をスキップする簡略実装。子孫への pointer-events:auto による
個別復元は非対応)。
href: String§is_hr: bool§is_img: bool§img_alt: String§canvas_ctx_id: Option<u32><canvas> の 2D コンテキスト id(os_lib/canvas2d の registry)。
JS が描いた内容はその registry の Surface にあり、ここに id が
入っていれば描画時に要素の矩形へ転送する。None なら canvas 以外か、
まだ getContext("2d") が呼ばれていない。
aspect_ratio: Option<f32>aspect-ratio(CSS Box Sizing Level 4。幅と高さの比率 width / height)。
is_input: bool§is_textarea: bool§is_reset: booltype=reset のボタンか。クリックで所属 form を初期値へ戻す(送信しない)。
input_kind: u8入力種別: 0=テキスト, 1=checkbox, 2=radio, 3=select。 checkbox/radio/select は is_input=false(テキスト編集対象ではない)として扱い、 クリックでトグル/循環し change イベントを発火する。
radio_group: Stringradio のグループ名(name 属性)。同一グループ内で1つだけ checked になる。
input_value: Stringradio/checkbox の value 属性(送信値・radio選択値)。
select_options: Vec<(String, String)>select の選択肢 (value, ラベル) 一覧。input_kind==3 のときのみ有効。
label_for: Stringelement_id: String§onclick: String§form_action: String§form_method: String§width: i32§x_offset: i32§y_offset: i32§height: i32§border_radius: (i32, i32, i32, i32)§is_li: bool§li_num: Option<u32>§list_style_type: ListStyleType§list_style_inside: boollist-style-position: inside なら true(マーカーを content 内で本文の直前に描画)。
list_style_image: Stringlist-style-image: url(...)(list-style ショートハンド内の url() も含む)で
解決された画像パス。空文字なら未指定(従来通り list_style_type のグリフを使う)。
is_blockquote: bool§border_top_width: i32§border_right_width: i32§border_bottom_width: i32§border_left_width: i32§border_top_color: Option<u32>§border_right_color: Option<u32>§border_bottom_color: Option<u32>§border_left_color: Option<u32>§border_top_style: BorderStyle§border_right_style: BorderStyle§border_bottom_style: BorderStyle§border_left_style: BorderStyle§padding_top: i32§padding_right: i32§padding_bottom: i32§padding_left: i32§bg_clip: Stringbackground-clip/background-origin("border-box"/"padding-box"/"content-box")。
background-clip: text は非対応で border-box にフォールバック。
bg_origin: String§bg_attachment: Stringbackground-attachment("scroll"(既定)/"fixed")。local は scroll と同一視する。
bg_image: Option<String>§bg_images: Vec<String>background-image: url(a), url(b) のような複数レイヤー全体(bg_image は先頭と同じ値)。
全レイヤーが同じ position/size/repeat を共有する簡略実装(レイヤーごとの個別指定は非対応)。
background_blend_mode: Stringbackground-blend-mode(background-image を background-color に対して
合成する際のブレンドモード。mix-blend-mode と同じ blend_pixel を再利用する)。
空文字列/"normal" は通常のアルファ合成。
bg_layers: Vec<(BgSizeMode, BgRepeatMode, BgRepeatMode, f32, f32)>複数レイヤー(bg_images.len() > 1)向けの、レイヤーごとの
(size, repeat_x, repeat_y, pos_x, pos_y)。単一レイヤーの場合は空(bg_size/
bg_repeat_*/bg_pos_* をそのまま使う)。
pos_top: Option<i32>§pos_left: Option<i32>§pos_right: Option<i32>§pos_bottom: Option<i32>§z_index: i32§paint_depth: u32DOM ツリー上の深さ。描画ソートの第 2 キー。
要素列は祖先が先に積まれるとは限らないため、同一 z 内で祖先(浅い方)を
先に描くにはこれが要る(spec/paint_order.md の不変条件 I-1)。
is_fixed: bool§clip_x0: i32§clip_y0: i32§clip_x1: i32§clip_y1: i32§box_shadow: Vec<(i32, i32, i32, u32, bool)>box-shadow: カンマ区切りの複数シャドウに対応(各要素は (offset_x, offset_y, blur, color, is_inset))。 空 Vec = 未指定。CSSの重なり順(先頭が最前面)どおり Vec の先頭から順に並ぶ。
white_space_nowrap: bool§text_overflow_ellipsis: bool§text_overflow_rtl: booldirection:rtl かどうか。text-overflow:ellipsis の省略記号を先頭側に出し、
末尾ではなく先頭側の文字を切り詰める(CSS仕様どおりの挙動)ために使う。
linear_gradient: Option<LinearGradient>§radial_gradient: Option<RadialGradient>§conic_gradient: Option<Vec<GradientStop>>conic-gradient(c1, c2, ...) の全カラーストップ(12時方向から時計回り、等間隔配置)。
以前は先頭2色のみを保持する (u32, u32) で、3色目以降が丸ごと失われるバグがあった。
repeating_linear_gradient: Option<(Vec<u32>, i32, bool)>(全カラーストップ, cycle_px, is_vertical)。以前は先頭2色固定の (u32,u32,i32,bool)
で3色目以降が失われていた。周期内で全色を均等割りして補間する。
repeating_radial_gradient: Option<(Vec<u32>, i32)>(全カラーストップ, cycle_px)。以前は先頭2色固定の (u32,u32,i32) で
3色目以降が失われていた。
opacity: u8§text_shadow: Vec<(i32, i32, i32, u32)>text-shadow: カンマ区切りの複数シャドウに対応(各要素は (offset_x, offset_y, blur, color))。 空 Vec = 未指定。CSSの重なり順(先頭が最前面)どおり Vec の先頭から順に並ぶ。
before_content: String::before / ::after content string (empty = no pseudo element)
after_content: String§font_family: String::before { font-family: "Font Awesome 6 Free"; } 等、疑似要素専用の
font-family(空 = 指定なし = 通常のグローバルフォントで描画)。
FontAwesome等のアイコンフォントは複数ファミリーが同じprivate-use-area
コードポイントに異なるグリフを割り当てるため、要素のcontentが
アイコン専用(el.textが空でicon用のbefore_contentのみ)の場合に限り、
このファミリー名で登録済みカスタムフォントを優先的に探して描画する。
【2026-08-03】要素自身の font-family(カンマ区切りのまま保持)。
@font-face で登録した Web フォントを字形へ反映するには、
描画時にどの family を使うかが要る。従来は ::before 用の
before_font_family しか持っておらず、本文の family がどこにも
渡っていなかったため、フォントを取得・登録しても反映されなかった。
before_font_family: String§transform_tx: i32CSS transform: translate(x,y) / scale(sx,sy) / rotate(deg) の簡易表現
transform_ty: i32§transform_scale_x: f32§transform_scale_y: f32§transform_rotate_deg: f32§transform_skew_x: f32transform: skewX(deg) せん断変換のX軸角度(度。既定 0.0 = 変換なし)。
transform_skew_y: f32transform: skewY(deg) せん断変換のY軸角度(度。既定 0.0 = 変換なし)。
transform_origin_x: f32transform-origin(scale の基準点。0.0-1.0 の割合、既定は (0.5,0.5)=中央)。
transform_origin_y: f32§letter_spacing: i32letter-spacing(文字間に加える px、負も可)。0 = normal。
word_spacing: i32word-spacing(半角スペース1文字ごとに加える px、負も可)。0 = normal。
text_emphasis_style: Stringtext-emphasis-style: 各文字の上に付す強調記号(“dot”/“circle”/“double-circle”/
“triangle”/“sesame”、またはクォート付きカスタム1文字、“none”/空文字列 = 無し)。
text-emphasis-position は非対応で常に文字の上(横書き前提)に描く。
text_emphasis_color: Option<u32>text-emphasis-color(未指定なら文字色 color を使う)。
cursor_style: StringCSS cursor。"text" のみ実際のマウスカーソル形状(I-beam)へ反映する。
それ以外の非対応キーワード(pointer/wait/help 等)は既定の矢印にフォールバックする。
scroll_container_id: Stringこのエレメントが所属するスクロールコンテナの element_id(空 = ページスクロール)。
clip_path: StringCSS clip-path value (e.g. “circle(50%)”, empty = no clip)
is_sticky: boolposition: sticky
sticky_top: Option<i32>sticky の吸着オフセット(top/bottom)。両方指定時は top を優先する。
sticky_bottom: Option<i32>§sticky_bound_max_y: i32sticky の可動範囲下限(吸着後にこれ以上下げない、含む要素の下端 - height)。 未設定時(属するコンテナが無い等)は i32::MAX として無制限に振る舞う。
bg_size: BgSizeModebackground-size(既定は Stretch = box 全面に引き伸ばし、従来互換)。
bg_repeat_x: BgRepeatModebackground-repeat: x/y 各軸のモード(Stretch モードでは効果なし)。
bg_repeat_y: BgRepeatMode§bg_pos_x: f32background-position のアンカー位置(0.0=左/上, 1.0=右/下, 0.5=中央)。
bg_pos_y: f32§outline_color: Option<u32>outline(レイアウトに影響しない装飾線。border-box の外側に描画)。
outline_width: i32§outline_offset: i32outline-offset(border-box からの追加オフセット px)。
outline_style: Stringoutline-style(“solid”/“dashed”/“dotted”、既定 “solid”)。
object_fit: ObjectFit 要素の object-fit / object-position。
object_pos_x: f32既定は (0.5, 0.5)(中央)。background-position とは既定値が異なる点に注意。
object_pos_y: f32§filter: StringCSS filter(生の宣言値、例 “grayscale(1) brightness(1.2)”)。
のピクセル描画時にのみ適用する簡略実装(grayscale/brightness/invert/sepia/contrast/saturate のみ対応)。
mix_blend_mode: StringCSS mix-blend-mode(生の宣言値)。単色背景の塗り(クリップ無し・不透明・角丸無しの
最も単純な経路)にのみ適用する簡略実装。multiply/screen/darken/lighten/difference のみ対応。
backdrop_filter: StringCSS backdrop-filter(生の宣言値)。
image_rendering: StringCSS image-rendering(“pixelated”, “crisp-edges”, “smooth” 等)。
text_stroke_width: i32CSS text-stroke / -webkit-text-stroke(幅と色)。
text_stroke_color: Option<u32>§line_clamp: i32-webkit-line-clamp(複数行テキストの末尾を ... で省略表示する行数上限。
0 = 無制限。display: -webkit-box かつ -webkit-box-orient: vertical と
併用されるが、この実装では値が 0 でなければ常に有効にする簡略実装)。
node_idx: Option<usize>Trait Implementations§
Source§impl Clone for RenderElement
impl Clone for RenderElement
Source§fn clone(&self) -> RenderElement
fn clone(&self) -> RenderElement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenderElement
impl Debug for RenderElement
Source§impl Default for RenderElement
impl Default for RenderElement
Source§impl PartialEq for RenderElement
impl PartialEq for RenderElement
Source§fn eq(&self, other: &RenderElement) -> bool
fn eq(&self, other: &RenderElement) -> bool
self and other values to be equal, and is used by ==.