Object test

General style rules: outer object elements have a red border, nested objects a green border, doubly nested a blue border; all fallback text is in a span element within the object and is styled with a yellow background. Spans that are not in an object (and this is the only one) are styled with a pink background.

  1. Using img to display the image: correct

  2. Now with object, with a correct type attribute. You should see the word CORRECT! here (with a red border added by the style sheet to all objects): Incorrect!

  3. The same case, but without using the 'type' attribute. It should give the identical result: Incorrect!

  4. A missing image, the URL is to a nonexistent document: you should see the fallback text (which says "Correct!) with a yellow background (added by the stylesheet to all fallback text, and the border added to the object): Correct!

  5. The type attribute says it is an unknown type, and it really is. You should see the fallback text instead (which starts "This is the fallback text.") This is the fallback text. If you can read this, the browser has correctly ignored an image of unknown type. (This text should have a yellow, not pink, background, and have a red border)

  6. Now an object, with the same image, but incorrectly with a non-existent type attribute (image/foo). Since the type attribute is only a hint, if you see the image (correct!) the browser has ignored the type attribute and decided it could process the image anyway. If you see the fallback text it has used the type attribute and decided it doesn't know how to process the image. Either behaviour is acceptable: If you can read this, the browser has correctly decided on the basis of the 'type' attribute that it can't treat an image of type "image/foo" (even though the image was actually a gif) (This text should have a yellow, not pink, background, and have a red border).

  7. A nonsense file, it should not try to display the image, but display the alternate text instead (which starts "If you can read this,"): If you can read this, the browser has correctly handled the case of an image that it couldn't handle.

  8. The type attribute says it's a gif, but it isn't (it's a nonsense file). Since the 'type' attribute is only advisory, it should not try to display the image, but display the alternate text instead (which starts "If you can read this,"): If you can read this, the browser has correctly handled the case of an image that it couldn't handle despite the type attribute saying it was a type it could handle.

  9. Nested gifs. You should see the word "CORRECT!", from the outer nested object, and nothing else: You shouldn't be able to see this text

  10. Four nested objects. The outer one is garbage (non-existent type, garbage file). The next one is the correct one. The next two should therefore be ignored. Therefore you should only see the word "CORRECT!" once: You shouldn't be able to see this text