From karl.rudd@gmail.com Thu Jun 8 00:23:36 2006 From: Karl Rudd To: development@drupal.org Subject: Re: [development] xhtml and embed tag: best way to compliance? Date: Thu, 08 Jun 2006 10:23:33 +1000 Message-ID: <26aff3d20606071723g6c7d65au15e1730127441c8b@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3549139111508808801==" --===============3549139111508808801== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I ran up against this a while ago and through a tonne of research this is what I have come up with. It's not exactly pretty but it works everywhere, including in XHTML Strict. Note the, of course, for Quicktime, Real, etc objects you'll have to change the "type" and "classid" values.

Alternative content.

Basically you're providing IE with an alternative version of the opening OBJECT tag. Additionally to deal with the whole "Click to interact with ActiveX control" thing I have, wrapped in conditional comments for "IE only", an external Javascript. Please note the "defer" attribute, it's very important. Basically it makes the script run after the page body has completed parsing, but while images, objects, etc are still loading. In the "iefixes.js" file I have code like this: var objects =3D document.getElementsByTagName( 'object' ); for ( var i =3D 0; i < objects.length; i++ ) objects[ i ].outerHTML =3D objects[ i ].outerHTML; And that's it. As I said, it's not pretty but it's the "least ugly" and the "least intrusive" way I could find to implement all of this. Karl Rudd Fabio Varesano wrote: > Hi everybody, > > I'm working on making my video module full XHTML compliant. > > At the moment the module uses a lot of embed tags for displaying video > content (Quicktime, Flash, Wmv, Real, etc...). > > The problem is that embed tags are NOT part of any W3C standard and > make a Drupal site which uses the Video module NOT W3 standard compliant. > > W3 compliant tag for embedding videos on xhtml pages is object but > it's not well supported by Internet Explorer... so an object only > implementation is not possible. > > So I investigate on some work around to create valid code but still IE > compatible.. > > And I finally get some types of solutions: > 1 - Javascript hacks: > basically leave only the object tag then onLoad add the embed tag to > the document. > 2 - CSS Tricks > creating two nested objects then use some css hacks to hide one > 3 - Extending XHTML > extends default XHTML dtds to create a custom made embed tag > > > While the first and second solutions are only hacks and are prone to > errors and incompatibility between current and future versions of > browsers, the third solution is much more elegant and should be > supported by future versions of browsers without giving us headaches. > > So.. IMHO the best way in doing this is solution 3. > > Extending XHTML can be done in two ways: > - creating a custom made DTD > - extending an existing DTD by adding new rule as an internal subset > directly in the document > > The problem is that using a customized DTD will produce a document not > validable by W3C validator.. Other validators can be used. > > Instead extending DTD directly on document will create a W3 validable > document but browsers (even firefox 1.5) will display a "]>" on the > first line of the page... > > So... I'd like to hear your suggestion in facing this problem. > For me the DTD extension on document is the best solution but I need > to find some hacks to let browsers hide the "]>"... > > What do you think about this??? > > Thank you. > > Fabio Varesano --===============3549139111508808801==-- From fabio.varesano@gmail.com Sat Jun 10 13:36:10 2006 From: Fabio Varesano To: development@drupal.org Subject: Re: [development] xhtml and embed tag: best way to compliance? Date: Sat, 10 Jun 2006 15:36:21 +0200 Message-ID: <448ACAD5.2010703@gmail.com> In-Reply-To: <26aff3d20606071723g6c7d65au15e1730127441c8b@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3765144955637932957==" --===============3765144955637932957== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thank you Karl. After some more research I understood that your solution is the best. I'm currently implementing it in my video module. As soon as I finish the implementation I will post to this list asking to people to try playing videos of all different formats. This will helps finding incompatibilities between different browsers and plug-in versions or vendors. A huge thank you. Fabio Varesano Karl Rudd wrote: > I ran up against this a while ago and through a tonne of research this > is what I have come up with. It's not exactly pretty but it works > everywhere, including in XHTML Strict. >=20 > Note the, of course, for Quicktime, Real, etc objects you'll have to > change the "type" and "classid" values. >=20 > > data=3D"flash.swf"> > > > >

Alternative content.

>
>=20 > Basically you're providing IE with an alternative version of the > opening OBJECT tag. >=20 > Additionally to deal with the whole "Click to interact with ActiveX > control" thing I have, wrapped in conditional comments for "IE only", > an external Javascript. >=20 > >=20 > Please note the "defer" attribute, it's very important. Basically it > makes the script run after the page body has completed parsing, but > while images, objects, etc are still loading. >=20 > In the "iefixes.js" file I have code like this: >=20 > var objects =3D document.getElementsByTagName( 'object' ); > for ( var i =3D 0; i < objects.length; i++ ) > objects[ i ].outerHTML =3D objects[ i ].outerHTML; >=20 > And that's it. >=20 > As I said, it's not pretty but it's the "least ugly" and the "least > intrusive" way I could find to implement all of this. >=20 > Karl Rudd >=20 >=20 > Fabio Varesano wrote: >> Hi everybody, >> >> I'm working on making my video module full XHTML compliant. >> >> At the moment the module uses a lot of embed tags for displaying video >> content (Quicktime, Flash, Wmv, Real, etc...). >> >> The problem is that embed tags are NOT part of any W3C standard and >> make a Drupal site which uses the Video module NOT W3 standard compliant. >> >> W3 compliant tag for embedding videos on xhtml pages is object but >> it's not well supported by Internet Explorer... so an object only >> implementation is not possible. >> >> So I investigate on some work around to create valid code but still IE >> compatible.. >> >> And I finally get some types of solutions: >> 1 - Javascript hacks: >> basically leave only the object tag then onLoad add the embed tag to >> the document. >> 2 - CSS Tricks >> creating two nested objects then use some css hacks to hide one >> 3 - Extending XHTML >> extends default XHTML dtds to create a custom made embed tag >> >> >> While the first and second solutions are only hacks and are prone to >> errors and incompatibility between current and future versions of >> browsers, the third solution is much more elegant and should be >> supported by future versions of browsers without giving us headaches. >> >> So.. IMHO the best way in doing this is solution 3. >> >> Extending XHTML can be done in two ways: >> - creating a custom made DTD >> - extending an existing DTD by adding new rule as an internal subset >> directly in the document >> >> The problem is that using a customized DTD will produce a document not >> validable by W3C validator.. Other validators can be used. >> >> Instead extending DTD directly on document will create a W3 validable >> document but browsers (even firefox 1.5) will display a "]>" on the >> first line of the page... >> >> So... I'd like to hear your suggestion in facing this problem. >> For me the DTD extension on document is the best solution but I need >> to find some hacks to let browsers hide the "]>"... >> >> What do you think about this??? >> >> Thank you. >> >> Fabio Varesano >=20 --===============3765144955637932957==--