Revision: 4790
Author: [email protected]
Date: Mon Feb 27 16:13:13 2012
Log: Test document.all.
http://codereview.appspot.com/5698077
document.all is native object on IE such that document.all[x] is similar to
document.getElementById(x).
It is worth separate testing because Firefox supports it, but treats it
specially so that:
typeof document.all === "undefined"
!!document.all
so that feature detection code will take the no document.all path, but code
that does not feature detect will continue to work in quirks mode:
document.all.x
is not a TypeError. It is in the square free shell which is in standards
compliance mode.
http://weblogs.mozillazine.org/asa/archives/007118.html explains:
"""
December 17, 2004
mozilla 1.7.5 released
...
The new undetectable document.all support, and support for exposing
elements by their ID in the global scope for greater IE compatibility when
viewing pages that don't request standards compliant behaviour is
documented in bugs 248549 and 256932.
"""
[email protected]
http://code.google.com/p/google-caja/source/detail?r=4790
Modified:
/trunk/tests/com/google/caja/plugin/es53-test-domado-special-guest.html
/trunk/tests/com/google/caja/plugin/es53-test-domado-special-initial-state.html
=======================================
--- /trunk/tests/com/google/caja/plugin/es53-test-domado-special-guest.html
Mon Jan 16 15:31:02 2012
+++ /trunk/tests/com/google/caja/plugin/es53-test-domado-special-guest.html
Mon Feb 27 16:13:13 2012
@@ -306,6 +306,14 @@
child.nodeValue = 'Foo';
assertEquals('Foo', child.nodeValue);
+ var dangerousObject;
+ try {
+ dangerousObject= document.all['dangerous-object'];
+ } catch (e) {
+ // ok
+ }
+ assertEquals('dangerousObject', void 0, dangerousObject);
+
pass('test-opaque-nodes');
});
</script>
=======================================
---
/trunk/tests/com/google/caja/plugin/es53-test-domado-special-initial-state.html
Tue Sep 6 15:13:05 2011
+++
/trunk/tests/com/google/caja/plugin/es53-test-domado-special-initial-state.html
Mon Feb 27 16:13:13 2012
@@ -63,7 +63,7 @@
<div class="testcontainer" id="test-opaque-nodes-IDSUFFIX"
><!-- Comment -->a<script id="howdy-script-IDSUFFIX">/* Howdy */</script
- >b<object>obj</object>c</div>
+ >b<object id="dangerous-object">obj</object>c</div>
<!-- http://www.google.com/favicon.ico has been visited
by the above IMG tag -->