Revision: 4781
Author:   ihab.awad
Date:     Wed Feb 15 16:13:44 2012
Log:      Remove content title
http://codereview.appspot.com/5676059

Fix http://code.google.com/p/google-caja/issues/detail?id=1446
Per suggestion by felix8a@, just remove setting of title entirely.

[email protected]

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

Modified:
 /trunk/src/com/google/caja/plugin/caja.js
 /trunk/tests/com/google/caja/plugin/es53-test-domado-dom-guest.html

=======================================
--- /trunk/src/com/google/caja/plugin/caja.js   Tue Jan 31 18:00:17 2012
+++ /trunk/src/com/google/caja/plugin/caja.js   Wed Feb 15 16:13:44 2012
@@ -360,14 +360,11 @@
     }
     domOpts = domOpts || {};
     var opt_idClass = domOpts ? domOpts.idClass : void 0;
-    var opt_title = domOpts && domOpts.title ?
-        domOpts.title : '<Untrusted Content Title>';
     var idClass = opt_idClass || ('caja-guest-' + nextId++ + '___');
     var inner = null;
     var outer = null;
     if (div) {
       inner = div.ownerDocument.createElement('div');
-      inner.setAttribute('title', opt_title);
       inner.style.display = 'block';
       inner.style.position = 'relative';
       outer = div.ownerDocument.createElement('div');
=======================================
--- /trunk/tests/com/google/caja/plugin/es53-test-domado-dom-guest.html Thu Feb 9 21:05:25 2012 +++ /trunk/tests/com/google/caja/plugin/es53-test-domado-dom-guest.html Wed Feb 15 16:13:44 2012
@@ -1853,17 +1853,17 @@
                   tagName: 'HEAD',
                   nodeValue: null,
                   attributes: [],
- innerHTML: '<title>&lt;Untrusted Content Title&gt;</title>',
+                  innerHTML: '<title></title>',
                   children: [
                     {
                       nodeType: 1,
                       tagName: 'TITLE',
                       nodeValue: null,
                       attributes: [],
-                      innerHTML: '&lt;Untrusted Content Title&gt;',
+                      innerHTML: '',
                       children: [ {
                         nodeType: 3,
-                        nodeValue: '<Untrusted Content Title>'
+                        nodeValue: ''
                       } ]
                     }
                   ]
@@ -1882,7 +1882,7 @@

       var html = document.documentElement.innerHTML;
       assertTrue(!!html.match(
- '<head><title>&lt;Untrusted Content Title&gt;</title></head><body>'));
+        '<head><title></title></head><body>'));

       pass('testDocumentElement');
     });

Reply via email to