mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:42:45 +00:00 
			
		
		
		
	 7c91fda088
			
		
	
	
		7c91fda088
		
	
	
	
	
		
			
			The spec grammar for `text-decoration-line` is: `none | [ underline || overline || line-through || blink ]` Which means that it's either `none`, or any combination of the other values. This patch makes that parse for `text-decoration-line` and `text-decoration`, stores the results as a Vector, and adjusts `paint_text_decoration()` to run as a loop over all the values that are provided. As noted, storing a Vector of values is a bit wasteful, as they could be stored as flags in a single `u8`. But I was getting too confused trying to do that in a nice way.
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			779 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			779 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE html>
 | |
| <html>
 | |
| <head>
 | |
| <title>text-decoration test</title>
 | |
| <style>
 | |
| .overline { text-decoration: wavy blue overline; }
 | |
| .underline { text-decoration: red underline double; }
 | |
| .strikethrough { text-decoration: line-through dotted green; }
 | |
| .blink { text-decoration: blink; }
 | |
| .current-color { color: #8B4513; text-decoration: underline; }
 | |
| .overboard { text-decoration: double overline underline line-through magenta; }
 | |
| </style>
 | |
| </head>
 | |
| <body>
 | |
| 	<p class="overline">Overline</p>
 | |
| 	<p class="underline">Underline</p>
 | |
| 	<p class="strikethrough">Wombling</p>
 | |
| 	<p class="blink">FREE!</p>
 | |
| 	<p class="current-color">This underline should match the text color</p>
 | |
| 	<p class="overboard">This should have an underline, overline and line-through, all in glorious magenta.</p>
 | |
| </body>
 | |
| </html>
 |