Test Cases for HTTP Link header field (RFC 5988)

Please send feedback to julian.reschke@gmx.de.

Related Reading

Browsers Tested

Unless stated otherwise, all tests were executed with the latest release versions of Firefox, Google Chrome, Microsoft Internet Explorer, Safari, Konqueror (kde4win) and Opera on a machine running Windows 7. Test versions of Firefox are included because Link header field related fixes are currently being worked on.

Test Result Summary

Colors -- Red: Failure, Green: Pass, Yellow: Warning, Grey: Not Supported

Score -- Passes: 2 points, Warning: 1 point, in percent of possible points (this should be updated to count optional features differently)

Test CaseFirefox 19Microsoft IE 9Opera 12Safari 5.1Konqueror 4.7Google Chrome 25
Summary90% passes, 3% failures, 3% warnings, 3% unsupported, 0% to-do
Score: 92
0% passes, 0% failures, 0% warnings, 100% unsupported, 0% to-do
Score: 0
45% passes, 16% failures, 3% warnings, 35% unsupported, 0% to-do
Score: 47
0% passes, 0% failures, 0% warnings, 100% unsupported, 0% to-do
Score: 0
0% passes, 0% failures, 0% warnings, 100% unsupported, 0% to-do
Score: 0
0% passes, 0% failures, 0% warnings, 100% unsupported, 0% to-do
Score: 0
Link rel=stylesheet (CSS)simplecsspassunsupportedpassunsupported ((see Webkit Issue 20018)) unsupportedunsupported ((see Webkit Issue 20018 and Chrome Issue 120104))
simplecssreversedpassunsupportedpassunsupportedunsupportedunsupported
simplecsssqpassunsupportedpassunsupportedunsupportedunsupported
simplecssmrelpassunsupportedpassunsupportedunsupportedunsupported
simplecssmlnkpassunsupportedpassunsupportedunsupportedunsupported
simplecssanchrpassunsupportedfail (anchor parameter ignored) unsupportedunsupportedunsupported
simplecssanchrsamepassunsupportedpassunsupportedunsupportedunsupported
simplecssanchrsame2passunsupportedpassunsupportedunsupportedunsupported
simplecssanchrsamefragpassunsupportedfailunsupportedunsupportedunsupported
simplecssanchrsamefrag2passunsupportedfailunsupportedunsupportedunsupported
Link rel=stylesheet (XSLT)simplexslttypenotypefail ((see Mozilla Bug 688712)) unsupportedunsupportedunsupportedunsupportedunsupported
simplexslttypedeprpassunsupportedunsupportedunsupportedunsupportedunsupported
simplexslttypedepr2passunsupportedunsupportedunsupportedunsupportedunsupported
simplexslttypeoffpassunsupportedunsupportedunsupportedunsupportedunsupported
title parametersimplecsstitlepassunsupportedpass ((but title not exposed in DOM)) unsupportedunsupportedunsupported
simplecsstitleqpassunsupportedfail (fails to apply backslash-unescaping) unsupportedunsupportedunsupported
simplecsstitleq2passunsupportedfail (fails to apply backslash-unescaping) unsupportedunsupportedunsupported
simplecsstitletokwarn (accepts the token form) unsupportedwarn (accepts the token form (but title not exposed in DOM)) unsupportedunsupportedunsupported
RFC 5987 encoding title parametersimplecsstitle5987passunsupportedunsupportedunsupportedunsupportedunsupported
simplecsstitle5987rpassunsupportedunsupportedunsupportedunsupportedunsupported
simplecsstitle5987iso88591unsupported ((does not support ISO-8859-1)) unsupportedunsupportedunsupportedunsupportedunsupported
simplecsstitle5987noencpassunsupportedunsupportedunsupportedunsupportedunsupported
simplecsstitle5987invencpassunsupportedunsupportedunsupportedunsupportedunsupported
simplecsstitle5987parseerrorpassunsupportedunsupportedunsupportedunsupportedunsupported
simplecsstitle5987parseerror2passunsupportedunsupportedunsupportedunsupportedunsupported
Extension parameterssimpleextpassunsupportedpassunsupportedunsupportedunsupported
simpleextqpassunsupportedpassunsupportedunsupportedunsupported
simpleextapassunsupportedpassunsupportedunsupportedunsupported
Extension link relationssimpleextrelpassunsupportedpassunsupportedunsupportedunsupported
Handling multiple linkssimplecss2passunsupportedpassunsupportedunsupportedunsupported
simplecssafterotherpassunsupportedpassunsupportedunsupportedunsupported

