The checker Task Force of the Mobile Web Best Practices Working Group has developed an open-source Java library to check conformance of a page with the W3C mobileOK Basic specification.
This library is accompanied by the set of test cases described below:
3.1 AUTO_REFRESH and REDIRECTION
This test does not determine whether the user is able to opt out of refresh.
If a
meta
element is present withhttp-equiv
attribute value of "refresh",If the URI specified as part of the
content
attribute is not the current resource's URI, FAILElse, warn
If a
Refresh
HTTP header is present,If the URI specified in the header value is not the current resource's URI, FAIL
Else, warn
Test case | Description | Checker result |
---|---|---|
AutoRefreshTest/1 (source) | FAIL: a meta element is present with http-equiv attribute value of "refresh" and the URI specified in the content attribute is not the current resource's URI | AUTO_REFRESH:
MAIN_DOCUMENT:
|
AutoRefreshTest/2 (source) | WARN: a meta element is present with http-equiv attribute value of "refresh", but it redirects back to the same URI | AUTO_REFRESH:
MAIN_DOCUMENT:
|
AutoRefreshTest/3 (source) | FAIL: a Refresh HTTP header is present, and the specified URI is not the current resources URI | AUTO_REFRESH:
|
AutoRefreshTest/4 (source) | WARN: a Refresh HTTP header is present, but it points back to the current resource's URI | AUTO_REFRESH:
|
AutoRefreshTest/5 (source) | FAIL: while this page does have an http-equiv header that points back to this URI, the HTTP header contains a refresh value that points to a different URI | AUTO_REFRESH:
MAIN_DOCUMENT:
|
AutoRefreshTest/6 (source) | FAIL: a edgecase test that ensures that an error is still thrown if no time is specified in the value of the header (@@@ but is that what the spec says???) | AUTO_REFRESH:
|
3.2 CACHING
The purpose of the test is to alert providers to the fact that their content may not be cached, if it would be beneficial to do so.
Note:
Where both a
meta
element withhttp-equiv
attribute and the corresponding HTTP header are found, the value of the HTTP header must be used - see also note under 2.4.4 Meta http-equiv Elements.If the HTTP response contains neither an
Expires
norCache-Control
headerIf no
meta http-equiv
element is present, referring to those headers, FAILContinue the test using the value from the
meta
content
attribute as though it were specified in the appropriate header, warnIf a
Cache-Control
HTTP header is present and contains value "no-cache", or contains value "max-age=0", warnIf a
Pragma
HTTP header is present and contains value "no-cache", warnIf an
Expires
andDate
HTTP header are present, and theExpires
header specifies a date which is not later than what theDate
header specifies, warnIf any cache related header contains an invalid value, warn
If the HTTP response contains a
Last-Modified
header,Request the same URI again, adding an
If-Modified-Since
request header whose value matches that of theLast-Modified
response headerIf the HTTP response contains a
Last-Modified
header and its value is again the same, and the HTTP response status is not 304 (Not Modified), warnIf the HTTP response contains an
ETag
header,Request the same URI again, adding an
If-None-Match
request header whose value matches that of theETag
response headerIf the HTTP response contains an
ETag
header and its value is again the same, and the HTTP response status is not 304 (Not Modified), warn
Test case | Description | Checker result |
---|---|---|
CachingTest/1 (source) | WARN: contains a no-cache value in the HTTP Cache-Control header | CACHING:
|
CachingTest/2 (source) | WARN: This page contains a max-age=0 value in its HTTP Cache-Control Header | CACHING:
|
CachingTest/3 (source) | FAIL: This page cantains neither an Expires nor Cache-Control header and also does not contain a meta http-equiv element that refers to cache control or expires | CACHING:
|
CachingTest/4 (source) | WARN: This warns because there is no HTTP Response header that specifies Cache-Control but specifies it in a meta http-equic header; an additional warning is raised because this value is no-cache | CACHING:
MAIN_DOCUMENT:
|
CachingTest/5 (source) | 2 WARN: There's a max-age=0 header in the Cache-Control header and there's a value of no-cache in the Pragma header | CACHING: |
CachingTest/6 (source) | WARN: Expires and Date HTTP header are present, and the Expires header specifies a date which is not later than what the Date header specifies, WARN | CACHING:
|
CachingTest/7 (source) | PASS: An expires header is present where the date is very much in the future | CACHING: PASS |
CachingTest/8 (source) | WARN: Cache-Control header contains an invalid value | CACHING:
|
CachingTest/9 (source) | 2 WARN: There is an invalid cache-control value and an expires header with a date that has already passed | CACHING: |
CachingTest/10 (source) | WARN: There's an E-Tag header and once the same URI is rerequested after adding a If-None-Match header, the E-Tag response has the same value and the HTTP response status is not 304. This is quite a special test since it needs the application server to behave incorrectly. Hence we actually use a special servlet to control the exact interaction, rather than serve a static file normally here. | CACHING:
|
CachingTest/11 (source) | WARN: This test illustrates the capture of invalid cache control values in both the HTTPHeaders and the meta http-equiv content values, as well as a max-age set to 0 | CACHING:
MAIN_DOCUMENT:
|
CachingTest/12 (source) | WARN: the page resulting of a 302 redirection is served with a no-cache directive | CACHING:
MAIN_DOCUMENT:
|
CachingTest/13 (source) | WARN: There's an Last-Modified header and once the same URI is rerequested after adding a If-Modified-Since header, the Last-Modified response has the same value and the HTTP response status is not 304. This is quite a special test since it needs the application server to behave incorrectly. Hence we actually use a special servlet to control the exact interaction, rather than serve a static file normally here. | CACHING:
|
3.3 CHARACTER_ENCODING_SUPPORT and CHARACTER_ENCODING_USE
The DDC is defined to support only UTF-8 encoding, and hence this test fails if a resource is not encoded in UTF-8. The test does not require that resource always be encoded in UTF-8; the test merely checks that the resource is available in UTF-8 encoding, if requested. Resources may be represented using other encodings where appropriate. This test verifies that a DDC-like device which only accepts UTF-8 encoding may access the resource in UTF-8 encoding.
This test requires that character encoding is explicitly specified and recognizes the following methods of specification:
HTTP
Content-Type
headerapplication/xhtml+xml; charset=UTF-8XML declaration
<?xml version="1.0" encoding="UTF-8" ?>
meta
element that is the first child of the document'shead
element, and whosehttp-equiv
attribute is "Content-Type", and whosecontent
attribute specifies a character encoding... <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/> ...If the HTTP
Content-Type
header specifies a character encoding other than UTF-8, FAILIf the HTTP
Content-Type
header does not specify a character encoding:If there is no XML declaration, or UTF-8 character encoding is not specified in the XML declaration, FAIL
If the HTTP
Content-Type
header specifies an Internet media type starting with "text/":If there is no
meta
element withhttp-equiv
attribute that specifies UTF-8 character encoding, FAILIf character encoding is specified in more than one way, and not all values are the same, FAIL
If the document is not valid UTF-8 (see 2.4.8 Validity), FAIL
For each resource specified by 2.4.6 Included Resources:
Request the resource
If the HTTP
Content-Type
header value of the response starts with "text/" but does not specify UTF-8 character encoding, warn
Test case | Description | Checker result |
---|---|---|
CharacterEncodingSupportTest/1 (source) | FAIL: The HTTP Content-Type header specifies a character encoding other than UTF-8, however, the xml declaration specifies a UTF-8 encoding, so the error for multiple, different declarations of ecoding is also thrown | CHARACTER_ENCODING_SUPPORT:
|
CharacterEncodingSupportTest/2 (source) | FAIL: The HTTP Content-Type header does not specify a character encoding and UTF-8 character encoding is not specified in the XML declaration | CHARACTER_ENCODING_SUPPORT:
|
CharacterEncodingSupportTest/3 (source) | FAIL: The HTTP Content-Type header does not specify a character encoding and yhere is no XML declaration | CHARACTER_ENCODING_SUPPORT:
|
CharacterEncodingSupportTest/4 (source) | FAIL: The HTTP Content-Type header does not specify a character encoding and the HTTP Content-Type header specifies an Internet media type starting with "text/" and there is no meta element with http-equiv attribute that specifies UTF-8 character encoding | CHARACTER_ENCODING_SUPPORT:
|
CharacterEncodingSupportTest/5 (source) | PASS: The Content-Type header does specify the encoding | CHARACTER_ENCODING_SUPPORT: PASS |
CharacterEncodingSupportTest/6 (source) | PASS: The HTTP Content-Type header does not specify a character encoding and the HTTP Content-Type header specifies an Internet media type starting with "text/", but there is a meta element with http-equiv attribute that specifies UTF-8 character encoding. | CHARACTER_ENCODING_SUPPORT: PASS MAIN_DOCUMENT:
|
CharacterEncodingSupportTest/7 (source) | FAIL: The character encoding is specified with two different encodings, see xml-declaration and meta http-equiv | CHARACTER_ENCODING_SUPPORT:
MAIN_DOCUMENT:
|
CharacterEncodingSupportTest/8 (source) | FAIL: the document is not valid UTF-8. | CHARACTER_ENCODING_SUPPORT:
MAIN_DOCUMENT:
|
CharacterEncodingSupportTest/9 (source) | WARN: One of the external stylesheets, included as resource for this page, does not have a Content-Type header WARN: An included resource has a Content-Type header, and it specifies a content type of text/html, but it does not specify a particular character encoding | CHARACTER_ENCODING_SUPPORT:
|
3.4 CONTENT_FORMAT_SUPPORT and VALID_MARKUP
Note:
In the following, an "html document" is a document that has "html" as its root element.
Note:
In the following, "regardless of its stated
DOCTYPE
" means that when assessing validity against the XHTML Basic 1.1 and XHTML MP 1.2 DTDs this may be carried out by inserting aDOCTYPE
if none is present, or by replacing the givenDOCTYPE
with the appropriateDOCTYPE
for the DTD under test.Note:
In the following, "a known XHTML version" means XHTML Basic 1.0, XHTML Basic 1.1, XHTML-MP 1.0, XHTML-MP 1.1 or XHTML-MP 1.2.
If the document's Internet media type, as specified in the HTTP response
Content-Type
header, is not "application/xhtml+xml", "application/vnd.wap.xhtml+xml", or "text/html", FAILIf the document's Internet media type is "text/html" or "application/vnd.wap.xhtml+xml", warn
If the document does not contain a
DOCTYPE
declaration, FAILIf the document is not an HTML document, FAIL
If the
DOCTYPE
is not an XMLDOCTYPE
, warnIf the document is an HTML document and it has an XML
DOCTYPE
:If the document does not declare the html namespace on its html root element, FAIL
If the
DOCTYPE
refers to a known XHTML version, validate against thatDOCTYPE
and if invalid, warnOtherwise (if the
DOCTYPE
is not known), warnIf (regardless of its stated DOCTYPE) the document does not validate against the XHTML Basic 1.1 DTD:
If (regardless of its stated DOCTYPE) it does not validate against the XHTML-MP 1.2 DTD, FAIL
For each included resource (see 2.4.6 Included Resources):
If the response specifies an Internet media type that is not "text/css", "image/jpeg" or "image/gif", FAIL
If an image is required (see also 3.15 OBJECTS_OR_SCRIPT ) and the response specifies an Internet media type that is not "image/jpeg" or "image/gif", FAIL
If the Internet media type is "image/gif" or "image/jpeg", and the resource is not valid (see 2.4.8 Validity), FAIL
If a style sheet is required and the response specifies an Internet media type that is not "text/css", FAIL
If the Internet media type is "text/css" and the content is not valid CSS (see 2.4.8 Validity), FAIL
Test case | Description | Checker result |
---|---|---|
ContentFormatSupportTest/1 (source) | FAIL: the document's media type, as specificed in the HTTP Response Content-Type header, is not "application/xhtml+xml", "application/vnd.wap.xhtml+xml", or "text/html" | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/2 (source) | FAIL: the document does not contain a DOCTYPE declaration | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/3 (source) | WARN: This document uses a non well-known DOCTYPE FAIL: it doesn't validate to XHTML Basic 1.1/MP 1.2. | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/4 (source) | WARN: This document does not validate to its stated DOCTYPE FAIL: nor to a mobile doctype | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/5 (source) | WARN: the document's media type, as specificed in the HTTP Response Content-Type header, is "application/vnd.wap.xhtml+xml" | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/6 (source) | FAIL: an image that is identified through it's HTTPResponse header as a jpeg or gif, but is invalid according to that content type | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/7 (source) | FAIL: includes an image in a non-accepted format (PNG) | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/8 (source) | FAIL: because there is an externally linked file of type "text/css", which is specified as a stylesheet resource, and it does not validate to proper CSS | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/9 (source) | FAIL: this document does not contain a Content-Type header with any value. | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/10 (source) | FAIL: The root html element doesn't have the XHTML namespace set. | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/11 (source) | PASS: a PNG image embedded in a GIF object is OK. | CONTENT_FORMAT_SUPPORT: PASS |
ContentFormatSupportTest/13 (source) | WARN: the doctype is not an XML Doctype WARN: the content-type is text/html | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/14 (source) | A valid XHTML 1.1 document (WARN: not a well-known doctype) | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/15 (source) | A valid XHTML 1.1 document, without FPI (WARN: not a well-known doctype) | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/16 (source) | FAIL: the document is not an HTML document | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/17 (source) | FAIL: the image embedded in the CSS Style is a PNG image | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/18 (source) | FAIL: the stylesheet is not served with a text/css Content-Type and not valid CSS. | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/19 (source) | FAIL: the stylesheet is not served with a text/css Content-Type. | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/20 (source) | FAIL: the image and the objects are not valid GIF images. | CONTENT_FORMAT_SUPPORT:
|
ContentFormatSupportTest/21 (source) | PASS: the page validates against the XHTML MP 1.2 DTD, but not agains the XHTML Basic 1.1 DTD. | CONTENT_FORMAT_SUPPORT: PASS |
ContentFormatSupportTest/22 (source) | FAIL: the image and the objects are not valid GIF images. | CONTENT_FORMAT_SUPPORT:
|
3.5 DEFAULT_INPUT_MODE
Note:
inputmode
is part of [XHTMLBasic11].For each
input
element with attributetype
whose value is "text" or "password" or whosetype
attribute is missing:If the element's
inputmode
attribute is invalid according to Section 5.2 User Agent Behavior of XHTML Basic 1.1 [XHTMLBasic11], FAILIf the element's
value
attribute is missing or empty, and aninputmode
attribute is not present, warnFor each
textarea
element:If the element's
inputmode
attribute is invalid according to Section 5.2 User Agent Behavior of XHTML Basic 1.1 [XHTMLBasic11], FAILIf the element is empty and an
inputmode
attribute is not present, warn
Test case | Description | Checker result |
---|---|---|
DefaultInputModeTest/1 (source) | Valid use of the inputmode attribute (Pass) | DEFAULT_INPUT_MODE: PASS |
DefaultInputModeTest/2 (source) | FAIL: The value of the inputmode attribute is invalid (its secoond token is missing a 'U') | DEFAULT_INPUT_MODE:
|
DefaultInputModeTest/3 (source) | WARN: this input lacks an inputmode attribute and its value attribute is empty | DEFAULT_INPUT_MODE:
|
DefaultInputModeTest/4 (source) | PASS: This input element lacks an input mode value, but it has a non-empty value | DEFAULT_INPUT_MODE: PASS |
DefaultInputModeTest/5 (source) | PASS: this textarea contains a valid inputmode attribute, even though its value is empty | DEFAULT_INPUT_MODE: PASS |
DefaultInputModeTest/6 (source) | WARN: this textarea lacks an inputmode attribute and its text() is empty | DEFAULT_INPUT_MODE:
|
DefaultInputModeTest/7 (source) | WARN: this input (with no type attribute) lacks an inputmode attribute and its value attribute is empty | DEFAULT_INPUT_MODE:
|
3.6 EXTERNAL_RESOURCES
Note:
In the following, include in the count only those objects retrieved under the 3.15.1 Object Element Processing Rule whose
type
attribute is not specified, and those whose content type is either "image/jpeg" or "image/gif" irrespective of whether thetype
attribute is specified.Retrieve the resource under test, and add the number of retrievals required to obtain the resource (see 2.4.3 HTTP Response) to a running total.
For each unique included resource, as defined in 2.4.6 Included Resources:
Request the referenced resource
Add the number of HTTP requests that are required to retrieve the resource (see 2.4.3 HTTP Response) to the running total.
If the total exceeds 10, warn
If this total exceeds 20, FAIL
Test case | Description | Checker result |
---|---|---|
ExternalResourcesTest/1 (source) | FAIL: This document contains references to over 20 different resources | EXTERNAL_RESOURCES:
|
ExternalResourcesTest/2 (source) | WARN: This document references over 10 different external resources, but it does not exceed 20 | EXTERNAL_RESOURCES:
|
ExternalResourcesTest/3 (source) | PASS: this document contains less than 10 references to external resources | EXTERNAL_RESOURCES: PASS |
ExternalResourcesTest/4 (source) | PASS: A single small image is loaded a lot of times (both as object and image). | EXTERNAL_RESOURCES: PASS |
ExternalResourcesTest/5 (source) | PASS: 20 different objects but only the first one is rendered, whilst the other ones are skipped. | EXTERNAL_RESOURCES: PASS |
ExternalResourcesTest/6 (source) | WARN: 10 different images + the resource under test | EXTERNAL_RESOURCES:
|
ExternalResourcesTest/7 (source) | WARN: 11 different background images defined in the CSS (+ the resource under test). | EXTERNAL_RESOURCES:
|
ExternalResourcesTest/8 (source) | WARN: 1 stylesheet + 8 other stylesheets + 1 other stylesheet + resource under test = 11 resources | EXTERNAL_RESOURCES:
|
ExternalResourcesTest/9 (source) | PASS: 1 stylesheet + 8 other stylesheets + resource under test = 10 resources | EXTERNAL_RESOURCES: PASS |
ExternalResourcesTest/10 (source) | PASS: 9 different images among which one image appears twice + the resource under test | EXTERNAL_RESOURCES: PASS |
ExternalResourcesTest/11 (source) | PASS: only objects retrieved under the Object Processing rule with no type attribute and those whose Content-Type is image/jpeg or image/gif are taken into account. | EXTERNAL_RESOURCES: PASS |
ExternalResourcesTest/12 (source) | WARN: all objects retrieved under the Object Processing rule with no type attribute and those whose Content-Type is image/jpeg or image/gif are taken into account. | EXTERNAL_RESOURCES:
|
3.7 GRAPHICS_FOR_SPACING
The intent of this Best Practice is to avoid using transparent images for spacing. However, small transparent images are often used in e-commerce sites for user tracking purposes. The practice is common enough, and possibly vital enough to the business interests of mobile sites, that it is undesirable to fail sites that use such small transparent images. Therefore this machine-testable test merely warns about the presence of small (at most 2x2) transparent images and FAILs larger ones. It is believed that few if any sites would use transparent images of any significant size for tracking.
For each
img
element andobject
element which when retrieved has an Internet media type that starts with "image/":If all pixels are transparent,
If image height and width are both less than or equal to 2 pixels, warn
If either dimension exceeds 2 pixels, FAIL
If more than one image with all transparent pixels was encountered, warn
Test case | Description | Checker result |
---|---|---|
GraphicsForSpacingTest/1 (source) | FAIL: this is a reference to an image that doesn't exist in this directory and therefore has a retrieval error FAIL: this is a transparent image that exceeds the 2x2 limit WARN: this is a small transparent image" | GRAPHICS_FOR_SPACING:
|
GraphicsForSpacingTest/2 (source) | WARN: this is a tiny 2x2 transparent image | GRAPHICS_FOR_SPACING:
|
GraphicsForSpacingTest/3 (source) | PASS: this document contains no transparent images | GRAPHICS_FOR_SPACING: PASS |
GraphicsForSpacingTest/4 (source) | FAIL: This document contains a transparent image that exceeds 2x2 pixels | GRAPHICS_FOR_SPACING:
|
GraphicsForSpacingTest/5 (source) | WARN: only the 2x2 transparent image should be tested, the large ones are not Included Resources | GRAPHICS_FOR_SPACING:
|
3.8 IMAGE_MAPS
If an
input
element withtype
attribute set to "image" is present, FAILFor each
img
element andobject
element:If a
usemap
attribute is present, FAILIf an
ismap
attribute is present, FAIL
Test case | Description | Checker result |
---|---|---|
ImageMapsTest/1 (source) | FAIL: this image contains a usemap attribute | IMAGE_MAPS:
|
ImageMapsTest/2 (source) | FAIL: this object contains an ismap attribute | IMAGE_MAPS:
|
ImageMapsTest/3 (source) | FAIL: this page contains an input element with a type attribute equal to "image" | IMAGE_MAPS:
|
ImageMapsTest/4 (source) | FAIL: an input element is defined with type "image" Note that the "ismap" attributes defined on the objects and images don't trigger any FAIL, because they are defined on resources that are not Included Resources | IMAGE_MAPS:
|
3.9 IMAGES_RESIZING and IMAGES_SPECIFY_SIZE
Note:
The
height
andwidth
HTML attributes specify pixels when they are used as a number. No unit is specified.For each
img
element andobject
element whosetype
attribute starts with "image/":If the
height
orwidth
attribute are missing, FAILIf the
height
orwidth
attribute do not specify a size in pixels, FAILIf the value specified by either the height or width attribute is greater than the corresponding dimension of the image, warn
If the value specified by either the height or width attribute is less than the corresponding dimension of the image, FAIL
Test case | Description | Checker result |
---|---|---|
ImagesSpecifySizeTest/1 (source) | FAIL: this image is missing its height attribute | IMAGES_SPECIFY_SIZE:
|
ImagesSpecifySizeTest/2 (source) | FAIL: this image's height attribute contains a value that is not specified in pixels | IMAGES_SPECIFY_SIZE:
|
ImagesSpecifySizeTest/3 (source) | 2 FAIL: the width of this image is not recognized as being as number and then generates the error that this "not a number" is less than the real width of the picture WARN: the height specified is bigger than the image's real height | IMAGES_SPECIFY_SIZE:
|
ImagesSpecifySizeTest/4 (source) | WARN: both the height and width of this image are specified at sizes far larger than its actual size | IMAGES_SPECIFY_SIZE:
|
ImagesSpecifySizeTest/5 (source) | FAIL: both the height and width specified are smaller than the image's actual dimensions | IMAGES_SPECIFY_SIZE:
|
ImagesSpecifySizeTest/6 (source) | Pass: an image properly marked up. | IMAGES_SPECIFY_SIZE: PASS |
ImagesSpecifySizeTest/7 (source) | If the HTTP status indicates that authentication is required (e.g. status code 401): If the response relates to a request for the resource under test, or any of its included resources (see 2.4.6 Included Resources): If authentication information was supplied in the HTTP request (i.e. authentication failed), FAIL [HTTP_RESPONSE_7] | IMAGES_SPECIFY_SIZE:
|
ImagesSpecifySizeTest/8 (source) | FAIL: this image (whose uri proper resolution depends on a <base href>) doesn't have the right dimensions set in the markup. | IMAGES_SPECIFY_SIZE:
|
ImagesSpecifySizeTest/9 (source) | FAIL: this image (whose uri proper resolution depends on resolving the URI after a redirect) doesn't have the right dimensions set in the markup. | IMAGES_SPECIFY_SIZE:
|
ImagesSpecifySizeTest/10 (source) | PASS: the checker does not check all images only those that are "Included Resources" | IMAGES_SPECIFY_SIZE: PASS |
ImagesSpecifySizeTest/11 (source) | PASS: The test should only be applied to Included Resources | IMAGES_SPECIFY_SIZE: PASS |
ImagesSpecifySizeTest/12 (source) | WARN: one of the dimensions is greater than the actual dimension of the image. | IMAGES_SPECIFY_SIZE:
|
ImagesSpecifySizeTest/13 (source) | FAIL: the dimensions of the objects are set lower than its actual dimensions. WARN: and greater in another instance | IMAGES_SPECIFY_SIZE:
|
3.10 LINK_TARGET_FORMAT
Note:
404 and 5xx HTTP status do not result in failure when conducting this test.
Note:
The document body of linked resources is not examined.
For each linked resource, as defined in 2.4.7 Linked Resources:
Request the resource
If the
Content-Type
header value of the HTTP response is not one of the Internet Media Types listed in theAccept
header in 2.4.2 HTTP Request, warnIf the
Content-Type
header value of the HTTP response does not specify acharset
parameter, or does but it is not consistent with the value of theAccept-Charset
header in 2.4.2 HTTP Request, warnFor each document internal reference (links in the document under test that refer to the document itself):
If there is no target for the reference or it is invalid (e.g. '#'), warn
Test case | Description | Checker result |
---|---|---|
LinkTargetFormatTest/1 (source) | WARN: An internal link doesn't have a matching anchor. | LINK_TARGET_FORMAT:
|
LinkTargetFormatTest/2 (source) | WARN: There is a link to a PNG image. | LINK_TARGET_FORMAT:
|
LinkTargetFormatTest/3 (source) | WARN: there is a link to a non-UTF-8 resource. | LINK_TARGET_FORMAT:
|
LinkTargetFormatTest/4 (source) | WARN: A link triggered a 404. | LINK_TARGET_FORMAT:
|
LinkTargetFormatTest/5 (source) | WARN: The HTTP status code is 404 or 5xx and the response relates to a request for a linked resource [HTTP_RESPONSE-9] | LINK_TARGET_FORMAT:
|
LinkTargetFormatTest/6 (source) | WARN: The HTTP status indicates that authentication is required (e.g. status code 401) and the response relates to a request for a linked resource [HTTP_RESPONSE-12] | LINK_TARGET_FORMAT:
|
LinkTargetFormatTest/7 (source) | WARN: The response is an HTTPS response and the certificate has expired:[HTTP_RESPONSE-3] | LINK_TARGET_FORMAT:
|
Test case | Description | Checker result |
---|---|---|
MainDocumentTest/1 (source) | WARN: A matching HTTP response header does not exist for a meta http-equiv | MAIN_DOCUMENT:
|
MainDocumentTest/2 (source) | FAIL: The HTTP status (in response to the resource PLACEHOLDER_1)indicates redirection (status code 3xx) and there is no HTTP Location header | MAIN_DOCUMENT:
|
MainDocumentTest/3 (source) | WARN: The HTTP status (in response to the resource PLACEHOLDER_1)indicates redirection (status code 3xx) and the URI identified by the HTTP Location header is a relative URI | MAIN_DOCUMENT:
|
MainDocumentTest/4 (source) | HTTP_RESPONSE-8 WARN: The HTTP status code is 404 or 5xx (in response to the resource PLACEHOLDER_1) and the response relates to a request for the resource under test | MAIN_DOCUMENT:
|
MainDocumentTest/5 (source) | HTTP_RESPONSE-11 FAIL: The the HTTP status represents failure (4xx), other than 404 or a request for authentication (e.g. 401), (in response to the resource PLACEHOLDER_1) | MAIN_DOCUMENT:
|
MainDocumentTest/6 (source) | PASS (URIs are dereferenced using the base href). | MAIN_DOCUMENT: PASS |
MainDocumentTest/7 (source) | HTTP_RESPONSE-7 FAIL: If the HTTP status indicates that authentication is required (e.g. status code 401): and the response relates to a request for the resource under test, or any of its included resources and the authentication information was supplied in the HTTP request (i.e. authentication failed) | MAIN_DOCUMENT:
|
MainDocumentTest/8 (source) | WARN: WARN: A matching HTTP response header exists but its value differs from the content attribute value [META_HTTP_EQUIV_2] | MAIN_DOCUMENT:
|
3.11 MEASURES
Note:
The intrinsic size of images must be specified as attributes of the
img
element and not as CSS properties (see 3.9 IMAGES_RESIZING and IMAGES_SPECIFY_SIZE)Note:
Only CSS Level 1 properties are considered in this test.
For each CSS Level 1 property in the CSS Style ( 2.4.5 CSS Style) whose value is a numeric measure of length stated together with a unit:
If the value is non-zero and the unit is not "em" or "ex" (and the value is not a percentage), and the property is not a margin, border or padding box property, FAIL
Test case | Description | Checker result |
---|---|---|
MeasuresTest/1 (source) | FAIL: A linked style sheet (through the XML PI) includes CSS lenths in absolute units. | MEASURES:
|
MeasuresTest/2 (source) | FAIL: This test cases uses embedded style sheets with absolute units. (The last embedded style sheet won't matter since it uses a non-mobile media). | MEASURES:
|
MeasuresTest/3 (source) | FAIL: This test cases uses inline style sheets with absolute units. | MEASURES:
|
MeasuresTest/4 (source) | FAIL: This test cases uses embedded and inline style sheets, one of which uses absolute units. | MEASURES:
|
MeasuresTest/5 (source) | FAIL: This test cases uses a linked style sheet which uses absolute units. | MEASURES:
|
MeasuresTest/6 (source) | Test that CSS case-insensitivity and spaces are taken into account FAIL: a CSS rule uses an absolute unit: font-size: 12pt | MEASURES:
|
MeasuresTest/7 (source) | Ensures that the MEASURES test only applies on CSS Level 1 properties (not taking into account border, margin, and padding properties and those whose values cannot be numeric measures of length) FAIL: absolute unit for the font-size property FAIL: absolute unit for the font property (font-size part) FAIL: absolute unit for the font property (line-height part) FAIL: absolute unit for the word-spacing property FAIL: absolute unit for the letter-spacing property FAIL: absolute unit for the text-indent property FAIL: absolute unit for the line-height property FAIL: absolute unit for the width property FAIL: absolute unit for the height property | MEASURES:
|
3.12 MINIMIZE
Note:
Extraneous white space characters in script and in CSS are not considered in this test. Such an extension may be considered in a future revision of this specification.
Count number of white space characters (see 2.4.9 White Space) in a sequence of more than one white space character (not counting the first), which exist outside of a
pre
,style
,script
element, or XML commentAdd to this count the number of characters comprising XML comments. This total is the number of extraneous characters in the document.
Count total number of characters in document
If the number of extraneous characters exceeds 10% of the count of characters in the document, warn
If the number of extraneous characters exceeds 25% of the count of characters in the document, FAIL
Test case | Description | Checker result |
---|---|---|
MinimizeTest/1 (source) | WARN: (exactly) More than 10% of the page characters are extraneous whitespaces. | MINIMIZE:
|
MinimizeTest/2 (source) | WARN: the page has exactly 25% of extraneous whitespace (so more than 10%, but not more than 25%) | MINIMIZE:
|
MinimizeTest/3 (source) | FAIL: (exactly) More than 25% of the page characters are extraneous whitespaces | MINIMIZE:
|
MinimizeTest/4 (source) | WARN: More than 10% of the page characters are extraneous comments | MINIMIZE:
|
MinimizeTest/5 (source) | WARN: More than 10% of the page characters are extraneous whitespaces (inside an XML element) | MINIMIZE:
|
MinimizeTest/6 (source) | PASS: Extraneous characters in CSS aren't counted | MINIMIZE: PASS |
MinimizeTest/7 (source) | PASS: Extraneous characters in CSS aren't counted | MINIMIZE: PASS |
3.13 NO_FRAMES
If the document contains a
frame
,frameset
oriframe
element or it contains anobject
element which when retrieved has an Internet media type that starts with "text/", "application/xhtml+xml" or "application/vnd.wap.xhtml+xml", FAIL
Test case | Description | Checker result |
---|---|---|
NoFramesTest/1 (source) | FAIL: The document contains a frameset FAIL: The document contains a frame FAIL: The document contains an iframe | NO_FRAMES:
|
3.14 NON-TEXT_ALTERNATIVES
This test does not determine whether the alternative text is meaningful.
Note:
An empty
alt
attribute is acceptable and signifies that there is no meaningful textual alternative, for example for images that are purely decorative.For each
img
element:If an
alt
attribute is not present or contains only white space, FAIL
Test case | Description | Checker result |
---|---|---|
NonTextAlternativesTest/1 (source) | FAIL: The alt attribute is missing FAIL: The alt attribute consists only of white space | NON_TEXT_ALTERNATIVES:
|
NonTextAlternativesTest/2 (source) | PASS: The image has an acceptable alt attribute. | NON_TEXT_ALTERNATIVES: PASS |
3.15 OBJECTS_OR_SCRIPT
This test does not determine whether the document is still usable without the objects or scripts.
If a
script
element is present, warnIf any element has an "intrinsic event" attribute (currently
onload
,onunload
,onclick
,ondblclick
,onmousedown
,onmouseup
,onmouseover
,onmousemove
,onmouseout
,onfocus
,onblur
,onkeypress
,onkeydown
,onkeyup
,onsubmit
,onreset
,onselect
,onchange
), warnFor each
a
andlink
element:If the value of the
href
attribute begins with the "javascript:" scheme, FAILIf an
applet
element is present, FAILSet the context to the root element and apply the Object Element Processing Rule
3.15.1 Object Element Processing Rule
For each object element that has no object element ancestor in this context (excepting the context node itself):
Retrieve the object (ignoring the type attribute)
If the content type of the retrieved object is not "image/jpeg" or "image/gif"
If the object element is empty, warn
If the content of the object element consists only of white space, FAIL
For each
img
element that has noobject
element ancestor in this context:If the content type of the
img
element is not "image/jpeg" or "image/gif", FAILReapply this rule using the current object element as the context
Test case | Description | Checker result |
---|---|---|
ObjectsOrScriptTest/1 (source) | WARN: The document uses scripting twice (<script> elements in head and body) FAIL: A "javascript:" link is used WARN: An element uses an event attribute FAIL: The document uses an applet | OBJECTS_OR_SCRIPT:
|
ObjectsOrScriptTest/2 (source) | WARN: an object element is empty FAIL: the content of an object element consists only of white space WARN: an object element is defined without type attribute WARN: the Content-Type of a retrieved object does not match that stated in the type attribute WARN: the Content-Type of a retrieved object is neither image/jpeg nor image/gif | OBJECTS_OR_SCRIPT:
|
ObjectsOrScriptTest/3 (source) | PASS: the PNG object has a valid GIF fallback | OBJECTS_OR_SCRIPT:
|
ObjectsOrScriptTest/4 (source) | PASS: the fallback objects do not have to be tasted, and are ignored by the Checker. The image should be ignored as well. | OBJECTS_OR_SCRIPT: PASS |
ObjectsOrScriptTest/5 (source) | PASS with WARN: All objects have to be parsed, and each of them triggers at least one warning. | OBJECTS_OR_SCRIPT:
|
3.16 PAGE_SIZE_LIMIT
Note:
In the following, include in the total only those objects retrieved under the 3.15.1 Object Element Processing Rule whose
type
attribute is not specified, and those whose content type is either "image/jpeg" or "image/gif" irrespective of whether thetype
attribute is specified.If the size of the document exceeds 10 kilobytes, FAIL
Add the size to a running total
For each unique included resource, as defined in 2.4.6 Included Resources:
Request the referenced resource
Add the size of the response body to the running total
If the total exceeds 20 kilobytes, FAIL
Test case | Description | Checker result |
---|---|---|
PageSizeLimitTest/1 (source) | FAIL: the main document weights more than 10 KB. | PAGE_SIZE_LIMIT:
|
PageSizeLimitTest/2 (source) | FAIL: The size of external resources makes the page weight more than 20 KB. | PAGE_SIZE_LIMIT:
|
PageSizeLimitTest/3 (source) | FAIL: The size of external resources makes the page weight more than 20 KB. | PAGE_SIZE_LIMIT:
|
PageSizeLimitTest/4 (source) | PASS: There is a big image, but it's not loaded since inside an object that is valid. | PAGE_SIZE_LIMIT: PASS |
PageSizeLimitTest/5 (source) | FAIL: Both the PNG and the GIF images needs to be loaded (since the PNG type isn't specified), makign the page too big. | PAGE_SIZE_LIMIT:
|
PageSizeLimitTest/6 (source) | PASS: There is a big image, but it's not loaded since inside an object that is valid. | PAGE_SIZE_LIMIT: PASS |
PageSizeLimitTest/7 (source) | FAIL: The redirect page is big (24KB), and makes the total page size fail. | PAGE_SIZE_LIMIT:
|
PageSizeLimitTest/8 (source) | PASS: A single small image is loaded 20 times. | PAGE_SIZE_LIMIT: PASS |
PageSizeLimitTest/9 (source) | PASS: But there is an object nesting with a huge image that is not considered as an Included Resource | PAGE_SIZE_LIMIT: PASS |
3.17 PAGE_TITLE
This test does not determine whether the title is meaningful.
If a
title
element is not present in thehead
element, or is empty, or contains only white space (see 2.4.9 White Space), FAIL
Test case | Description | Checker result |
---|---|---|
PageTitleTest/1 (source) | FAIL: There is no title element. | PAGE_TITLE:
|
PageTitleTest/2 (source) | FAIL: the title element is empty | PAGE_TITLE:
|
PageTitleTest/3 (source) | FAIL: the title element consists only of whitespace. | PAGE_TITLE:
|
PageTitleTest/4 (source) | PASS: the page title is set correctly. | PAGE_TITLE: PASS |
3.18 POP_UPS
For each
a
,link
,form
, andbase
element:If a
target
attribute is present,If its value is not one of "_self", "_parent", or "_top", FAIL
Test case | Description | Checker result |
---|---|---|
PopUpsTest/1 (source) | PASS: no pop up is used on this page | POP_UPS: PASS |
PopUpsTest/2 (source) | FAIL: a pop-up is created using target="_blank" on a link. | POP_UPS:
|
PopUpsTest/3 (source) | FAIL: A pop-up is created through the target attribute on a form. | POP_UPS:
|
PopUpsTest/4 (source) | FAIL: Pop-up are created through the target attribute on the <base> element. | POP_UPS:
|
PopUpsTest/5 (source) | FAIL: a pop-up is created using target="_blank" on a link. | POP_UPS:
|
PopUpsTest/6 (source) | PASS: the target attributes on the links used authorized values. | POP_UPS: PASS |
3.19 PROVIDE_DEFAULTS
In addition, a human-verifiable test is needed here to verify whether such elements could be replaced with alternative control elements.
For each radio button group within a
form
element (input
elements withtype
"radio" that share the samename
attribute value):Check that exactly one
input
element within this group has itschecked
attribute set to "checked", and if this is not the case, warnFor each
select
element:If there is no nested
option
element whoseselected
attribute is set to "selected", warnIf there is more than one
option
element whoseselected
attribute is set to "selected", and themultiple
attribute is not set to "multiple", warn
Test case | Description | Checker result |
---|---|---|
ProvideDefaultsTest/1 (source) | WARN: PROVIDE_DEFAULTS - No default select option | PROVIDE_DEFAULTS:
|
ProvideDefaultsTest/2 (source) | PASS: PROVIDE_DEFAULTS - 1 default radio | PROVIDE_DEFAULTS: PASS |
ProvideDefaultsTest/3 (source) | WARN: PROVIDE_DEFAULTS - Multiple default radios | PROVIDE_DEFAULTS:
|
ProvideDefaultsTest/4 (source) | WARN: PROVIDE_DEFAULTS - No default select option | PROVIDE_DEFAULTS:
|
ProvideDefaultsTest/5 (source) | PASS: PROVIDE_DEFAULTS - 1 default select option | PROVIDE_DEFAULTS: PASS |
ProvideDefaultsTest/6 (source) | WARN: PROVIDE_DEFAULTS - Multiple default select options | PROVIDE_DEFAULTS:
|
3.20 STYLE_SHEETS_SUPPORT
In addition, a human test is needed here to verify whether the page is readable without a style sheet.
If the CSS Style ( 2.4.5 CSS Style) contains rules referencing the
position
,display
orfloat
properties, warn
Test case | Description | Checker result |
---|---|---|
StyleSheetsSupportTest/1 (source) | WARN: This stylesheet contains illegal inline references to position, display and float properties | STYLE_SHEETS_SUPPORT:
|
StyleSheetsSupportTest/2 (source) | WARN: This tests an embedded stylesheet for illegal references to position, display, and float | STYLE_SHEETS_SUPPORT:
|
StyleSheetsSupportTest/3 (source) | WARN: this tests external stylesheets for illegal position, display, and float properties | STYLE_SHEETS_SUPPORT:
|
StyleSheetsSupportTest/4 (source) | This test uses a style sheet with a float property used inside a css comment - this should raise no warning. | STYLE_SHEETS_SUPPORT: PASS |
StyleSheetsSupportTest/5 (source) | Check that CSS case-insensitivity is taken into account: WARN: The CSS Style uses position WARN: The CSS Style uses display WARN: The CSS Style uses float WARN: The CSS Style uses a non CSS Level 1 property (position) | STYLE_SHEETS_SUPPORT:
|
3.21 STYLE_SHEETS_USE
This test looks for elements in the Text Extension module defined by [XHTMLModularization], some of which are not supported in XHTML Basic [XHTMLBasic11]. It also looks for commonly-used elements and attributes that were deprecated in HTML 4, and are not supported, or are deprecated, in XHTML Basic.
Note:
This test does not require that any CSS styles be used, since in some cases, no presentation information is required at all (for example, a simple page of text).
Note:
The tests on CSS property values only apply to properties defined by CSS Level 1; other properties are ignored for the purposes of this test.
If the document contains any
basefont
,bdo
,center
,del
,dir
,font
,ins
,menu
,s
,strike
oru
elements, FAILIf the document contains any
b
,big
,i
,small
,sub
,sup
ortt
elements, warnIf any element has a
style
attribute, warnIf there is CSS Style ( 2.4.5 CSS Style)
If all styles are restricted to media types other than "handheld" or "all" by means of @media at-rules, warn
If the CSS Style contains at-rules (other than the
@media
at-rule, and the media list of the@import
at-rule), properties, or values that are not recognized as being specified in CSS Level 1, warnIf the CSS Style contains a property with a value that is inappropriate to it, warn
If the CSS Style contains a property with a value that requires a unit or a percentage:
If the unit (or percentage) is not present, warn
If the unit (or percentage) is inappropriate to the value, warn
Test case | Description | Checker result |
---|---|---|
StyleSheetsUseTest/1 (source) | This testcase uses the <center element (FAIL), uses a <b> element (WARN), and uses the style attribute (WARN). | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/2 (source) | This testcase uses the <center> element (FAIL), uses a <b> element (WARN), and uses the style attribute (WARN). | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/3 (source) | WARN: Embebbed style restricted by @media to screen.STYLE_SHEETS_USE-4 | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/4 (source) | FAIL: Embebbed style with no suitable styles for handheld devices (a empty @media handheld). | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/5 (source) | PASS: Embebbed style with a @media handheld. | STYLE_SHEETS_USE: PASS |
StyleSheetsUseTest/6 (source) | FAIL: The document contains a basefont element FAIL: The document contains a bdo element FAIL: The document contains a center element FAIL: The document contains a del element FAIL: The document contains a dir element FAIL: The document contains a font element FAIL: The document contains an ins element FAIL: The document contains a menu element FAIL: The document contains an s element FAIL: The document contains a strike element FAIL: The document contains a u element | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/7 (source) | WARN: The document contains a b element WARN: The document contains a big element WARN: The document contains an i element WARN: The document contains a small element WARN: The document contains a sub element WARN: The document contains a sup element WARN: The document contains a tt element | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/8 (source) | WARN: The CSS Style uses the unknown at-media rule "unknown" WARN: The CSS Style uses the "unknown" unknown property WARN: The CSS Style uses an unknown dimension "pints" WARN: The CSS Style uses the value "right" for the property "height" WARN: The CSS Style uses the value "ontheleft" for the property "text-align" | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/9 (source) | PASS: Some CSS style applies to all presentations. | STYLE_SHEETS_USE: PASS |
StyleSheetsUseTest/10 (source) | WARN: Some styles are defined, but no CSS style applies to handheld or all presentations. | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/11 (source) | WARN: some embedded CSS styles are defined and none of them applies to handheld or all presentations. | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/12 (source) | PASS: CSS embedded styles (style tag) are taken as a whole. | STYLE_SHEETS_USE: PASS |
StyleSheetsUseTest/13 (source) | WARN:The imported CSS should raise a STYLE_SHEETS_USE 4 Warning as is restricted to tv media (by @media rule) | STYLE_SHEETS_USE:
|
StyleSheetsUseTest/14 (source) | WARN: The TV stylesheet only defines styles that apply to representations other than "all" or "handheld". | STYLE_SHEETS_USE:
|
3.22 TABLES_ALTERNATIVES
If a
table
element exists, warn
Test case | Description | Checker result |
---|---|---|
TablesAlternativesTest/1 (source) | WARN: there is a table. | TABLES_ALTERNATIVES:
|
TablesAlternativesTest/2 (source) | PASS: there is no table. | TABLES_ALTERNATIVES: PASS |
3.23 TABLES_LAYOUT
This test does not catch all cases where tables are used for layout purposes.
For each
table
element:If it contains at most one
tr
element, FAILIf no
tr
element contains more than onetd
element, FAILFor each nested
td
element:If the element contains only an image (or equivalent object) whose actual dimensions are 2x2 or less, FAIL
Test case | Description | Checker result |
---|---|---|
TablesLayoutTest/1 (source) | FAIL: The table has only one row. | TABLES_LAYOUT:
|
TablesLayoutTest/2 (source) | FAIL: The table has only one column. | TABLES_LAYOUT:
|
TablesLayoutTest/3 (source) | A table where only one row has two columns, Pass. | TABLES_LAYOUT: PASS |
TablesLayoutTest/4 (source) | FAIL: The table contains a cell containing an image of which at least one of the actual dimensions is less than 2 px. | TABLES_LAYOUT:
|
3.24 TABLES_NESTED
For each
table
element:If it contains a
table
element, FAIL
Test case | Description | Checker result |
---|---|---|
TablesNestedTest/1 (source) | a table nested in another one (FAIL) | TABLES_NESTED:
|
TablesNestedTest/2 (source) | A simple table (Pass) | TABLES_NESTED: PASS |
Copyright © 2008 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use rules apply.