Reviewers: felix8a,
Description:
Fix http://code.google.com/p/google-caja/issues/detail?id=1446
Per suggestion by felix8a@, just remove setting of title entirely.
Please review this at http://codereview.appspot.com/5676059/
Affected files:
M src/com/google/caja/plugin/caja.js
M tests/com/google/caja/plugin/es53-test-domado-dom-guest.html
Index: tests/com/google/caja/plugin/es53-test-domado-dom-guest.html
===================================================================
--- tests/com/google/caja/plugin/es53-test-domado-dom-guest.html (revision
4772)
+++ tests/com/google/caja/plugin/es53-test-domado-dom-guest.html (working
copy)
@@ -1852,17 +1852,17 @@
tagName: 'HEAD',
nodeValue: null,
attributes: [],
- innerHTML: '<title><Untrusted Content
Title></title>',
+ innerHTML: '<title></title>',
children: [
{
nodeType: 1,
tagName: 'TITLE',
nodeValue: null,
attributes: [],
- innerHTML: '<Untrusted Content Title>',
+ innerHTML: '',
children: [ {
nodeType: 3,
- nodeValue: '<Untrusted Content Title>'
+ nodeValue: ''
} ]
}
]
@@ -1881,7 +1881,7 @@
var html = document.documentElement.innerHTML;
assertTrue(!!html.match(
- '<head><title><Untrusted Content
Title></title></head><body>'));
+ '<head><title></title></head><body>'));
pass('testDocumentElement');
});
Index: src/com/google/caja/plugin/caja.js
===================================================================
--- src/com/google/caja/plugin/caja.js (revision 4773)
+++ src/com/google/caja/plugin/caja.js (working copy)
@@ -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');