Test Cases

Link rel=stylesheet (CSS)

Various tests checking CSS stylesheet links.

simplecss [TEST] [R]

Link: <simple.css>; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported ((see Webkit Issue 20018))
Konqunsupported
Chromeunsupported ((see Webkit Issue 20018 and Chrome Issue 120104))

simple CSS link

Result for this UA:

simplecssreversed [TEST] [R]

Link: rel=stylesheet; <fail.css>
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link, with link relation and target reversed

Result for this UA:

simplecsssq [TEST] [R]

Link: <fail.css>; rel='stylesheet'
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link, relation in single quotes

Result for this UA:

simplecssmrel [TEST] [R]

Link: <simple.css>; rel="foobar stylesheet"
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link with two link relations

Result for this UA:

simplecssmlnk [TEST] [R]

Link: <foo>; rel=bar, <simple.css>; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link, following another link

Result for this UA:

simplecssanchr [TEST] [R]

Link: <fail.css>; anchor="http://example.com/"; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operafail (anchor parameter ignored)
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link, but anchor goes to different site; thus header field specifies a stylesheet for http://example.com/, not the current document (see RFC 5988, Section 5.2, Paragraph 2)

Result for this UA:

simplecssanchrsame [TEST] [R]

Link: <simple.css>; anchor=""; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link, with an anchor parameter identifying the current document (see RFC 5988, Section 5.2, Paragraph 2)

Result for this UA:

simplecssanchrsame2 [TEST] [R]

Link: <simple.css>; anchor=""; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

same as above, but navigating to the HTTP resource including a fragment identifier; the fragment identifier is irrelevant from HTTP's point of view, so the result should be the same (the CSS being applied)

Result for this UA:

simplecssanchrsamefrag [TEST] [R]

Link: <fail.css>; anchor="#foo"; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operafail
Safariunsupported
Konqunsupported
Chromeunsupported

The anchor identifies the context resource plus the fragment "foo"; as the fragment is not sent over HTTP, the link should not be applied

Result for this UA:

simplecssanchrsamefrag2 [TEST] [R]

Link: <fail.css>; anchor="#foo"; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operafail
Safariunsupported
Konqunsupported
Chromeunsupported

same as above, but navigating to the HTTP resource including a fragment identifier; the fragment identifier is irrelevant from HTTP's point of view, so the result should be the same (the CSS not being applied)

Result for this UA:

Link rel=stylesheet (XSLT)

Various tests checking XSLT transformation links.

simplexslttypenotype [TEST] [R]

Link: <simple.xslt>; rel=stylesheet
Test Results
FF19fail ((see Mozilla Bug 688712))
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

simple XSLT link.

Result for this UA:

simplexslttypedepr [TEST] [R]

Link: <simple.xslt>; rel=stylesheet; type="text/xsl"
Test Results
FF19pass
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

simple XSLT link with inofficial XSLT media type.

Result for this UA:

simplexslttypedepr2 [TEST] [R]

Link: <simple.xslt.asis>; rel=stylesheet; type="text/xsl"
Test Results
FF19pass
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

simple XSLT link with inofficial XSLT media type; with the XSLT actually being served as text/xsl (as opposed to application/xslt+xml)

Result for this UA:

simplexslttypeoff [TEST] [R]

Link: <simple.xslt>; rel=stylesheet; type="application/xslt+xml"
Test Results
FF19pass
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

simple XSLT link with official XSLT media type.

Result for this UA:

title parameter

Various tests checking handling of title parameter (see CCSOM, Requirements on User Agents Implementing the HTTP Link Header, but see also bug report).

simplecsstitle [TEST] [R]

Link: <simple.css>; rel=stylesheet; title="A simple CSS stylesheet"
Test Results
FF19pass
MSIE9unsupported
Operapass ((but title not exposed in DOM))
Safariunsupported
Konqunsupported
Chromeunsupported

simple titled CSS link

UAs that can show CSS stylesheet titles should use the specified name.

Result for this UA:

simplecsstitleq [TEST] [R]

Link: <simple.css>; rel=stylesheet; title="title with a DQUOTE \" and backslash: \\"
Test Results
FF19pass
MSIE9unsupported
Operafail (fails to apply backslash-unescaping)
Safariunsupported
Konqunsupported
Chromeunsupported

simple titled CSS link, using quoted characters

UAs that can show CSS stylesheet titles should use the specified name.

Result for this UA:

simplecsstitleq2 [TEST] [R]

Link: <simple.css>; title="title with a DQUOTE \" and backslash: \\"; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operafail (fails to apply backslash-unescaping)
Safariunsupported
Konqunsupported
Chromeunsupported

simple titled CSS link, using quoted characters (order reversed as compared to above)

UAs that can show CSS stylesheet titles should use the specified name.

Result for this UA:

simplecsstitletok [TEST] [R]

Link: <simple.css>; rel=stylesheet; title=AsimpleCSSstylesheet
Test Results
FF19warn (accepts the token form)
MSIE9unsupported
Operawarn (accepts the token form (but title not exposed in DOM))
Safariunsupported
Konqunsupported
Chromeunsupported

simple titled CSS link, using token form (not allowed by RFC 5988)

Result for this UA:

RFC 5987 encoding title parameter

Various tests checking handling of RFC 5987 encoding for titles.

simplecsstitle5987 [TEST] [R]

Link: <simple.css>; rel=stylesheet; title*=UTF-8''stylesheet-%E2%82%AC
Test Results
FF19pass
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

simple titled CSS link, using the encoding defined in RFC 5987

UAs that can show CSS stylesheet titles should use the specified name.

Result for this UA:

simplecsstitle5987r [TEST] [R]

Link: <simple.css>; title*=UTF-8''stylesheet-%E2%82%AC; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

simple titled CSS link, using the encoding defined in RFC 5987 (parameters reversed)

UAs that can show CSS stylesheet titles should use the specified name.

Result for this UA:

simplecsstitle5987iso88591 [TEST] [R]

Link: <simple.css>; title*=iso-8859-1''stylesheet-%E4; title="fallback title"; rel=stylesheet
Test Results
FF19unsupported ((does not support ISO-8859-1))
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

"title*" specifies stylesheet-

Result for this UA:

simplecsstitle5987noenc [TEST] [R]

Link: <simple.css>; title*=''A%20simple%20CSS%20stylesheet; title="fallback title"; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

missing encoding in "title*"; should fallback to "fallback title"

Result for this UA:

simplecsstitle5987invenc [TEST] [R]

Link: <simple.css>; title*=foobar''A%20simple%20CSS%20stylesheet; title="fallback title"; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

invalid encoding in "title*"; should fallback to "fallback title"

Result for this UA:

simplecsstitle5987parseerror [TEST] [R]

Link: <simple.css>; title*=foobar; title="fallback title"; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

syntax error in "title*"; should fallback to "fallback title"

Result for this UA:

simplecsstitle5987parseerror2 [TEST] [R]

Link: <simple.css>; title*=UTF-8''foobar%; title="fallback title"; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operaunsupported
Safariunsupported
Konqunsupported
Chromeunsupported

syntax error in "title*"; should fallback to "fallback title"

Result for this UA:

Extension parameters

Various tests checking CSS stylesheet links.

simpleext [TEST] [R]

Link: <simple.css>; ext=foo; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link, following an extension parameter

Result for this UA:

simpleextq [TEST] [R]

Link: <simple.css>; ext="\""; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link, following an extension parameter using quoted-string syntax

Result for this UA:

simpleexta [TEST] [R]

Link: <simple.css>; ext1='start; rel=stylesheet; ext2=end'
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link, following an extension parameter using token syntax, containing a single quote

Result for this UA:

Extension link relations

Various tests checking parsing of extension link relations.

simpleextrel [TEST] [R]

Link: <simple.css>; rel="http://example.com/myrel stylesheet"
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

simple CSS link, where an extension link relation appears before "stylesheet"

Result for this UA:

Handling multiple links

Various tests checking whether multiple links are handled properly.

simplecss2 [TEST] [R]

Link: <ybg.css>; rel=stylesheet, <simple.css>; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

two simple CSS links

Result for this UA:

simplecssafterother [TEST] [R]

Link: <ybf.css>; rel=foobar, <simple.css>; rel=stylesheet
Test Results
FF19pass
MSIE9unsupported
Operapass
Safariunsupported
Konqunsupported
Chromeunsupported

two links, only the 2nd one a stylesheet link

Result for this UA:

Test Case Generation

Both this document and the indiviual test "scripts" are generated from one single XML source (httplink.xml), using an XSLT2 transformation (httplink.xslt).

To generate the files, an XSLT2 processor such as Saxon 9 is needed. Copy both files into an empty directory, then run:

saxon9 httplink.xml httplink.xslt > index.html

Note that this will also generate a set of "asis" files that contain the actual test cases. These can be served using the Apache httpd mod_asis module.