You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



You are here: Test Case Description for applets within <object> tag > Test Case #7 for applets within <object>: relative height

Applets: OBJECT (relative height)

This test case tests the <object> tag with its height attribute which, similar to the <img> tag, explicitly specifies the height of the java applet. The height attribute can either be an absolute height using an integer value of pixels or a relative height using a relative percentage value.

If the height attribute of an <object> is using a relative height and if the height of its containing block is not specified explicitly (i.e., it depends on content height), then the height of the <object> will compute to "auto". When this case happens, then the height refers to the intrinsic height for <object> which is 0px. Therefore, if the height attribute of an <object> is using a relative height, then the height of its containing block should be specified explicitly.

Test Case #1: sample java applet dimension scaling using relative heights
(using <object codebase=class pathname data="class name" height=percent value> </object>)

Java Applet Dimensions Scaled Down (Reverse Scaling)

Original object (with an height of 80px)

Object height="75%" within a <p> with a specified height of 400px

Object height="50%" within a <p> with a specified height of 400px

Object height="25%" within a <p> with a specified height of 400px

Object height="50%" within a <p> that has no specified height, with an auto-height <p>

The last <object>, just above, should NOT BE DISPLAYED.