Reviewers: felix8a,

Description:
* Remove obsolete workaround from test-domado-global testOnloadProp.
* Enable disabled tests of assignment to predefined global variables
  in test-basic-functions.
* Remove obsolete code for old-style virtualized attributes from
  bridal.cloneNode.
* Expand comment on document.write's return value.

Please review this at https://codereview.appspot.com/12797049/

Affected files:
  M     src/com/google/caja/plugin/bridal.js
  M     src/com/google/caja/plugin/domado.js
  M     tests/com/google/caja/plugin/test-basic-functions-guest.html
  M     tests/com/google/caja/plugin/test-domado-global.js


Index: tests/com/google/caja/plugin/test-domado-global.js
===================================================================
--- tests/com/google/caja/plugin/test-domado-global.js  (revision 5566)
+++ tests/com/google/caja/plugin/test-domado-global.js  (working copy)
@@ -188,7 +188,6 @@
      */
     (function () {
       registerGuestTest('testOnloadProp',
- '<body>' + // TODO(kpreid): That this is required is a HtmlEmitter bug
           '<script>' +
           'window.onload = function () { ' +
           '  window.testresult = (window.testresult || 0)+1; };' +
Index: tests/com/google/caja/plugin/test-basic-functions-guest.html
===================================================================
--- tests/com/google/caja/plugin/test-basic-functions-guest.html (revision 5566) +++ tests/com/google/caja/plugin/test-basic-functions-guest.html (working copy)
@@ -52,10 +52,8 @@
 </div>
 <script type="text/javascript">
   var foo = 0;
-  // TODO(kpreid): Enable for ES5 mode after implementing proper scoping
-  jsunitRegisterIf(!inES5Mode,
-                   'testGlobalWindowProperties',
-                   function testGlobalWindowProperties() {
+  jsunitRegister('testGlobalWindowProperties',
+                 function testGlobalWindowProperties() {
     assertEquals(0, foo);
     window.foo = 1;
     assertEquals(1, foo);
@@ -72,10 +70,8 @@
   testGlobalWindowReassignment
 </div>
 <script type="text/javascript">
-  // TODO(kpreid): Enable for ES5 mode and debug 'Cannot set "window"'
-  jsunitRegisterIf(!inES5Mode,
-                   'testGlobalWindowReassignment',
-                   function testGlobalWindowReassignment() {
+  jsunitRegister('testGlobalWindowReassignment',
+                 function testGlobalWindowReassignment() {
     assertEquals(globalThis, window);
     var origWindow = window;
     window = 1;
@@ -90,10 +86,8 @@
   testGlobalSelfReassignment
 </div>
 <script type="text/javascript">
-// TODO(kpreid): Enable for ES5 mode and debug 'Cannot set "self"'
-  jsunitRegisterIf(!inES5Mode,
-                   'testGlobalSelfReassignment',
-                   function testGlobalSelfReassignment() {
+  jsunitRegister('testGlobalSelfReassignment',
+                 function testGlobalSelfReassignment() {
     assertEquals(globalThis, self);
     var origSelf = self;
     self = 1;
@@ -108,10 +102,8 @@
   testGlobalNodeClassesReassignment
 </div>
 <script type="text/javascript">
-// TODO(kpreid): Enable for ES5 mode and debug 'Cannot set "HTMLElement"'
-  jsunitRegisterIf(!inES5Mode,
-                   'testGlobalNodeClassesReassignment',
-                   function testGlobalNodeClassesReassignment() {
+  jsunitRegister('testGlobalNodeClassesReassignment',
+                 function testGlobalNodeClassesReassignment() {
     var origElement = HTMLElement;
     HTMLElement = 1;
     assertEquals(1, window.HTMLElement);
Index: src/com/google/caja/plugin/bridal.js
===================================================================
--- src/com/google/caja/plugin/bridal.js        (revision 5566)
+++ src/com/google/caja/plugin/bridal.js        (working copy)
@@ -231,28 +231,6 @@
           break;
       }
     }
-
-    // Do not copy listeners since DOM2 specifies that only attributes and
-    // children are copied, and that children should only be copied if the
-    // deep flag is set.
-    // The children are handled in constructClone.
-    // TODO(kpreid): This is interpreting Domado's expando-attributes map;
-    // modularity problem?
-    var originalAttribs = node._d_attributes;
-    if (originalAttribs) {
-      var attribs = {};
-      clone._d_attributes = attribs;
-      var k, v;
-      for (k in originalAttribs) {
-        if (/__$/.test(k)) { continue; }
-        v = originalAttribs[k];
-        switch (typeof v) {
-          case 'string': case 'number': case 'boolean':
-            attribs[k] = v;
-            break;
-        }
-      };
-    }
   }

////////////////////////////////////////////////////////////////////////////
Index: src/com/google/caja/plugin/domado.js
===================================================================
--- src/com/google/caja/plugin/domado.js        (revision 5566)
+++ src/com/google/caja/plugin/domado.js        (working copy)
@@ -6454,8 +6454,9 @@
           if (!domicile.writeHook) {
throw new Error('document.write not provided for this document');
           }
-          // TODO(kpreid): Per HTML5, document.write is void, so why are we
-          // returning anything?
+ // TODO(kpreid): Per HTML5, document.write is void. This return value
+          // is used internally by ses-frame-group.js to call the run()
+          // callback, and ought to be a strictly internal interface.
           return domicile.writeHook.write.apply(undefined,
               Array.prototype.slice.call(arguments, 1));
         }),


--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to