mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 05:10:57 +00:00 
			
		
		
		
	LibWeb: Make EventTarget::activation_behavior a virtual function
(Instead of using an AK::Function on EventTarget). This shaves 48 bytes off of every EventTarget instance.
This commit is contained in:
		
							parent
							
								
									84eecbb10e
								
							
						
					
					
						commit
						a71eaefdf6
					
				
				
				Notes:
				
					sideshowbarker
				
				2024-07-18 08:59:31 +09:00 
				
			
			Author: https://github.com/awesomekling
Commit: a71eaefdf6
Pull-request: https://github.com/SerenityOS/serenity/pull/21991
			
					 11 changed files with 108 additions and 64 deletions
				
			
		|  | @ -38,14 +38,6 @@ HTMLInputElement::HTMLInputElement(DOM::Document& document, DOM::QualifiedName q | |||
|     : HTMLElement(document, move(qualified_name)) | ||||
|     , m_value(DeprecatedString::empty()) | ||||
| { | ||||
|     activation_behavior = [this](auto&) { | ||||
|         // The activation behavior for input elements are these steps:
 | ||||
| 
 | ||||
|         // FIXME: 1. If this element is not mutable and is not in the Checkbox state and is not in the Radio state, then return.
 | ||||
| 
 | ||||
|         // 2. Run this element's input activation behavior, if any, and do nothing otherwise.
 | ||||
|         run_input_activation_behavior().release_value_but_fixme_should_propagate_errors(); | ||||
|     }; | ||||
| } | ||||
| 
 | ||||
| HTMLInputElement::~HTMLInputElement() = default; | ||||
|  | @ -1284,4 +1276,20 @@ bool HTMLInputElement::is_submit_button() const | |||
|     return type_state() == TypeAttributeState::SubmitButton | ||||
|         || type_state() == TypeAttributeState::ImageButton; | ||||
| } | ||||
| 
 | ||||
| bool HTMLInputElement::has_activation_behavior() const | ||||
| { | ||||
|     return true; | ||||
| } | ||||
| 
 | ||||
| void HTMLInputElement::activation_behavior(DOM::Event const&) | ||||
| { | ||||
|     // The activation behavior for input elements are these steps:
 | ||||
| 
 | ||||
|     // FIXME: 1. If this element is not mutable and is not in the Checkbox state and is not in the Radio state, then return.
 | ||||
| 
 | ||||
|     // 2. Run this element's input activation behavior, if any, and do nothing otherwise.
 | ||||
|     run_input_activation_behavior().release_value_but_fixme_should_propagate_errors(); | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling