Revision: 5567
Author:   [email protected]
Date:     Tue Aug 20 20:20:02 2013 UTC
Log:      Clean up some minor TODOs.
https://codereview.appspot.com/12797049

* 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.

[email protected]

http://code.google.com/p/google-caja/source/detail?r=5567

Modified:
 /trunk/src/com/google/caja/plugin/bridal.js
 /trunk/src/com/google/caja/plugin/domado.js
 /trunk/tests/com/google/caja/plugin/test-basic-functions-guest.html
 /trunk/tests/com/google/caja/plugin/test-domado-global.js

=======================================
--- /trunk/src/com/google/caja/plugin/bridal.js Wed Jun 19 20:54:01 2013 UTC
+++ /trunk/src/com/google/caja/plugin/bridal.js Tue Aug 20 20:20:02 2013 UTC
@@ -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;
-        }
-      };
-    }
   }

////////////////////////////////////////////////////////////////////////////
=======================================
--- /trunk/src/com/google/caja/plugin/domado.js Mon Aug 19 23:20:21 2013 UTC
+++ /trunk/src/com/google/caja/plugin/domado.js Tue Aug 20 20:20:02 2013 UTC
@@ -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));
         }),
=======================================
--- /trunk/tests/com/google/caja/plugin/test-basic-functions-guest.html Wed Aug 14 04:56:12 2013 UTC +++ /trunk/tests/com/google/caja/plugin/test-basic-functions-guest.html Tue Aug 20 20:20:02 2013 UTC
@@ -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);
=======================================
--- /trunk/tests/com/google/caja/plugin/test-domado-global.js Wed Aug 14 04:56:12 2013 UTC +++ /trunk/tests/com/google/caja/plugin/test-domado-global.js Tue Aug 20 20:20:02 2013 UTC
@@ -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; };' +

--

--- 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