mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:12:43 +00:00 
			
		
		
		
	 6038e36250
			
		
	
	
		6038e36250
		
	
	
	
	
		
			
			Previously, we always rounded border-widths up when converting them to device pixels. However, the spec asks us to follow a specific algorithm to "snap" these values, so that the computed value is snapped. The difference from before, is that widths of between 0 and 1 device pixels are rounded up to 1, and and values larger than 1 are rounded down.
		
			
				
	
	
		
			14 lines
		
	
	
		
			No EOL
		
	
	
		
			278 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			No EOL
		
	
	
		
			278 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <style>
 | |
|     div {
 | |
|         width: 100px;
 | |
|         height: 100px;
 | |
|     }
 | |
| 
 | |
|     /* Both of these border-widths should snap to 1px. */
 | |
|     .a {
 | |
|         border: 1.8px solid black;
 | |
|     }
 | |
|     .b {
 | |
|         border: 0.2px solid black;
 | |
|     }
 | |
| </style><div class="a"></div><div class="b"></div> |