diff --git a/htmltest/check-link.go b/htmltest/check-link.go index dae18d7..2251b17 100644 --- a/htmltest/check-link.go +++ b/htmltest/check-link.go @@ -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 } diff --git a/htmltest/check-link_test.go b/htmltest/check-link_test.go index 3322b02..daf223d 100644 --- a/htmltest/check-link_test.go +++ b/htmltest/check-link_test.go @@ -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 hT := tTestFileOpts("fixtures/favicon/favicon_present_but_in_body.html", diff --git a/htmltest/fixtures/favicon/favicon_present_icon_shortcut.html b/htmltest/fixtures/favicon/favicon_present_icon_shortcut.html new file mode 100644 index 0000000..9a344ce --- /dev/null +++ b/htmltest/fixtures/favicon/favicon_present_icon_shortcut.html @@ -0,0 +1,7 @@ + + + + + + +