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
metaelement is present withhttp-equivattribute value of "refresh",If the URI specified as part of the
contentattribute is not the current resource's URI, FAILElse, warn
If a
RefreshHTTP 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:
|
| 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
metaelement withhttp-equivattribute 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
ExpiresnorCache-ControlheaderIf no
meta http-equivelement is present, referring to those headers, FAILContinue the test using the value from the
metacontentattribute as though it were specified in the appropriate header, warnIf a
Cache-ControlHTTP header is present and contains value "no-cache", or contains value "max-age=0", warnIf a
PragmaHTTP header is present and contains value "no-cache", warnIf an
ExpiresandDateHTTP header are present, and theExpiresheader specifies a date which is not later than what theDateheader specifies, warnIf any cache related header contains an invalid value, warn
If the HTTP response contains a
Last-Modifiedheader,Request the same URI again, adding an
If-Modified-Sincerequest header whose value matches that of theLast-Modifiedresponse headerIf the HTTP response contains a
Last-Modifiedheader and its value is again the same, and the HTTP response status is not 304 (Not Modified), warnIf the HTTP response contains an
ETagheader,Request the same URI again, adding an
If-None-Matchrequest header whose value matches that of theETagresponse headerIf the HTTP response contains an
ETagheader 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:
|
| 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-Typeheaderapplication/xhtml+xml; charset=UTF-8XML declaration
<?xml version="1.0" encoding="UTF-8" ?>
metaelement that is the first child of the document'sheadelement, and whosehttp-equivattribute is "Content-Type", and whosecontentattribute specifies a character encoding... <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/> ...If the HTTP
Content-Typeheader specifies a character encoding other than UTF-8, FAILIf the HTTP
Content-Typeheader 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-Typeheader specifies an Internet media type starting with "text/":If there is no
metaelement withhttp-equivattribute 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-Typeheader 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 |
| CharacterEncodingSupportTest/7 (source) | FAIL: The character encoding is specified with two different encodings, see xml-declaration and meta http-equiv | CHARACTER_ENCODING_SUPPORT:
|
| CharacterEncodingSupportTest/8 (source) | FAIL: the document is not valid UTF-8. | CHARACTER_ENCODING_SUPPORT:
|
| 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 aDOCTYPEif none is present, or by replacing the givenDOCTYPEwith the appropriateDOCTYPEfor 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-Typeheader, 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
DOCTYPEdeclaration, FAILIf the document is not an HTML document, FAIL
If the
DOCTYPEis 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
DOCTYPErefers to a known XHTML version, validate against thatDOCTYPEand if invalid, warnOtherwise (if the
DOCTYPEis 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/12 (source) | CONTENT_FORMAT_SUPPORT: PASS MAIN_DOCUMENT:
| |
| 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:
|
3.5 DEFAULT_INPUT_MODE
Note:
inputmodeis part of [XHTMLBasic11].For each
inputelement with attributetypewhose value is "text" or "password" or whosetypeattribute is missing:If the element's
inputmodeattribute is invalid according to Section 5.2 User Agent Behavior of XHTML Basic 1.1 [XHTMLBasic11], FAILIf the element's
valueattribute is missing or empty, and aninputmodeattribute is not present, warnFor each
textareaelement:If the element's
inputmodeattribute is invalid according to Section 5.2 User Agent Behavior of XHTML Basic 1.1 [XHTMLBasic11], FAILIf the element is empty and an
inputmodeattribute 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:
|
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
typeattribute is not specified, and those whose content type is either "image/jpeg" or "image/gif" irrespective of whether thetypeattribute 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 |
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
imgelement andobjectelement 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:
|
3.8 IMAGE_MAPS
If an
inputelement withtypeattribute set to "image" is present, FAILFor each
imgelement andobjectelement:If a
usemapattribute is present, FAILIf an
ismapattribute 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:
|
3.9 IMAGES_RESIZING and IMAGES_SPECIFY_SIZE
Note:
The
heightandwidthHTML attributes specify pixels when they are used as a number. No unit is specified.For each
imgelement andobjectelement whosetypeattribute starts with "image/":If the
heightorwidthattribute are missing, FAILIf the
heightorwidthattribute 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:
|
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-Typeheader value of the HTTP response is not one of the Internet Media Types listed in theAcceptheader in 2.4.2 HTTP Request, warnIf the
Content-Typeheader value of the HTTP response does not specify acharsetparameter, or does but it is not consistent with the value of theAccept-Charsetheader 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) | Tests handling of <base href="..."/> element. | |
| 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
imgelement 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) | 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,scriptelement, 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,framesetoriframeelement or it contains anobjectelement 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:
|
| NoFramesTest/2 (source) | FAIL: The document contains a object element whose type attribute starts with "text/", "application/xhtml+xml" or "application/vnd.wap.xhtml+xml" | NO_FRAMES:
|
3.14 NON-TEXT_ALTERNATIVES
This test does not determine whether the alternative text is meaningful.
Note:
An empty
altattribute is acceptable and signifies that there is no meaningful textual alternative, for example for images that are purely decorative.For each
imgelement:If an
altattribute is not present or contains only white space, FAIL
| Test case | Description | Checker result |
|---|---|---|
| NonTextAlternativesTest/1 (source) | 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
scriptelement 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
aandlinkelement:If the value of the
hrefattribute begins with the "javascript:" scheme, FAILIf an
appletelement 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
imgelement that has noobjectelement ancestor in this context:If the content type of the
imgelement 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) | FAIL: A set of objects that have wrong fallbacks: empty (warn), whitespaces (fail), images in non-supported format (fail). | OBJECTS_OR_SCRIPT:
|
| ObjectsOrScriptTest/3 (source) | PASS: the PNG object has a valid GIF fallback | OBJECTS_OR_SCRIPT: PASS |
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
typeattribute is not specified, and those whose content type is either "image/jpeg" or "image/gif" irrespective of whether thetypeattribute 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:
|
3.17 PAGE_TITLE
This test does not determine whether the title is meaningful.
If a
titleelement is not present in theheadelement, 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, andbaseelement:If a
targetattribute 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
formelement (inputelements withtype"radio" that share the samenameattribute value):Check that exactly one
inputelement within this group has itscheckedattribute set to "checked", and if this is not the case, warnFor each
selectelement:If there is no nested
optionelement whoseselectedattribute is set to "selected", warnIf there is more than one
optionelement whoseselectedattribute is set to "selected", and themultipleattribute 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,displayorfloatproperties, 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_SHEET |