mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:32:43 +00:00 
			
		
		
		
	LibWeb+LibWebView+WebContent: Implement more <input type=file> behavior
We had previous implemented some plumbing for file input elements in
commit 636602a54e.
This implements the return path for chromes to inform WebContent of the
file(s) the user selected. This patch includes a dummy implementation
for headless-browser to enable testing.
			
			
This commit is contained in:
		
							parent
							
								
									435c2c24d1
								
							
						
					
					
						commit
						108521a566
					
				
					 23 changed files with 307 additions and 5 deletions
				
			
		|  | @ -806,6 +806,19 @@ void WebContentClient::did_request_color_picker(u64 page_id, Color const& curren | |||
|         view.on_request_color_picker(current_color); | ||||
| } | ||||
| 
 | ||||
| void WebContentClient::did_request_file_picker(u64 page_id, Web::HTML::AllowMultipleFiles allow_multiple_files) | ||||
| { | ||||
|     auto maybe_view = m_views.get(page_id); | ||||
|     if (!maybe_view.has_value()) { | ||||
|         dbgln("Received request file picker for unknown page ID {}", page_id); | ||||
|         return; | ||||
|     } | ||||
|     auto& view = *maybe_view.value(); | ||||
| 
 | ||||
|     if (view.on_request_file_picker) | ||||
|         view.on_request_file_picker(allow_multiple_files); | ||||
| } | ||||
| 
 | ||||
| void WebContentClient::did_request_select_dropdown(u64 page_id, Gfx::IntPoint content_position, i32 minimum_width, Vector<Web::HTML::SelectItem> const& items) | ||||
| { | ||||
|     auto maybe_view = m_views.get(page_id); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy Flynn
						Timothy Flynn