hiimnalaa / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

HTML5 Validation: Invalid markup errors #581

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Validating an HTML5 document
2. Observe errors at <object> attributes
3. "Element object is missing one or more of the following attributes: data, 
type."

What is the expected output? What do you see instead?

I expect it to validate w3c compliant. Instead it throws errors on missing 
'data' and/or 'type' attributes.

What version of the product are you using? On what operating system?
2.2

Please provide any additional information below.

Original issue reported on code.google.com by dan....@gmail.com on 26 Jul 2011 at 1:19

GoogleCodeExporter commented 9 years ago
http://validator.w3.org/check?uri=www.alexpap.com&charset=%28detect+automaticall
y%29&doctype=HTML5&group=0

Original comment by dan....@gmail.com on 26 Jul 2011 at 1:20

GoogleCodeExporter commented 9 years ago
We are investigating HTML5 validation as part of our upcoming SWFObject 2.3 
release, but we are bound by Internet Explorer's limitations, and cannot make 
any promises.

Original comment by platelu...@gmail.com on 26 Jul 2011 at 8:37

GoogleCodeExporter commented 9 years ago
I have looked but haven't found... do you know of another solution for 
providing alternative content that might be w3c valid?

Thanks btw, works great as it is - good luck with IE(gagh!)

Original comment by dan....@gmail.com on 26 Jul 2011 at 8:40

GoogleCodeExporter commented 9 years ago
If you're using static publishing, you can try the simplified double-object 
syntax discussed here:

http://code.google.com/p/swfobject/issues/detail?id=414#c3

It validates with HTML5 because the IE object is hidden via conditional 
comments.

Original comment by platelu...@gmail.com on 26 Jul 2011 at 8:53

GoogleCodeExporter commented 9 years ago
The current SWFObject static syntax will fail HTML5 validation due to the 
inclusion of the classid attribute and exclusion of the data attribute in the 
<object> created for IE.

The simplified double-object syntax fixes this problem:

<!--[if IE]>
<object id='mySWF' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' 
width='550px'
height='400px'>
<param name='movie' value='file.swf'>
<![endif]-->

<!--[if !IE]>-->
<object id='mySWF' type='application/x-shockwave-flash' data='file.swf' 
width='550px'
height='400px'>
<!--<![endif]-->

<param name='allowfullscreen' value='true'>
<param name='allowscriptaccess' value='sameDomain'>

<p>Fallback HTML</p>

</object>

The only drawback here is that Internet Explorer 8 and lower will display an 
errant <![endif]--> comment on the page if swfobject.registerObject is used and 
the required version of Flash Player is not available. This does errant 
<![endif]--> does not appear in IE 9, so I believe it's a bug in IE's 
conditional comment system.

Original comment by platelu...@gmail.com on 20 Oct 2011 at 4:42