feat: inline favicons with rel="shortcut icon"

If the page is using rel="shortcut icon" instead of rel="icon", the
author will be surprised that the icon was not inlined, and may not
notice.  It would be better to inline that icon.

Includes updates to the favicon tests.

Related to issue #126
This commit is contained in:
Joey Parrish 2016-11-17 11:04:59 -08:00
parent ae4c110976
commit 68c345ae8e
3 changed files with 4 additions and 3 deletions

View File

@ -20,7 +20,7 @@ var tasks = {
js: 'script',
svg: 'svg',
links: 'link[rel=stylesheet]',
favicon: 'link[rel=icon]',
favicon: 'link[rel=icon],link[rel="shortcut icon"]',
styles: 'style',
'style-attrs': '[style]:not(svg *)', // only style attrs in HTML, not SVG
images: 'img',

View File

@ -1 +1 @@
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>inline favicon</title> <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg=="> </head> <body> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>inline favicon</title> <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg=="> <link rel="shortcut icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg=="> </head> <body> </body> </html>

View File

@ -4,7 +4,8 @@
<meta charset="utf-8">
<title>inline favicon</title>
<link rel="icon" type="image/png" href="colour.png">
<link rel="shortcut icon" type="image/png" href="colour.png">
</head>
<body>
</body>
</html>
</html>