mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:12:46 +00:00 
			
		
		
		
	 bf4e2f3e9c
			
		
	
	
		bf4e2f3e9c
		
	
	
	
	
		
			
			Introduces `internals.hitTest(x, y)` that is going to allow us write tests for hit testing :)
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			314 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			314 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <style>
 | |
|     * {
 | |
|         border: 1px solid black;
 | |
|     }
 | |
| 
 | |
|     #box {
 | |
|         width: 100px;
 | |
|         height: 100px;
 | |
|     }
 | |
| </style>
 | |
| <div id="box"></div>
 | |
| <script src="../include.js"></script>
 | |
| <script>
 | |
|     test(() => {
 | |
|         println(internals.hitTest(50, 50).node === document.getElementById("box"));
 | |
|     });
 | |
| </script>
 |