Evaluate the layout and return all render commands.
(&mut self)
| 1081 | |
| 1082 | /// Evaluate the layout and return all render commands. |
| 1083 | pub fn eval(&mut self) -> Vec<RenderCommand<CustomElementData>> { |
| 1084 | // Clean up stale networking entries (feature-gated) |
| 1085 | #[cfg(feature = "net")] |
| 1086 | net::NET_MANAGER.lock().unwrap().clean(); |
| 1087 | |
| 1088 | let commands = self.context.end_layout(); |
| 1089 | let mut result = Vec::new(); |
| 1090 | for cmd in commands { |
| 1091 | result.push(RenderCommand::from_engine_render_command(cmd)); |
| 1092 | } |
| 1093 | |
| 1094 | // Sync the hidden DOM accessibility tree (web/WASM only) |
| 1095 | #[cfg(all(feature = "a11y", target_arch = "wasm32"))] |
| 1096 | { |
| 1097 | let accessibility_bounds = self.accessibility_bounds(); |
| 1098 | |
| 1099 | accessibility_web::sync_accessibility_tree( |
| 1100 | &mut self.web_a11y_state, |
| 1101 | &self.context.accessibility_configs, |
| 1102 | &accessibility_bounds, |
| 1103 | &self.context.accessibility_element_order, |
| 1104 | self.context.focused_element_id, |
| 1105 | self.context.layout_dimensions, |
| 1106 | ); |
| 1107 | } |
| 1108 | |
| 1109 | // Sync accessibility tree via AccessKit (native platforms) |
| 1110 | #[cfg(all(feature = "a11y", not(target_arch = "wasm32")))] |
| 1111 | { |
| 1112 | let accessibility_bounds = self.accessibility_bounds(); |
| 1113 | |
| 1114 | let a11y_actions = accessibility_native::sync_accessibility_tree( |
| 1115 | &mut self.native_a11y_state, |
| 1116 | &self.context.accessibility_configs, |
| 1117 | &accessibility_bounds, |
| 1118 | &self.context.accessibility_element_order, |
| 1119 | self.context.focused_element_id, |
| 1120 | self.context.layout_dimensions, |
| 1121 | ); |
| 1122 | for action in a11y_actions { |
| 1123 | match action { |
| 1124 | accessibility_native::PendingA11yAction::Focus(target_id) => { |
| 1125 | self.context.change_focus(target_id); |
| 1126 | } |
| 1127 | accessibility_native::PendingA11yAction::Click(target_id) => { |
| 1128 | self.context.fire_press(target_id); |
| 1129 | } |
| 1130 | } |
| 1131 | } |
| 1132 | } |
| 1133 | |
| 1134 | result |
| 1135 | } |
| 1136 | |
| 1137 | /// Evaluate the layout and render all commands. |
| 1138 | pub async fn show( |