PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm_DHTMLRulesTableless » Bug #9497

javascript back- and forward compatibillity

Details

Request #9497javascript back- and forward compatibillity
Submitted2006-11-29 13:28 UTC
Frompear_dev at willfris dot nl
Assignedwiesemann
StatusClosed
PackageHTML_QuickForm_DHTMLRulesTableless
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2006-11-29 13:28 UTC] pear_dev at willfris dot nl

Description:
------------
As stated on http://hixie.ch/advocacy/xhtml:
* <script> and <style> elements in XHTML sent as text/html have to be
escaped using ridiculously complicated strings.

This is because in XHTML, <script> and <style> elements are #PCDATA
blocks, not #CDATA blocks, and therefore <!-- and --> really _are_
comments tags, and are not ignored by the XHTML parser. To escape
script in an XHTML document which may be handled as either HTML4 or
XHTML, you have to use:

<script type="text/javascript"><!--//--><![CDATA[//><!--
...
//--><!]]></script>

Expected result:
----------------
line 122:
//<![CDATA[
becomes:
<!--//--><![CDATA[//><!--
line 243:
//]]>
becomes:
//--><!]]>

(Maybe also clear the 4 spaces on line 145)

[2006-11-29 21:33 UTC] pear_dev at willfris dot nl

I have not found any problems with a browser regarding this issue.

| My tableless renderer generates valid XHTML. And XHTML is
| understood by all modern browsers, so I don't see a
| reason to be compliant to very old browsers.
| Using <!-- and --> was needed a "long" time ago,
| but such browsers might not even know that XHTML exists.
They don't indeed
and why support that old stuff?
Just keep it from generating errors...

I must say the php-code behind the javascript code I find quite impressing. And I am still figering(is that correct english?) out how it works, if I find something, I'll post it here.

[2006-12-02 14:51 UTC] pear_dev at willfris dot nl

| Please give me short hint on your opinion: Do you agree
| with me that the current "//<![CDATA[" usage is okay or
| would say that it is better to use the notation as on
| the hixie.ch page?
I personally would prefer supporting backward compatibillity. Especially as this makes it usable for a wider group and because it doesn't break down the upward compatibillity. Then again you could keep it like this and demand an upgrade from those old-browser-using-users.

Groeten, Will.
Near A'dam, NL ;)