mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 13:20:59 +00:00 
			
		
		
		
	LibWeb: Don't create HTMLInputElement's UA shadow tree for buttons
We don't need an internal editable text node inside buttons. :^)
This commit is contained in:
		
							parent
							
								
									b8ee4dfda8
								
							
						
					
					
						commit
						06ccc45157
					
				
				
				Notes:
				
					sideshowbarker
				
				2024-07-18 22:57:59 +09:00 
				
			
			Author: https://github.com/awesomekling
Commit: 06ccc45157
			
					 1 changed files with 13 additions and 1 deletions
				
			
		|  | @ -159,7 +159,19 @@ void HTMLInputElement::create_shadow_tree_if_needed() | |||
|     if (shadow_root()) | ||||
|         return; | ||||
| 
 | ||||
|     // FIXME: This assumes that we want a text box. Is that always true?
 | ||||
|     // FIXME: This could be better factored. Everything except the below types becomes a text input.
 | ||||
|     switch (type_state()) { | ||||
|     case TypeAttributeState::RadioButton: | ||||
|     case TypeAttributeState::Checkbox: | ||||
|     case TypeAttributeState::Button: | ||||
|     case TypeAttributeState::SubmitButton: | ||||
|     case TypeAttributeState::ResetButton: | ||||
|     case TypeAttributeState::ImageButton: | ||||
|         return; | ||||
|     default: | ||||
|         break; | ||||
|     } | ||||
| 
 | ||||
|     auto shadow_root = adopt_ref(*new DOM::ShadowRoot(document(), *this)); | ||||
|     auto initial_value = attribute(HTML::AttributeNames::value); | ||||
|     if (initial_value.is_null()) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling