Annotation of html5/spec/the-object-element.html, revision 1.179
1.88 mike 1: <!DOCTYPE html>
1.159 sruby 2: <html lang="en-US-x-Hixie"><head><title>4.8.4 The object element — HTML5</title><style type="text/css">
1.1 mike 3: pre { margin-left: 2em; white-space: pre-wrap; }
4: h2 { margin: 3em 0 1em 0; }
5: h3 { margin: 2.5em 0 1em 0; }
6: h4 { margin: 2.5em 0 0.75em 0; }
7: h5, h6 { margin: 2.5em 0 1em; }
8: h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
9: h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
10: p { margin: 1em 0; }
11: hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
12: dl, dd { margin-top: 0; margin-bottom: 0; }
13: dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
14: dt + dt { margin-top: 0; }
15: dd dt { margin-top: 0.25em; margin-bottom: 0; }
16: dd p { margin-top: 0; }
17: dd dl + p { margin-top: 1em; }
18: dd table + p { margin-top: 1em; }
19: p + * > li, dd li { margin: 1em 0; }
20: dt, dfn { font-weight: bold; font-style: normal; }
21: i, em { font-style: italic; }
22: dt dfn { font-style: italic; }
23: pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
24: pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
25: pre em { font-weight: bolder; font-style: normal; }
26: @media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
27: var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
28: table { border-collapse: collapse; border-style: hidden hidden none hidden; }
29: table thead, table tbody { border-bottom: solid; }
30: table tbody th:first-child { border-left: solid; }
31: table tbody th { text-align: left; }
32: table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
33: blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }
34:
35: .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
36: .matrix, .matrix td { border: none; text-align: right; }
37: .matrix { margin-left: 2em; }
38: .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
39: .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
40: .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
41:
42: .toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
43: img.extra, p.overview { float: right; }
44: pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; position: relative; }
45: pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
46: pre.idl::before { content: "IDL"; font: bold small sans-serif; padding: 0.5em; background: white; position: absolute; top: 0; margin: -1px 0 0 -4em; width: 1.5em; border: thin solid; border-radius: 0 0 0 0.5em }
47: pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
48: pre.css:first-line { color: #AAAA50; }
49: dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
50: hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
51: dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
52: dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
53: dl.domintro dd p { margin: 0.5em 0; }
54: dl.domintro:before { display: table; margin: -1em -0.5em -0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: black; font-style: italic; border: solid 2px; background: white; padding: 0 0.25em; }
55: dl.switch { padding-left: 2em; }
56: dl.switch > dt { text-indent: -1.5em; }
57: dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
58: dl.triple { padding: 0 0 0 1em; }
59: dl.triple dt, dl.triple dd { margin: 0; display: inline }
60: dl.triple dt:after { content: ':'; }
61: dl.triple dd:after { content: '\A'; white-space: pre; }
62: .diff-old { text-decoration: line-through; color: silver; background: transparent; }
63: .diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
64: a .diff-new { border-bottom: 1px blue solid; }
65:
66: h2 { page-break-before: always; }
67: h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
68: h1 + h2, hr + h2.no-toc { page-break-before: auto; }
69:
70: p > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]),
71: li > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]), { border-bottom: solid #9999CC; }
72:
73: div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
74: div.head p { margin: 0; }
75: div.head h1 { margin: 0; }
76: div.head .logo { float: right; margin: 0 1em; }
77: div.head .logo img { border: none } /* remove border from top image */
78: div.head dl { margin: 1em 0; }
79: div.head p.copyright, div.head p.alt { font-size: x-small; font-style: oblique; margin: 0; }
80:
81: body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
82: body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
83: body > .toc > li > * { margin-bottom: 0.5em; }
84: body > .toc > li > * > li > * { margin-bottom: 0.25em; }
85: .toc, .toc li { list-style: none; }
86:
87: .brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
88: .brief li { margin: 0; padding: 0; }
89: .brief li p { margin: 0; padding: 0; }
90:
91: .category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
92: .category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
93: .category-list li { display: inline; }
94: .category-list li:not(:last-child)::after { content: ', '; }
95: .category-list li > span, .category-list li > a { text-transform: lowercase; }
96: .category-list li * { text-transform: none; } /* don't affect <code> nested in <a> */
97:
98: .XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
99: .XXX > :first-child { margin-top: 0; }
100: p .XXX { line-height: 3em; }
101: .annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
102: .annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
103: .annotation :link, .annotation :visited { color: inherit; }
104: .annotation :link:hover, .annotation :visited:hover { background: transparent; }
105: .annotation span { border: none ! important; }
106: .note { color: green; background: transparent; font-family: sans-serif; }
107: .warning { color: red; background: transparent; }
108: .note, .warning { font-weight: bolder; font-style: italic; }
109: .note em, .warning em, .note i, .warning i { font-style: normal; }
110: p.note, div.note { padding: 0.5em 2em; }
111: span.note { padding: 0 2em; }
112: .note p:first-child, .warning p:first-child { margin-top: 0; }
113: .note p:last-child, .warning p:last-child { margin-bottom: 0; }
114: .warning:before { font-style: normal; }
115: p.note:before { content: 'Note: '; }
116: p.warning:before { content: '\26A0 Warning! '; }
117:
118: .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
119: .bookkeeping { font-size: 0.8em; margin: 2em 0; }
120: .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }
121: .bookkeeping dt { margin: 0.5em 2em 0; }
122: .bookkeeping dd { margin: 0 3em 0.5em; }
123:
124: h4 { position: relative; z-index: 3; }
125: h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
126: .element {
127: background: #EEEEFF;
128: color: black;
129: margin: 0 0 1em 0.15em;
130: padding: 0 1em 0.25em 0.75em;
131: border-left: solid #9999FF 0.25em;
132: position: relative;
133: z-index: 1;
134: }
135: .element:before {
136: position: absolute;
137: z-index: 2;
138: top: 0;
139: left: -1.15em;
140: height: 2em;
141: width: 0.9em;
142: background: #EEEEFF;
143: content: ' ';
144: border-style: none none solid solid;
145: border-color: #9999FF;
146: border-width: 0.25em;
147: }
148:
149: .example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; }
150: td > .example:only-child { margin: 0 0 0 0.1em; }
151:
152: ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
153: ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
154: ul.domTree li li { list-style: none; }
155: ul.domTree li:first-child::before { position: absolute; top: 0; height: 0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
156: ul.domTree li:not(:last-child)::after { position: absolute; top: 0; bottom: -0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
157: ul.domTree span { font-style: italic; font-family: serif; }
158: ul.domTree .t1 code { color: purple; font-weight: bold; }
159: ul.domTree .t2 { font-style: normal; font-family: monospace; }
160: ul.domTree .t2 .name { color: black; font-weight: bold; }
161: ul.domTree .t2 .value { color: blue; font-weight: normal; }
162: ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
163: ul.domTree .t7 code, .domTree .t8 code { color: green; }
164: ul.domTree .t10 code { color: teal; }
165:
166: body.dfnEnabled dfn { cursor: pointer; }
167: .dfnPanel {
168: display: inline;
169: position: absolute;
170: z-index: 10;
171: height: auto;
172: width: auto;
173: padding: 0.5em 0.75em;
174: font: small sans-serif, Droid Sans Fallback;
175: background: #DDDDDD;
176: color: black;
177: border: outset 0.2em;
178: }
179: .dfnPanel * { margin: 0; padding: 0; font: inherit; text-indent: 0; }
180: .dfnPanel :link, .dfnPanel :visited { color: black; }
181: .dfnPanel p { font-weight: bolder; }
182: .dfnPanel * + p { margin-top: 0.25em; }
183: .dfnPanel li { list-style-position: inside; }
184:
185: #configUI { position: absolute; z-index: 20; top: 10em; right: 1em; width: 11em; font-size: small; }
186: #configUI p { margin: 0.5em 0; padding: 0.3em; background: #EEEEEE; color: black; border: inset thin; }
187: #configUI p label { display: block; }
188: #configUI #updateUI, #configUI .loginUI { text-align: center; }
189: #configUI input[type=button] { display: block; margin: auto; }
190:
191: fieldset { margin: 1em; padding: 0.5em 1em; }
192: fieldset > legend + * { margin-top: 0; }
193: fieldset > :last-child { margin-bottom: 0; }
194: fieldset p { margin: 0.5em 0; }
195:
1.159 sruby 196: </style><link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet" type="text/css"><style type="text/css">
1.1 mike 197:
198: .applies thead th > * { display: block; }
199: .applies thead code { display: block; }
200: .applies tbody th { whitespace: nowrap; }
201: .applies td { text-align: center; }
202: .applies .yes { background: yellow; }
203:
204: .matrix, .matrix td { border: hidden; text-align: right; }
205: .matrix { margin-left: 2em; }
206:
207: .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
208: .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
209: .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
210:
211: td.eg { border-width: thin; text-align: center; }
212:
213: #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
214: #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
215: #table-example-1 caption { padding-bottom: 0.5em; }
216: #table-example-1 thead, #table-example-1 tbody { border: none; }
217: #table-example-1 th, #table-example-1 td { border: solid thin; }
218: #table-example-1 th { font-weight: normal; }
219: #table-example-1 td { border-style: none solid; vertical-align: top; }
220: #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
221: #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
222: #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
223: #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
224: #table-example-1 tbody td:first-child::after { content: leader(". "); }
225: #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
226: #table-example-1 tbody td:first-child + td { width: 10em; }
227: #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
228: #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
229:
230: .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
231: .apple-table-examples * { font-family: "Times", serif; }
232: .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
233: .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
234: .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
235: .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
236: .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
237: .apple-table-examples td { text-align: right; vertical-align: top; }
238: .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
239: .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
240: .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
241: .apple-table-examples sup { line-height: 0; }
242:
243: .details-example img { vertical-align: top; }
244:
245: #base64-table {
246: white-space: nowrap;
247: font-size: 0.6em;
248: column-width: 6em;
249: column-count: 5;
250: column-gap: 1em;
251: -moz-column-width: 6em;
252: -moz-column-count: 5;
253: -moz-column-gap: 1em;
254: -webkit-column-width: 6em;
255: -webkit-column-count: 5;
256: -webkit-column-gap: 1em;
257: }
258: #base64-table thead { display: none; }
259: #base64-table * { border: none; }
260: #base64-table tbody td:first-child:after { content: ':'; }
261: #base64-table tbody td:last-child { text-align: right; }
262:
263: #named-character-references-table {
264: white-space: nowrap;
265: font-size: 0.6em;
266: column-width: 30em;
267: column-gap: 1em;
268: -moz-column-width: 30em;
269: -moz-column-gap: 1em;
270: -webkit-column-width: 30em;
271: -webkit-column-gap: 1em;
272: }
273: #named-character-references-table > table > tbody > tr > td:first-child + td,
274: #named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
275: #named-character-references-table > table > tbody > tr > td:last-child:hover > span { position: absolute; top: auto; left: auto; margin-left: 0.5em; line-height: 1.2; font-size: 5em; border: outset; padding: 0.25em 0.5em; background: white; width: 1.25em; height: auto; text-align: center; }
276: #named-character-references-table > table > tbody > tr#entity-CounterClockwiseContourIntegral > td:first-child { font-size: 0.5em; }
277:
278: .glyph.control { color: red; }
279:
280: @font-face {
281: font-family: 'Essays1743';
1.179 ! sruby 282: src: url('../fonts/Essays1743.ttf');
1.1 mike 283: }
284: @font-face {
285: font-family: 'Essays1743';
286: font-weight: bold;
1.179 ! sruby 287: src: url('../fonts/Essays1743-Bold.ttf');
1.1 mike 288: }
289: @font-face {
290: font-family: 'Essays1743';
291: font-style: italic;
1.179 ! sruby 292: src: url('../fonts/Essays1743-Italic.ttf');
1.1 mike 293: }
294: @font-face {
295: font-family: 'Essays1743';
296: font-style: italic;
297: font-weight: bold;
1.179 ! sruby 298: src: url('../fonts/Essays1743-BoldItalic.ttf');
1.1 mike 299: }
300:
1.159 sruby 301: </style><link href="data:text/css," id="complete" rel="stylesheet" title="Complete specification"><link href="data:text/css,.impl%20%7B%20display:%20none;%20%7D%0Ahtml%20%7B%20border:%20solid%20yellow;%20%7D%20.domintro:before%20%7B%20display:%20none;%20%7D" id="author" rel="alternate stylesheet" title="Author documentation only"><link href="data:text/css,.impl%20%7B%20background:%20%23FFEEEE;%20%7D%20.domintro:before%20%7B%20background:%20%23FFEEEE;%20%7D" id="highlight" rel="alternate stylesheet" title="Highlight implementation requirements"><script>
1.1 mike 302: function getCookie(name) {
303: var params = location.search.substr(1).split("&");
304: for (var index = 0; index < params.length; index++) {
305: if (params[index] == name)
306: return "1";
307: var data = params[index].split("=");
308: if (data[0] == name)
309: return unescape(data[1]);
310: }
311: var cookies = document.cookie.split("; ");
312: for (var index = 0; index < cookies.length; index++) {
313: var data = cookies[index].split("=");
314: if (data[0] == name)
315: return unescape(data[1]);
316: }
317: return null;
318: }
1.159 sruby 319: </script><link href="the-embed-element.html" title="4.8.3 The embed element" rel="prev">
1.161 sruby 320: <link href="spec.html#contents" title="Table of contents" rel="contents">
1.1 mike 321: <link href="the-param-element.html" title="4.8.5 The param element" rel="next">
1.22 mike 322: </head><body onload="fixBrokenLink();" class="split chapter"><div class="head" id="head">
1.1 mike 323: <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
324:
325: <h1>HTML5</h1>
1.159 sruby 326: <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2>
1.179 ! sruby 327: <h2 class="no-num no-toc" id="editor's-draft-date-1-january-1970">Editor's Draft 17 September 2012</h2>
1.85 mike 328: </div>
1.175 sruby 329: <div class="prev_next">
1.1 mike 330: <a href="the-embed-element.html">← 4.8.3 The embed element</a> –
1.161 sruby 331: <a href="spec.html#contents">Table of contents</a> –
1.1 mike 332: <a href="the-param-element.html">4.8.5 The param element →</a>
1.159 sruby 333: </div>
1.1 mike 334:
1.85 mike 335: <h4 id="the-object-element"><span class="secno">4.8.4 </span>The <dfn><code>object</code></dfn> element</h4>
336:
337: <dl class="element"><dt><a href="element-definitions.html#element-dfn-categories" title="element-dfn-categories">Categories</a>:</dt>
1.159 sruby 338: <dd><a href="content-models.html#flow-content-1">Flow content</a>.</dd>
339: <dd><a href="content-models.html#phrasing-content-1">Phrasing content</a>.</dd>
340: <dd><a href="content-models.html#embedded-content-2">Embedded content</a>.</dd>
341: <dd>If the element has a <code title="attr-hyperlink-usemap"><a href="image-maps.html#attr-hyperlink-usemap">usemap</a></code> attribute: <a href="content-models.html#interactive-content-0">Interactive content</a>.</dd> <!-- also when showing a plugin or a nested browsing context, but checking that statically is hard...) -->
1.1 mike 342: <dd><a href="forms.html#category-listed" title="category-listed">Listed</a>, <a href="forms.html#category-submit" title="category-submit">submittable</a>, <a href="forms.html#form-associated-element">form-associated element</a>.</dd>
1.159 sruby 343: <dd><a href="content-models.html#palpable-content-0">Palpable content</a>.</dd>
1.25 mike 344: <dt><a href="element-definitions.html#element-dfn-contexts" title="element-dfn-contexts">Contexts in which this element can be used</a>:</dt>
1.159 sruby 345: <dd>Where <a href="content-models.html#embedded-content-2">embedded content</a> is expected.</dd>
1.25 mike 346: <dt><a href="element-definitions.html#element-dfn-content-model" title="element-dfn-content-model">Content model</a>:</dt>
1.163 sruby 347: <dd>Zero or more <code><a href="the-param-element.html#the-param-element">param</a></code> elements, then <a href="content-models.html#flow-content-1">flow content</a> and/or <a href="content-models.html#interactive-content-0">interactive content</a>.</dd>
1.25 mike 348: <dt><a href="element-definitions.html#element-dfn-attributes" title="element-dfn-attributes">Content attributes</a>:</dt>
1.1 mike 349: <dd><a href="global-attributes.html#global-attributes">Global attributes</a></dd>
350: <dd><code title="attr-object-data"><a href="#attr-object-data">data</a></code></dd>
351: <dd><code title="attr-object-type"><a href="#attr-object-type">type</a></code></dd>
352: <dd><code title="attr-object-typemustmatch"><a href="#attr-object-typemustmatch">typemustmatch</a></code></dd>
353: <dd><code title="attr-object-name"><a href="#attr-object-name">name</a></code></dd>
354: <dd><code title="attr-hyperlink-usemap"><a href="image-maps.html#attr-hyperlink-usemap">usemap</a></code></dd>
355: <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form">form</a></code></dd>
356: <dd><code title="attr-dim-width"><a href="dimension-attributes.html#attr-dim-width">width</a></code></dd>
357: <dd><code title="attr-dim-height"><a href="dimension-attributes.html#attr-dim-height">height</a></code></dd>
1.159 sruby 358: <dt><a href="element-definitions.html#element-dfn-dom" title="element-dfn-dom">DOM interface</a>:</dt><!--TOPIC:DOM APIs-->
1.1 mike 359: <dd>
360: <pre class="idl">interface <dfn id="htmlobjectelement">HTMLObjectElement</dfn> : <a href="elements.html#htmlelement">HTMLElement</a> {
361: attribute DOMString <a href="#dom-object-data" title="dom-object-data">data</a>;
362: attribute DOMString <a href="#dom-object-type" title="dom-object-type">type</a>;
363: attribute boolean <a href="#dom-object-typemustmatch" title="dom-object-typeMustMatch">typeMustMatch</a>;
364: attribute DOMString <a href="#dom-object-name" title="dom-object-name">name</a>;
365: attribute DOMString <a href="#dom-object-usemap" title="dom-object-useMap">useMap</a>;
366: readonly attribute <a href="the-form-element.html#htmlformelement">HTMLFormElement</a>? <a href="association-of-controls-and-forms.html#dom-fae-form" title="dom-fae-form">form</a>;
367: attribute DOMString <a href="dimension-attributes.html#dom-dim-width" title="dom-dim-width">width</a>;
368: attribute DOMString <a href="dimension-attributes.html#dom-dim-height" title="dom-dim-height">height</a>;
369: readonly attribute Document? <a href="#dom-object-contentdocument" title="dom-object-contentDocument">contentDocument</a>;
370: readonly attribute <a href="browsers.html#windowproxy">WindowProxy</a>? <a href="#dom-object-contentwindow" title="dom-object-contentWindow">contentWindow</a>;
371:
372: readonly attribute boolean <a href="constraints.html#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
373: readonly attribute <a href="constraints.html#validitystate">ValidityState</a> <a href="constraints.html#dom-cva-validity" title="dom-cva-validity">validity</a>;
374: readonly attribute DOMString <a href="constraints.html#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
375: boolean <a href="constraints.html#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
376: void <a href="constraints.html#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(DOMString error);
1.34 mike 377:
378: <a href="#dom-object-caller" title="dom-object-caller">legacycaller</a> any (any... arguments);
1.1 mike 379: };</pre>
380: <div class="impl">
381: <p>Depending on the type of content instantiated by the
382: <code><a href="#the-object-element">object</a></code> element, the node also supports other
383: interfaces.</p>
384: </div>
385: </dd>
1.159 sruby 386: </dl><!--TOPIC:HTML--><p>The <code><a href="#the-object-element">object</a></code> element can represent an external
1.1 mike 387: resource, which, depending on the type of the resource, will either
388: be treated as an image, as a <a href="browsers.html#nested-browsing-context">nested browsing context</a>,
389: or as an external resource to be processed by a
1.85 mike 390: <a href="infrastructure.html#plugin">plugin</a>.</p>
391:
392: <p>The <dfn id="attr-object-data" title="attr-object-data"><code>data</code></dfn>
1.1 mike 393: attribute, if present, specifies the address of the resource. If
394: present, the attribute must be a <a href="urls.html#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty
1.85 mike 395: URL potentially surrounded by spaces</a>.</p>
396:
1.159 sruby 397: <p class="warning">Authors who reference resources from other <a href="browsers.html#origin-0" title="origin">origins</a> that they do not trust are urged to
1.1 mike 398: use the <code title="attr-object-typemustmatch"><a href="#attr-object-typemustmatch">typemustmatch</a></code>
399: attribute defined below. Without that attribute, it is possible in
400: certain cases for an attacker on the remote host to use the plugin
401: mechanism to run arbitrary scripts, even if the author has used
1.159 sruby 402: features such as the Flash "allowScriptAccess" parameter.</p> <!--
403: for example, if the user doesn't have flash installed but does have
404: java installed, and the remote site unexpectedly returns java
405: instead of flash, then java will run, and it will ignore the
406: allowScriptAccess thing -->
1.85 mike 407:
408: <p>The <dfn id="attr-object-type" title="attr-object-type"><code>type</code></dfn>
1.1 mike 409: attribute, if present, specifies the type of the resource. If
1.85 mike 410: present, the attribute must be a <a href="infrastructure.html#valid-mime-type">valid MIME type</a>.</p>
411:
412: <p>At least one of either the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute or the <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute must be present.</p>
413:
1.159 sruby 414: <!--MD-->
1.85 mike 415:
416: <p>The <dfn id="attr-object-typemustmatch" title="attr-object-typemustmatch"><code>typemustmatch</code></dfn>
1.1 mike 417: attribute is a <a href="common-microsyntaxes.html#boolean-attribute">boolean attribute</a> whose presence
418: indicates that the resource specified by the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute is only to be used if
419: the value of the <code title="attr-object-type"><a href="#attr-object-type">type</a></code>
420: attribute and the <a href="urls.html#content-type">Content-Type</a> of the aforementioned
1.85 mike 421: resource match.</p>
422:
423: <p>The <code title="attr-object-typemustmatch"><a href="#attr-object-typemustmatch">typemustmatch</a></code>
424: attribute must not be specified unless both the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute and the <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute are present.</p>
425:
426: <p>The <dfn id="attr-object-name" title="attr-object-name"><code>name</code></dfn>
1.1 mike 427: attribute, if present, must be a <a href="browsers.html#valid-browsing-context-name">valid browsing context
428: name</a>. The given value is used to name the <a href="browsers.html#nested-browsing-context">nested
1.85 mike 429: browsing context</a>, if applicable.</p>
430:
431: <div class="impl">
1.1 mike 432:
1.127 mike 433: <p>Whenever one of the following conditions occur:</p>
434:
435: <ul><li>the element is created,
436:
437: </li><li>the element is popped off the <a href="parsing.html#stack-of-open-elements">stack of open elements</a> of an <a href="parsing.html#html-parser">HTML parser</a> or <a href="the-xhtml-syntax.html#xml-parser">XML parser</a>,
438:
439: </li><li>the element is not on the <a href="parsing.html#stack-of-open-elements">stack of open elements</a> of an <a href="parsing.html#html-parser">HTML parser</a> or <a href="the-xhtml-syntax.html#xml-parser">XML parser</a>, and it is either <a href="infrastructure.html#insert-an-element-into-a-document" title="insert an element into a document">inserted into a document</a> or <a href="infrastructure.html#remove-an-element-from-a-document" title="remove an element from a document">removed from a document</a>,
440:
441: </li><li>the element's <code><a href="dom.html#document">Document</a></code> changes whether it is <a href="browsers.html#fully-active">fully active</a>,
442:
443: </li><li>one of the element's ancestor <code><a href="#the-object-element">object</a></code> elements changes to or from showing its <a href="content-models.html#fallback-content">fallback content</a>,
444:
445: </li><li>the element's <code title="attr-object-classid"><a href="obsolete.html#attr-object-classid">classid</a></code> attribute is set, changed, or removed,
446:
447: </li><li>the element's <code title="attr-object-classid"><a href="obsolete.html#attr-object-classid">classid</a></code> attribute is not present, and its <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute is set, changed, or removed,
448:
449: </li><li>neither the element's <code title="attr-object-classid"><a href="obsolete.html#attr-object-classid">classid</a></code> attribute nor its <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute are present, and its <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute is set, changed, or removed,
450:
1.128 mike 451: </li><li>the element changes from <a href="rendering.html#being-rendered">being rendered</a> to not being rendered, or vice versa,
1.127 mike 452:
1.159 sruby 453: </li></ul><!-- Changing the base URL doesn't trigger this. --><p>...the user agent must <a href="webappapis.html#queue-a-task">queue a task</a> to run the
1.127 mike 454: following steps to (re)determine what the <code><a href="#the-object-element">object</a></code>
455: element represents. The <a href="webappapis.html#task-source">task source</a> for this <a href="webappapis.html#concept-task" title="concept-task">task</a> is the <a href="webappapis.html#dom-manipulation-task-source">DOM manipulation task
1.132 mike 456: source</a>. This <a href="webappapis.html#concept-task" title="concept-task">task</a> being
457: <a href="webappapis.html#queue-a-task" title="queue a task">queued</a> or actively running must
1.159 sruby 458: <a href="the-end.html#delay-the-load-event">delay the load event</a> of the element's document. <!--As
459: described in the algorithm, once the algorithm starts fetching a
460: resource, the fetch is what starts delaying the load event. But to
461: tide us over from when the parser finds the <object> element and the
462: fetching begins, we have to block the load event like this, lest the
463: parse end before this task gets run.--></p>
1.4 mike 464:
1.1 mike 465: <ol><li>
466:
467: <p>If the user has indicated a preference that this
468: <code><a href="#the-object-element">object</a></code> element's <a href="content-models.html#fallback-content">fallback content</a> be
469: shown instead of the element's usual behavior, then jump to the
470: last step in the overall set of steps (fallback).</p>
471:
472: <p class="note">For example, a user could ask for the element's
473: <a href="content-models.html#fallback-content">fallback content</a> to be shown because that content
474: uses a format that the user finds more accessible.</p>
475:
476: </li>
477:
478: <li>
479:
480: <p>If the element has an ancestor <a href="media-elements.html#media-element">media element</a>, or
481: has an ancestor <code><a href="#the-object-element">object</a></code> element that is <em>not</em>
482: showing its <a href="content-models.html#fallback-content">fallback content</a>, or if the element is
483: not <a href="infrastructure.html#in-a-document" title="in a document">in a <code>Document</code></a>
484: with a <a href="browsers.html#browsing-context">browsing context</a>, or if the element's
485: <code><a href="dom.html#document">Document</a></code> is not <a href="browsers.html#fully-active">fully active</a>, or if the
486: element is still in the <a href="parsing.html#stack-of-open-elements">stack of open elements</a> of an
1.127 mike 487: <a href="parsing.html#html-parser">HTML parser</a> or <a href="the-xhtml-syntax.html#xml-parser">XML parser</a>, or if the
488: element is not <a href="rendering.html#being-rendered">being rendered</a>, then jump to the last
489: step in the overall set of steps (fallback).</p>
1.1 mike 490:
491: </li>
492:
493: <li>
494:
1.159 sruby 495: <!-- what if it's not in the document? if that should prevent
496: plugin instantiation, then here just skip to the last step -->
1.4 mike 497:
1.1 mike 498: <p>If the <code title="attr-object-classid"><a href="obsolete.html#attr-object-classid">classid</a></code>
499: attribute is present, and has a value that isn't the empty string,
500: then: if the user agent can find a <a href="infrastructure.html#plugin">plugin</a> suitable
501: according to the value of the <code title="attr-object-classid"><a href="obsolete.html#attr-object-classid">classid</a></code> attribute, and either
502: <a href="#sandboxPluginObject">plugins aren't being sandboxed</a>
503: or that <a href="infrastructure.html#plugin">plugin</a> can be <a href="infrastructure.html#concept-plugin-secure" title="concept-plugin-secure">secured</a>, then that
504: <a href="infrastructure.html#plugin">plugin</a> <a href="#object-plugin">should be used</a>,
505: and the value of the <code title="attr-object-data"><a href="#attr-object-data">data</a></code>
506: attribute, if any, should be passed to the <a href="infrastructure.html#plugin">plugin</a>. If
507: no suitable <a href="infrastructure.html#plugin">plugin</a> can be found, or if the
508: <a href="infrastructure.html#plugin">plugin</a> reports an error, jump to the last step in the
509: overall set of steps (fallback).</p>
510:
1.159 sruby 511: <!--
512: case insensitive:
513: is "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" -> application/x-shockwave-flash
514: is "clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" -> audio/x-pn-realaudio-plugin
515: is "clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" -> video/quicktime
516: is "clsid:166b1bca-3f9c-11cf-8075-444553540000" -> application/x-director
517: is "clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" -> application/x-mplayer2
518: starts with "java:" -> application/x-java-vm
519: starts with "clsid:" -> application/x-oleobject
520: -->
1.4 mike 521:
1.1 mike 522: </li>
523:
1.159 sruby 524: <!-- (v2?)
525: we may have to define magic fallback to <param> if it turns out to
526: be needed in testing:
527: <hyatt> apparently your url can come from <param>
528: <hyatt> not just the data attribute
529: <hyatt> our code looks for params with "src", "movie", "code" and "url"
530: <hyatt> and also tries to find the type on a param
531: <Hixie> oh that's you trying to have hacky activex support
532: <Hixie> opera does that too
533: <hyatt> yeah we support activex versions of plugins that are common
534: <hyatt> like flash and quicktime and realaudio
535: <Hixie> that would be a step 1b. if no data attribute, then look for a <param> to get you a URL instead.
536: <Hixie> and if you find one, carry on as if that was your data="".
537: -->
1.4 mike 538:
1.1 mike 539: <li><p>If the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute
540: is present and its value is not the empty string, then:</p>
541:
542: <ol><li><p>If the <code title="attr-object-type"><a href="#attr-object-type">type</a></code>
543: attribute is present and its value is not a type that the user
544: agent supports, and is not a type that the user agent can find a
545: <a href="infrastructure.html#plugin">plugin</a> for, then the user agent may jump to the last
546: step in the overall set of steps (fallback) without fetching the
547: content to examine its real type.</p></li>
548:
549: <li><p><a href="urls.html#resolve-a-url" title="resolve a url">Resolve</a> the
550: <a href="urls.html#url">URL</a> specified by the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute, relative to the
551: element.</p></li>
552:
553: <li><p>If that failed, <a href="webappapis.html#fire-a-simple-event">fire a simple event</a> named
554: <code title="event-error">error</code> at the element, then jump
555: to the last step in the overall set of steps (fallback).</p></li>
556:
557: <li>
558:
559: <p><a href="urls.html#fetch">Fetch</a> the resulting <a href="urls.html#absolute-url">absolute URL</a>,
560: from the element's <a href="browsers.html#browsing-context-scope-origin">browsing context scope origin</a> if
1.159 sruby 561: it has one<!-- potentially http-origin privacy sensitive
562: -->.</p>
1.1 mike 563:
1.159 sruby 564: <!-- similar text in various places --> <p>Fetching the resource
1.1 mike 565: must <a href="the-end.html#delay-the-load-event">delay the load event</a> of the element's document
566: until the <a href="webappapis.html#concept-task" title="concept-task">task</a> that is <a href="webappapis.html#queue-a-task" title="queue a task">queued</a> by the <a href="webappapis.html#networking-task-source">networking task
567: source</a> once the resource has been <a href="urls.html#fetch" title="fetch">fetched</a> (defined next) has been run.</p>
568:
569: <p>For the purposes of the <a href="offline.html#application-cache">application cache</a>
570: networking model, this <a href="urls.html#fetch">fetch</a> operation is not for a
571: <a href="browsers.html#child-browsing-context">child browsing context</a> (though it might end up
572: being used for one after all, as defined below).</p>
573:
574: </li>
575:
576: <li><p>If the resource is not yet available (e.g. because the
577: resource was not available in the cache, so that loading the
578: resource required making a request over the network), then jump
579: to the last step in the overall set of steps (fallback). The
580: <a href="webappapis.html#concept-task" title="concept-task">task</a> that is <a href="webappapis.html#queue-a-task" title="queue
581: a task">queued</a> by the <a href="webappapis.html#networking-task-source">networking task source</a>
582: once the resource is available must restart this algorithm from
583: this step. Resources can load incrementally; user agents may opt
584: to consider a resource "available" whenever enough data has been
585: obtained to begin processing the resource.</p></li>
586:
587: <li><p>If the load failed (e.g. there was an HTTP 404 error,
588: there was a DNS error), <a href="webappapis.html#fire-a-simple-event">fire a simple event</a> named
589: <code title="event-error">error</code> at the element, then jump
590: to the last step in the overall set of steps (fallback).</p></li>
591:
592: <li id="object-type-detection">
593:
594: <p>Determine the <var title="">resource type</var>, as follows:</p>
595:
1.159 sruby 596: <!-- Hopefully this step is exactly equivalent to the following:
597:
598: START
599: |
600: V
601: Is there a Content-Type and is the UA going to obey it blindly?
602: | |
603: | YES | NO
604: | V YES
605: | Is there a type="" attribute whose value is a plugin type? ============================================-.
606: | | |
607: | | NO |
608: | V NO YES |
609: | Is there a Content type? ========-> Is there a type="" attribute? ==========> Let TYPE be type="" |
610: | | | attribute value |
611: | | YES | NO | |
612: V NO V | V |
613: +-<============== Is it text/plain or application/octet-stream? `==> Let TYPE be =====>+ |
614: | | | Sniffed type | |
615: | | text/plain | octet-stream V |
616: | V YES V Is TYPE |
617: | Does the page sniff as binary? ======> Is there a type="" attribute? application/octet-stream? |
618: | | | | | | |
619: | | NO | YES | NO | YES | NO |
620: | | | YES V V | |
621: | | application/octet-stream? =====> Extension that is plugin type? | |
622: | | | | | | |
623: | | | NO | NO | YES | |
624: | | V | | | |
625: | | Type attribute is XML or YES V | | |
626: | | doesn't start with image/* ======> FALLBACK | | |
627: | | and is not a plugin type? | | |
628: | | | | | |
629: | | | NO | | V
630: V V V V V Use
631: Use Use Use it (will be Use Use type=""
632: Content-Type text/plain bitmap or plugin) extension TYPE attribute
633: | | | | | |
634: | V V V V |
635: `================->-+========================================>-+==============>-+-<============-+-<==============+-<======'
636: |
637: V
638: Continue following rules in the spec, which might
639: result in a plugin, a browsing context, an image,
640: or using fallback, depending on the UA and the type.
641:
642:
643: "Extension that is plugin type?" means "Is there an extension that matches one that a plugin supports?".
644: Plugins are not allowed to register text/plain or application/octet-stream.
1.1 mike 645:
1.159 sruby 646: -->
1.4 mike 647:
1.1 mike 648: <ol><li>
649:
650: <p>Let the <var title="">resource type</var> be unknown.</p>
651:
652: </li>
653:
654: <li>
655:
656: <p>If the <code><a href="#the-object-element">object</a></code> element has a <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute and a <code title="attr-object-typemustmatch"><a href="#attr-object-typemustmatch">typemustmatch</a></code>
657: attribute, and the resource has <a href="urls.html#content-type" title="Content-Type">associated Content-Type metadata</a>,
658: and the type specified in <a href="urls.html#content-type" title="Content-Type">the
659: resource's Content-Type metadata</a> is an <a href="infrastructure.html#ascii-case-insensitive">ASCII
660: case-insensitive</a> match for the value of the element's
661: <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute, then let
662: <var title="">resource type</var> be that type and jump to the
663: step below labeled <i>handler</i>.</p>
664:
1.159 sruby 665: <!-- do we need to <span>strip leading and trailing
666: whitespace</span> from anything here? collapse sequences of
667: spaces? drop parameters? -->
1.4 mike 668:
1.1 mike 669: </li>
670:
671: <li>
672:
673: <p>If the <code><a href="#the-object-element">object</a></code> element has a <code title="attr-object-typemustmatch"><a href="#attr-object-typemustmatch">typemustmatch</a></code>
674: attribute, jump to the step below labeled <i>handler</i>.</p>
675:
676: </li>
677:
678: <li>
679:
1.159 sruby 680: <!-- by request: http://www.w3.org/Bugs/Public/show_bug.cgi?id=8479 -->
1.1 mike 681:
682: <p>If the user agent is configured to strictly obey
683: Content-Type headers for this resource, and the resource has
684: <a href="urls.html#content-type" title="Content-Type">associated Content-Type
685: metadata</a>, then let the <var title="">resource
686: type</var> be the type specified in <a href="urls.html#content-type" title="Content-Type">the resource's Content-Type
687: metadata</a>, and jump to the step below labeled
688: <i>handler</i>.</p>
689:
690: <p class="warning">This can introduce a vulnerability, wherein
691: a site is trying to embed a resource that uses a particular
692: plugin, but the remote site overrides that and instead
693: furnishes the user agent with a resource that triggers a
1.159 sruby 694: different plugin with different security characteristics. <!--
695: e.g. the example given above, where the site is expecting
696: Flash with allowScriptAccess=never, and instead gets back Java
697: with its unrestricted DOM access --></p>
1.1 mike 698:
699: </li>
700:
701: <li>
702:
703: <p>If there is a <code title="attr-object-type"><a href="#attr-object-type">type</a></code>
704: attribute present on the <code><a href="#the-object-element">object</a></code> element, and that
705: attribute's value is not a type that the user agent supports,
706: but it <em>is</em> a type that a <a href="infrastructure.html#plugin">plugin</a> supports,
707: then let the <var title="">resource type</var> be the type
708: specified in that <code title="attr-object-type"><a href="#attr-object-type">type</a></code>
709: attribute, and jump to the step below labeled
710: <i>handler</i>.</p>
711:
712: </li>
713:
714: <li>
715:
716: <p>Run the approprate set of steps from the following
717: list:</p>
718:
719: <dl class="switch"><dt>The resource has <a href="urls.html#content-type" title="Content-Type">associated
720: Content-Type metadata</a></dt>
721:
722: <dd>
723:
724: <ol><li>
725:
726: <p>Let <var title="">binary</var> be false.</p>
727:
728: </li>
729:
730: <li>
731:
732: <p>If the type specified in <a href="urls.html#content-type" title="Content-Type">the
733: resource's Content-Type metadata</a> is
734: "<code>text/plain</code>", and the result of applying the
735: <a href="urls.html#content-type-sniffing:-text-or-binary" title="Content-Type sniffing: text or binary">rules
736: for distinguishing if a resource is text or binary</a>
737: to the resource is that the resource is not
738: <code>text/plain</code>, then set <var title="">binary</var> to true.</p>
739:
740: </li>
741:
742: <li>
743:
744: <p>If the type specified in <a href="urls.html#content-type" title="Content-Type">the
745: resource's Content-Type metadata</a> is
746: "<code>application/octet-stream</code>", then set <var title="">binary</var> to true.</p>
747:
748: </li>
749:
750: <li>
751:
752: <p>If <var title="">binary</var> is false, then let the
753: <var title="">resource type</var> be the type specified in
754: <a href="urls.html#content-type" title="Content-Type">the resource's Content-Type
755: metadata</a>, and jump to the step below labeled
756: <i>handler</i>.</p>
757:
758: </li>
759:
760: <li>
761:
762: <p>If there is a <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute present on
763: the <code><a href="#the-object-element">object</a></code> element, and its value is not
764: <code>application/octet-stream</code>, then run the
765: following steps:</p>
766:
767: <ol><li>
768:
769: <p>If the attribute's value is a type that a <a href="infrastructure.html#plugin">plugin</a> supports, or
770: the attribute's value is a type that starts with "<code>image/</code>" that is not also an <a href="infrastructure.html#xml-mime-type">XML MIME type</a>,
771: then let the <var title="">resource type</var> be the type specified in that <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute.</p>
772:
773: </li>
774:
775: <li>
776:
777: <p>Jump to the step below labeled <i>handler</i>.</p>
778:
779: </li>
780:
781: </ol></li>
782:
783: </ol></dd>
784:
785: <dt>The resource does not have <a href="urls.html#content-type" title="Content-Type">associated Content-Type
786: metadata</a></dt>
787:
788: <dd>
789:
790: <ol><li>
791:
792: <p>If there is a <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute present on
793: the <code><a href="#the-object-element">object</a></code> element, then let the <var title="">tentative type</var> be the type specified in that
794: <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute.</p>
795:
796: <p>Otherwise, let <var title="">tentative type</var> be the
797: <a href="urls.html#content-type-sniffing-0" title="content-type sniffing">sniffed type of the
798: resource</a>.</p>
799:
800: </li>
801:
802: <li>
803:
804: <p>If <var title="">tentative type</var> is <em>not</em>
805: <code>application/octet-stream</code>, then let <var title="">resource type</var> be <var title="">tentative
806: type</var> and jump to the step below labeled
807: <i>handler</i>.</p>
808:
809: </li>
810:
811: </ol></dd>
812:
813: </dl></li>
814:
815: <li>
816:
1.159 sruby 817: <!-- if we get to this point we know we can successfully
818: parsed the URL, since this algorithm is only used after
819: fetching the resource in the steps above -->
1.4 mike 820:
1.1 mike 821: <p>If the <a href="urls.html#url-path" title="url-path"><path></a> component
822: of the <a href="urls.html#url">URL</a> of the specified resource (after any
823: redirects) matches a pattern that a <a href="infrastructure.html#plugin">plugin</a>
824: supports, then let <var title="">resource type</var> be the
825: type that that plugin can handle.</p>
826:
827: <p class="example">For example, a plugin might say that it can
828: handle resources with <a href="urls.html#url-path" title="url-path"><path></a> components that end with
829: the four character string "<code title="">.swf</code>".</p>
830:
1.159 sruby 831: <!-- it's sad that we have to do extension sniffing. sigh. -->
832: <!-- see also <embed> which has a similar step -->
1.1 mike 833:
834: </li>
835:
836: </ol><p class="note">It is possible for this step to finish, or for
837: one of the substeps above to jump straight to the next step,
838: with <var title="">resource type</var> still being unknown. In
839: both cases, the next step will trigger fallback.</p>
840:
841: </li>
842:
843: <li><p><i>Handler</i>: Handle the content as given by the first
844: of the following cases that matches:</p>
845:
846: <dl class="switch"><dt>If the <var title="">resource type</var> is not a type that
847: the user agent supports, but it <em>is</em> a type that a
848: <a href="infrastructure.html#plugin">plugin</a> supports</dt>
849:
850: <dd>
851:
852: <p>If <a href="#sandboxPluginObject">plugins are being
853: sandboxed</a> and the plugin that supports <var title="">resource type</var> cannot be <a href="infrastructure.html#concept-plugin-secure" title="concept-plugin-secure">secured</a>, jump to the last
854: step in the overall set of steps (fallback).</p>
855:
856: <p>Otherwise, the user agent should <a href="#object-plugin">use the plugin that supports <var title="">resource type</var></a> and pass the content of the
857: resource to that <a href="infrastructure.html#plugin">plugin</a>. If the
858: <a href="infrastructure.html#plugin">plugin</a> reports an error, then jump to the last
859: step in the overall set of steps (fallback).</p>
860:
861: </dd>
862:
863:
864: <dt>If the <var title="">resource type</var> is an <a href="infrastructure.html#xml-mime-type">XML MIME
865: type</a>, or
1.159 sruby 866: <!-- (redundant with the next one) if the <var title="">resource type</var> is HTML, or -->
1.1 mike 867: if the <var title="">resource type</var> does not start with
868: "<code>image/</code>"</dt>
869:
870: <dd>
871:
872: <p>The <code><a href="#the-object-element">object</a></code> element must be associated with a
873: newly created <a href="browsers.html#nested-browsing-context">nested browsing context</a>, if it does
874: not already have one.</p>
875:
876: <p>If the <a href="urls.html#url">URL</a> of the given resource is not
877: <code><a href="urls.html#about:blank">about:blank</a></code>, the element's <a href="browsers.html#nested-browsing-context">nested browsing
1.159 sruby 878: context</a> must then be <a href="history.html#navigate" title="navigate">navigated</a><!--DONAV object--> to that
1.1 mike 879: resource, with <a href="history.html#replacement-enabled">replacement enabled</a>, and with the
880: <code><a href="#the-object-element">object</a></code> element's document's <a href="browsers.html#browsing-context">browsing
881: context</a> as the <a href="history.html#source-browsing-context">source browsing context</a>.
882: (The <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute of
883: the <code><a href="#the-object-element">object</a></code> element doesn't get updated if the
884: browsing context gets further navigated to other
885: locations.)</p>
886:
887: <p>If the <a href="urls.html#url">URL</a> of the given resource <em>is</em>
888: <code><a href="urls.html#about:blank">about:blank</a></code>, then, instead, the user agent must
889: <a href="webappapis.html#queue-a-task">queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple event</a>
890: named <code title="event-load">load</code> at the
891: <code><a href="#the-object-element">object</a></code> element. <span class="note">No <code title="event-load">load</code> event is fired at the
892: <code><a href="urls.html#about:blank">about:blank</a></code> document itself.</span></p>
893:
894: <p>The <code><a href="#the-object-element">object</a></code> element <a href="rendering.html#represents">represents</a> the
895: <a href="browsers.html#nested-browsing-context">nested browsing context</a>.</p>
896:
897: <p>If the <code title="attr-object-name"><a href="#attr-object-name">name</a></code> attribute
898: is present, the <a href="browsers.html#browsing-context-name">browsing context name</a> must be set
899: to the value of this attribute; otherwise, the <a href="browsers.html#browsing-context-name">browsing
900: context name</a> must be set to the empty string.</p>
901:
902: <p class="note">In certain situations, e.g. if the resource
903: was <a href="urls.html#fetch" title="fetch">fetched</a> from an
904: <a href="offline.html#application-cache">application cache</a> but it is an HTML file with a
905: <code title="attr-html-manifest"><a href="the-html-element.html#attr-html-manifest">manifest</a></code> attribute
906: that points to a different <a href="offline.html#concept-appcache-manifest" title="concept-appcache-manifest">application cache
907: manifest</a>, the <a href="history.html#navigate" title="navigate">navigation</a>
908: of the <a href="browsers.html#browsing-context">browsing context</a> will be restarted so as
909: to load the resource afresh from the network or a different
910: <a href="offline.html#application-cache">application cache</a>. Even if the resource is then
911: found to have a different type, it is still used as part of a
912: <a href="browsers.html#nested-browsing-context">nested browsing context</a>: only the
913: <a href="history.html#navigate">navigate</a> algorithm is restarted, not this
914: <code><a href="#the-object-element">object</a></code> algorithm.</p>
915:
1.159 sruby 916: <!-- note that malformed XML files don't cause fallback -->
1.1 mike 917:
918: </dd>
919:
920:
921: <dt>If the <var title="">resource type</var> starts with
922: "<code>image/</code>", and support for images has not been
923: disabled</dt>
924:
925: <dd>
926:
927: <p>Apply the <a href="urls.html#content-type-sniffing:-image" title="content-type sniffing: image">image
928: sniffing</a> rules to determine the type of the image.</p>
929:
930: <p>The <code><a href="#the-object-element">object</a></code> element <a href="rendering.html#represents">represents</a> the
931: specified image. The image is not a <a href="browsers.html#nested-browsing-context">nested browsing
932: context</a>.</p>
933:
934: <p>If the image cannot be rendered, e.g. because it is
935: malformed or in an unsupported format, jump to the last step
936: in the overall set of steps (fallback).</p>
937:
938: </dd>
939:
940:
941: <dt>Otherwise</dt>
942:
943: <dd>
944:
945: <p>The given <var title="">resource type</var> is not
946: supported. Jump to the last step in the overall set of steps
947: (fallback).</p>
948:
949: <p class="note">If the previous step ended with the <var title="">resource type</var> being unknown, this is the case
950: that is triggered.</p>
951:
952: </dd>
953:
954: </dl></li>
955:
956: <li><p>The element's contents are not part of what the
957: <code><a href="#the-object-element">object</a></code> element represents.</p>
958:
959: </li><li>
960:
961: <p>Once the resource is completely loaded, <a href="webappapis.html#queue-a-task">queue a
962: task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple event</a> named <code title="event-load">load</code> at the element.</p>
963:
1.159 sruby 964: <p>The <a href="webappapis.html#task-source">task source</a> for this task<!--tasks mentioned
965: in this section--> is the <a href="webappapis.html#dom-manipulation-task-source">DOM manipulation task
1.1 mike 966: source</a>.</p>
967:
968: </li>
969:
970: </ol></li>
971:
972: <li><p>If the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute
973: is absent but the <code title="attr-object-type"><a href="#attr-object-type">type</a></code>
974: attribute is present, and the user agent can find a
975: <a href="infrastructure.html#plugin">plugin</a> suitable according to the value of the <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute, and either <a href="#sandboxPluginObject">plugins aren't being sandboxed</a> or
976: the <a href="infrastructure.html#plugin">plugin</a> can be <a href="infrastructure.html#concept-plugin-secure" title="concept-plugin-secure">secured</a>, then that
977: <a href="infrastructure.html#plugin">plugin</a> <a href="#object-plugin">should be used</a>. If
978: these conditions cannot be met, or if the <a href="infrastructure.html#plugin">plugin</a>
979: reports an error, jump to the next step (fallback).</p></li>
980:
981: <li><p>(Fallback.) The <code><a href="#the-object-element">object</a></code> element
982: <a href="rendering.html#represents">represents</a> the element's children, ignoring any
983: leading <code><a href="the-param-element.html#the-param-element">param</a></code> element children. This is the element's
984: <a href="content-models.html#fallback-content">fallback content</a>. If the element has an instantiated
985: <a href="infrastructure.html#plugin">plugin</a>, then unload it.</p></li>
986:
987: </ol><p id="object-plugin">When the algorithm above instantiates a
988: <a href="infrastructure.html#plugin">plugin</a>, the user agent should pass to the
989: <a href="infrastructure.html#plugin">plugin</a> used the names and values of all the attributes
990: on the element, in the order they were added to the element, with
991: the attributes added by the parser being ordered in source order,
992: followed by a parameter named "PARAM" whose value is null,
993: followed by all the names and values of <a href="the-param-element.html#concept-param-parameter" title="concept-param-parameter">parameters</a> given by
994: <code><a href="the-param-element.html#the-param-element">param</a></code> elements that are children of the
995: <code><a href="#the-object-element">object</a></code> element, in <a href="infrastructure.html#tree-order">tree order</a>. If the
996: <a href="infrastructure.html#plugin">plugin</a> supports a scriptable interface, the
997: <code><a href="#htmlobjectelement">HTMLObjectElement</a></code> object representing the element
998: should expose that interface. The <code><a href="#the-object-element">object</a></code> element
999: <a href="rendering.html#represents">represents</a> the <a href="infrastructure.html#plugin">plugin</a>. The
1000: <a href="infrastructure.html#plugin">plugin</a> is not a nested <a href="browsers.html#browsing-context">browsing
1001: context</a>.</p>
1002:
1003: <p id="sandboxPluginObject">Plugins are considered sandboxed for the
1.159 sruby 1004: purpose of an <code><a href="#the-object-element">object</a></code> element if the <a href="browsers.html#sandboxed-plugins-browsing-context-flag">sandboxed
1.108 mike 1005: plugins browsing context flag</a> is set on the
1.159 sruby 1006: <code><a href="#the-object-element">object</a></code> element's <code><a href="dom.html#document">Document</a></code>'s <a href="browsers.html#active-sandboxing-flag-set">active
1.108 mike 1007: sandboxing flag set</a>.</p>
1.1 mike 1008:
1009: <p>Due to the algorithm above, the contents of <code><a href="#the-object-element">object</a></code>
1010: elements act as <a href="content-models.html#fallback-content">fallback content</a>, used only when
1011: referenced resources can't be shown (e.g. because it returned a 404
1012: error). This allows multiple <code><a href="#the-object-element">object</a></code> elements to be
1013: nested inside each other, targeting multiple user agents with
1014: different capabilities, with the user agent picking the first one it
1015: supports.</p>
1016:
1017: <p>Whenever the <code title="attr-object-name"><a href="#attr-object-name">name</a></code> attribute
1018: is set, if the <code><a href="#the-object-element">object</a></code> element has a nested
1019: <a href="browsers.html#browsing-context">browsing context</a>, its <a href="browsers.html#browsing-context-name" title="browsing context
1020: name">name</a> must be changed to the new value. If the attribute
1021: is removed, if the <code><a href="#the-object-element">object</a></code> element has a <a href="browsers.html#browsing-context">browsing
1022: context</a>, the <a href="browsers.html#browsing-context-name">browsing context name</a> must be set
1023: to the empty string.</p>
1024:
1.85 mike 1025: </div>
1026:
1027: <p>The <code title="attr-hyperlink-usemap"><a href="image-maps.html#attr-hyperlink-usemap">usemap</a></code> attribute,
1.1 mike 1028: if present while the <code><a href="#the-object-element">object</a></code> element represents an
1029: image, can indicate that the object has an associated <a href="image-maps.html#image-map">image
1030: map</a>. <span class="impl">The attribute must be ignored if the
1.85 mike 1031: <code><a href="#the-object-element">object</a></code> element doesn't represent an image.</span></p>
1032:
1033: <p>The <code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form">form</a></code> attribute is used to
1.1 mike 1034: explicitly associate the <code><a href="#the-object-element">object</a></code> element with its
1.85 mike 1035: <a href="association-of-controls-and-forms.html#form-owner">form owner</a>.</p>
1036:
1037: <div class="impl">
1.1 mike 1038:
1039: <p><strong>Constraint validation</strong>: <code><a href="#the-object-element">object</a></code>
1040: elements are always <a href="constraints.html#barred-from-constraint-validation">barred from constraint
1041: validation</a>.</p>
1042:
1.85 mike 1043: </div>
1044:
1045: <p>The <code><a href="#the-object-element">object</a></code> element supports <a href="dimension-attributes.html#dimension-attributes">dimension
1046: attributes</a>.</p>
1047:
1048: <div class="impl">
1.1 mike 1049:
1050: <p>The IDL attributes <dfn id="dom-object-data" title="dom-object-data"><code>data</code></dfn>, <dfn id="dom-object-type" title="dom-object-type"><code>type</code></dfn> and <dfn id="dom-object-name" title="dom-object-name"><code>name</code></dfn> each must
1051: <a href="common-dom-interfaces.html#reflect">reflect</a> the respective content attributes of the same
1052: name. The <dfn id="dom-object-typemustmatch" title="dom-object-typeMustMatch"><code>typeMustMatch</code></dfn>
1053: IDL attribute must <a href="common-dom-interfaces.html#reflect">reflect</a> the <code title="attr-object-typemustmatch"><a href="#attr-object-typemustmatch">typemustmatch</a></code> content
1054: attribute. The <dfn id="dom-object-usemap" title="dom-object-useMap"><code>useMap</code></dfn> IDL attribute
1055: must <a href="common-dom-interfaces.html#reflect">reflect</a> the <code title="attr-object-usemap">usemap</code> content attribute.</p>
1056:
1057: <p>The <dfn id="dom-object-contentdocument" title="dom-object-contentDocument"><code>contentDocument</code></dfn>
1058: IDL attribute must return the <code><a href="dom.html#document">Document</a></code> object of the
1059: <a href="browsers.html#active-document">active document</a> of the <code><a href="#the-object-element">object</a></code> element's
1060: <a href="browsers.html#nested-browsing-context">nested browsing context</a>, if it has one; otherwise, it
1061: must return null.</p>
1062:
1063: <p>The <dfn id="dom-object-contentwindow" title="dom-object-contentWindow"><code>contentWindow</code></dfn>
1064: IDL attribute must return the <code><a href="browsers.html#windowproxy">WindowProxy</a></code> object of the
1065: <code><a href="#the-object-element">object</a></code> element's <a href="browsers.html#nested-browsing-context">nested browsing context</a>,
1066: if it has one; otherwise, it must return null.</p>
1067:
1068: <p>The <code title="dom-cva-willValidate"><a href="constraints.html#dom-cva-willvalidate">willValidate</a></code>, <code title="dom-cva-validity"><a href="constraints.html#dom-cva-validity">validity</a></code>, and <code title="dom-cva-validationMessage"><a href="constraints.html#dom-cva-validationmessage">validationMessage</a></code>
1069: attributes, and the <code title="dom-cva-checkValidatity"><a href="constraints.html#dom-cva-checkvalidatity">checkValidity()</a></code> and <code title="dom-cva-setCustomValidity"><a href="constraints.html#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
1070: methods, are part of the <a href="constraints.html#the-constraint-validation-api">constraint validation API</a>. The
1071: <code title="dom-fae-form"><a href="association-of-controls-and-forms.html#dom-fae-form">form</a></code> IDL attribute is part of the
1072: element's forms API.</p>
1073:
1.34 mike 1074: <p>All <code><a href="#the-object-element">object</a></code> elements have a <dfn id="dom-object-caller" title="dom-object-caller">legacy caller operation</dfn>. If the
1075: <code><a href="#the-object-element">object</a></code> element has an instantiated <a href="infrastructure.html#plugin">plugin</a>
1076: that supports a scriptable interface that defines a legacy caller
1077: operation, then that must be the behavior of the object's legacy
1078: caller operation. Otherwise, the object's legacy caller operation
1079: must be to throw a <code><a href="infrastructure.html#notsupportederror">NotSupportedError</a></code> exception.</p>
1080:
1.85 mike 1081: </div>
1082:
1083: <div class="example">
1.1 mike 1084:
1085: <p>In the following example, a Java applet is embedded in a page
1086: using the <code><a href="#the-object-element">object</a></code> element. (Generally speaking, it is
1087: better to avoid using applets like these and instead use native
1088: JavaScript and HTML to provide the functionality, since that way
1089: the application will work on all Web browsers without requiring a
1090: third-party plugin. Many devices, especially embedded devices, do
1091: not support third-party technologies like Java.)</p>
1092:
1093: <pre><figure>
1094: <object type="application/x-java-applet">
1095: <param name="code" value="MyJavaClass">
1096: <p>You do not have Java available, or it is disabled.</p>
1097: </object>
1098: <figcaption>My Java Clock</figcaption>
1099: </figure></pre>
1100:
1.85 mike 1101: </div>
1102:
1103: <div class="example">
1.1 mike 1104:
1105: <p>In this example, an HTML page is embedded in another using the
1106: <code><a href="#the-object-element">object</a></code> element.</p>
1107:
1108: <pre><figure>
1109: <object data="clock.html"></object>
1110: <figcaption>My HTML Clock</figcaption>
1111: </figure></pre>
1112:
1.85 mike 1113: </div>
1114:
1115: <div class="example">
1.1 mike 1116:
1117: <p>The following example shows how a plugin can be used in HTML (in
1118: this case the Flash plugin, to show a video file). Fallback is
1119: provided for users who do not have Flash enabled, in this case
1120: using the <code><a href="the-video-element.html#the-video-element">video</a></code> element to show the video for those
1121: using user agents that support <code><a href="the-video-element.html#the-video-element">video</a></code>, and finally
1122: providing a link to the video for those who have neither Flash nor
1123: a <code><a href="the-video-element.html#the-video-element">video</a></code>-capable browser.</p>
1124:
1125: <pre><p>Look at my video:
1126: <object type="application/x-shockwave-flash">
1127: <param name=movie value="http://video.example.com/library/watch.swf">
1128: <param name=allowfullscreen value=true>
1129: <param name=flashvars value="http://video.example.com/vids/315981">
1130: <video controls src="http://video.example.com/vids/315981">
1131: <a href="http://video.example.com/vids/315981">View video</a>.
1132: </video>
1133: </object>
1134: </p></pre>
1135:
1.85 mike 1136: </div>
1137:
1138:
1139:
1140: </body></html>
Webmaster