Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion htmltest/check-link.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (hT *HTMLTest) checkLink(document *htmldoc.Document, node *html.Node) {

// Check if favicon
if htmldoc.AttrPresent(node.Attr, "rel") &&
(attrs["rel"] == "icon" || attrs["rel"] == "shortcut icon") &&
(attrs["rel"] == "icon" || attrs["rel"] == "icon shortcut" || attrs["rel"] == "shortcut icon") &&
node.Parent.Data == "head" {
document.State.FaviconPresent = true
}
Expand Down
7 changes: 7 additions & 0 deletions htmltest/check-link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,13 @@ func TestFaviconOptionPresentShortcut(t *testing.T) {
tExpectIssue(t, hT, "favicon missing", 0)
}

func TestFaviconOptionPresentIconShortcut(t *testing.T) {
// passes, when asked, with present favicon with rel="icon shortcut"
hT := tTestFileOpts("fixtures/favicon/favicon_present_icon_shortcut.html",
map[string]interface{}{"CheckFavicon": true})
tExpectIssue(t, hT, "favicon missing", 0)
}

func TestFaviconOptionPresentButInBody(t *testing.T) {
// fails when favicon isn't a first level child of <head>
hT := tTestFileOpts("fixtures/favicon/favicon_present_but_in_body.html",
Expand Down
7 changes: 7 additions & 0 deletions htmltest/fixtures/favicon/favicon_present_icon_shortcut.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html>
<head>
<link rel="icon shortcut" href="../resources/gpl.png">
</head>
<body>
</body>
</html>
Loading