mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 00:32:45 +00:00 
			
		
		
		
	 8bb5652835
			
		
	
	
		8bb5652835
		
	
	
	
	
		
			
			The spec now has a "toggle task tracker" to coalesce rapid changes to this attribute. It also now has an explicit ToggleEvent to encapsulate the old and new state of the element. This further handles the attribute being added/removed using a override of Element::attribute_changed(), rather than being the only element to instead override Element::set/remove__attribute().
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			656 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			656 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Optional.h>
 | |
| #include <AK/String.h>
 | |
| #include <LibWeb/HTML/EventLoop/Task.h>
 | |
| 
 | |
| namespace Web::HTML {
 | |
| 
 | |
| // https://html.spec.whatwg.org/multipage/interaction.html#toggle-task-tracker
 | |
| struct ToggleTaskTracker {
 | |
|     // https://html.spec.whatwg.org/multipage/interaction.html#toggle-task-task
 | |
|     // NOTE: We store the task's ID rather than the task itself to avoid ownership issues.
 | |
|     Optional<int> task_id;
 | |
| 
 | |
|     // https://html.spec.whatwg.org/multipage/interaction.html#toggle-task-old-state
 | |
|     String old_state;
 | |
| };
 | |
| 
 | |
| }
 |