mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:42:44 +00:00 
			
		
		
		
	 9d2809146f
			
		
	
	
		9d2809146f
		
	
	
	
	
		
			
			Elements are now collected according to paint order as spec says, replacing the depth-first traversal of the paint tree with hit-testing on each box. This change resolves a FIXME in an existing test and adds a new previously non-working test.
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			490 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			490 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <div>
 | |
|     <p>Some text</p>
 | |
| </div>
 | |
| <p>Elements at point 30, 20:</p>
 | |
| <div id="output"></div>
 | |
| <script src="../include.js"></script>
 | |
| <script>
 | |
|     test(() => {
 | |
|         let output = document.getElementById("output");
 | |
|         let elements = document.elementsFromPoint(30, 20);
 | |
|         elements.forEach((elt, i) => {
 | |
|             output.textContent += elt.localName;
 | |
|             if (i < elements.length - 1) {
 | |
|                 output.textContent += " < ";
 | |
|             }
 | |
|         });
 | |
|     });
 | |
| </script>
 |