mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:12:44 +00:00 
			
		
		
		
	 c41bae3d54
			
		
	
	
		c41bae3d54
		
	
	
	
	
		
			
			This patch implements basic support for <a href="#foo"> fragment links. To figure out where we actually want to scroll to, we have to do something different based on the layout node's box type. So if it's a regular LayoutBox we can just use the LayoutBox::position(). However, if it's an inline layout node, we use the position of the first line box fragment in the containing block contributed by this layout node or one of its descendants.
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <html>
 | |
|     <head><title>a#hash test</title></head>
 | |
|     <body>
 | |
|     <ul>
 | |
|         <li><a href="#section1">Section 1</a></li>
 | |
|         <li><a href="#section2">Section 2</a></li>
 | |
|         <li><a href="#section3">Section 3</a></li>
 | |
|         <li><a href="#section4">Section 4</a></li>
 | |
|     </ul>
 | |
|     <h1><a name="section1">Section 1</a></h1>
 | |
|     <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
 | |
|     <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
 | |
|     <h1><a name="section2">Section 2</a></h1>
 | |
|     <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
 | |
|     <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
 | |
|     <h1><a name="section3">Section 3</a></h1>
 | |
|     <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
 | |
|     <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
 | |
|     <h1><a name="section4">Section 4</a></h1>
 | |
|     <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
 | |
|     <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
 | |
|     </body>
 | |
| </html>
 |