16
16
#include < LibWeb/DOM/Document.h>
17
17
#include < LibWeb/DOM/Element.h>
18
18
#include < LibWebView/AccessibilityTreeModel.h>
19
+ #include < LibWebView/AriaPropertiesStateModel.h>
19
20
#include < LibWebView/DOMTreeModel.h>
20
21
#include < LibWebView/OutOfProcessWebView.h>
21
22
#include < LibWebView/StylePropertiesModel.h>
@@ -67,6 +68,7 @@ void InspectorWidget::set_selection(GUI::ModelIndex const index)
67
68
auto inspected_node_properties = maybe_inspected_node_properties.release_value ();
68
69
load_style_json (inspected_node_properties.computed_style_json , inspected_node_properties.resolved_style_json , inspected_node_properties.custom_properties_json );
69
70
update_node_box_model (inspected_node_properties.node_box_sizing_json );
71
+ update_aria_properties_state_model (inspected_node_properties.aria_properties_state_json );
70
72
} else {
71
73
clear_style_json ();
72
74
clear_node_box_model ();
@@ -117,6 +119,10 @@ InspectorWidget::InspectorWidget()
117
119
m_element_size_view = box_model_widget.add <ElementSizePreviewWidget>();
118
120
m_element_size_view->set_should_hide_unnecessary_scrollbars (true );
119
121
122
+ auto & aria_properties_state_widget = bottom_tab_widget.add_tab <GUI::Widget>(" ARIA" _string.release_value_but_fixme_should_propagate_errors ());
123
+ aria_properties_state_widget.set_layout <GUI::VerticalBoxLayout>(4 );
124
+ m_aria_properties_state_view = aria_properties_state_widget.add <GUI::TableView>();
125
+
120
126
m_dom_tree_view->set_focus (true );
121
127
}
122
128
@@ -146,7 +152,7 @@ void InspectorWidget::clear_dom_json()
146
152
m_dom_loaded = false ;
147
153
}
148
154
149
- void InspectorWidget::set_dom_node_properties_json (Selection selection, StringView computed_values_json, StringView resolved_values_json, StringView custom_properties_json, StringView node_box_sizing_json)
155
+ void InspectorWidget::set_dom_node_properties_json (Selection selection, StringView computed_values_json, StringView resolved_values_json, StringView custom_properties_json, StringView node_box_sizing_json, StringView aria_properties_state_json )
150
156
{
151
157
if (selection != m_selection) {
152
158
dbgln (" Got data for the wrong node id! Wanted ({}), got ({})" , m_selection.to_string (), selection.to_string ());
@@ -155,6 +161,7 @@ void InspectorWidget::set_dom_node_properties_json(Selection selection, StringVi
155
161
156
162
load_style_json (computed_values_json, resolved_values_json, custom_properties_json);
157
163
update_node_box_model (node_box_sizing_json);
164
+ update_aria_properties_state_model (aria_properties_state_json);
158
165
}
159
166
160
167
void InspectorWidget::load_style_json (StringView computed_values_json, StringView resolved_values_json, StringView custom_properties_json)
@@ -196,6 +203,12 @@ void InspectorWidget::update_node_box_model(StringView node_box_sizing_json)
196
203
m_element_size_view->set_box_model (m_node_box_sizing);
197
204
}
198
205
206
+ void InspectorWidget::update_aria_properties_state_model (StringView aria_properties_state_json)
207
+ {
208
+ m_aria_properties_state_view->set_model (WebView::AriaPropertiesStateModel::create (aria_properties_state_json).release_value_but_fixme_should_propagate_errors ());
209
+ m_aria_properties_state_view->set_searchable (true );
210
+ }
211
+
199
212
void InspectorWidget::clear_node_box_model ()
200
213
{
201
214
m_node_box_sizing = Web::Layout::BoxModelMetrics {};
@@ -209,6 +222,7 @@ void InspectorWidget::clear_style_json()
209
222
m_computed_style_table_view->set_model (nullptr );
210
223
m_resolved_style_table_view->set_model (nullptr );
211
224
m_custom_properties_table_view->set_model (nullptr );
225
+ m_aria_properties_state_view->set_model (nullptr );
212
226
213
227
m_element_size_view->set_box_model ({});
214
228
m_element_size_view->set_node_content_width (0 );
0 commit comments