Permalink
Browse files

Add empty vbscript block at end of htc file as a workaround for very …

  • Loading branch information...
1 parent 9fcfa80 commit 1da1423cecd06c5e1809cd7b89b185eeb7d57e4f Jason Johnston committed Nov 6, 2011
Showing with 38 additions and 16 deletions.
  1. +31 −16 build.xml
  2. +7 −0 sources/htc_close.txt
View
@@ -54,6 +54,12 @@
<fileset file="${src_dir}/Element.js" />
<fileset file="${src_dir}/PIE_API.js" />
<fileset file="${src_dir}/js_close.js" />
+
+ <filterchain>
+ <tokenfilter>
+ <replacestring from="$Version$" to="${version}" />
+ </tokenfilter>
+ </filterchain>
</concat>
<concat destfile="${build_dir}/PIE_IE9_uncompressed.js">
@@ -86,21 +92,27 @@
<fileset file="${src_dir}/Element.js" />
<fileset file="${src_dir}/PIE_API.js" />
<fileset file="${src_dir}/js_close.js" />
+
+ <filterchain>
+ <tokenfilter>
+ <replacestring from="$Version$" to="${version}" />
+ </tokenfilter>
+ </filterchain>
</concat>
<concat destfile="${build_dir}/PIE_uncompressed.htc">
<fileset file="${src_dir}/htc_open.txt" />
<fileset file="${src_dir}/htc_script.js" />
<fileset file="${src_dir}/htc_close.txt" />
- </concat>
- <replace file="${build_dir}/PIE_uncompressed.htc">
- <replacefilter token="$Version$" value="${version}" />
- <replacefilter token="$JSVariant$" value="_uncompressed" />
- <replacefilter token="$DefaultBaseUrls$" value="${default_base_urls}" />
- </replace>
- <replace file="${build_dir}/PIE_IE678_uncompressed.js" token="$Version$" value="${version}"/>
- <replace file="${build_dir}/PIE_IE9_uncompressed.js" token="$Version$" value="${version}"/>
+ <filterchain>
+ <tokenfilter>
+ <replacestring from="$Version$" to="${version}" />
+ <replacestring from="$JSVariant$" to="_uncompressed" />
+ <replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
+ </tokenfilter>
+ </filterchain>
+ </concat>
</target>
<target name="build-compressed" depends="build-uncompressed">
@@ -137,15 +149,18 @@
<fileset file="${src_dir}/htc_open.txt" />
<fileset file="${build_dir}/htc_script_compressed.js" />
<fileset file="${src_dir}/htc_close.txt" />
- </concat>
- <replace file="${build_dir}/PIE.htc">
- <replacefilter token="$Version$" value="${version}" />
- <replacefilter token="$JSVariant$" value="" />
- <replacefilter token="$DefaultBaseUrls$" value="${default_base_urls}" />
- </replace>
- <replace file="${build_dir}/PIE_IE678.js" token="$Version$" value="${version}"/>
- <replace file="${build_dir}/PIE_IE9.js" token="$Version$" value="${version}"/>
+ <filterchain>
+ <striplinecomments>
+ <comment value="//#" />
+ </striplinecomments>
+ <tokenfilter>
+ <replacestring from="$Version$" to="${version}" />
+ <replacestring from="$JSVariant$" to="" />
+ <replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
+ </tokenfilter>
+ </filterchain>
+ </concat>
<delete file="${build_dir}/temp.js" />
<delete file="${build_dir}/htc_script_compressed.js" />
View
@@ -1,2 +1,9 @@
</script>
+
+//# IE will sometimes hang for a long time on unload of pages with .htc behaviors
+//# attached to many elements, if the script block is a certain size. We can work
+//# around this by including an empty vbscript block at the end. For more details:
+//# http://www.pcreview.co.uk/forums/htc-components-512-bytes-javascript-slow-unload-t727396.html
+//# http://code.google.com/p/svgweb/source/browse/trunk/src/svg.htc
+<script type="text/vbscript"></script>
</PUBLIC:COMPONENT>

0 comments on commit 1da1423

Please sign in to comment.