Reviewers: jasvir,

Description:
Fix testPseudoElements which was failing on all browsers.

Please review this at http://codereview.appspot.com/11949

Affected files:
  M     src/com/google/caja/plugin/domita.js
  M     tests/com/google/caja/plugin/domita_test_untrusted.html


Index: tests/com/google/caja/plugin/domita_test_untrusted.html
===================================================================
--- tests/com/google/caja/plugin/domita_test_untrusted.html     (revision 3192)
+++ tests/com/google/caja/plugin/domita_test_untrusted.html     (working copy)
@@ -655,13 +655,13 @@
   var title = document.getElementsByTagName('title')[0];
   var html = document.getElementsByTagName('html')[0];

-  assertEquals('body', body.getTagName());
+  assertEquals('BODY', body.getTagName());
   assertEquals('', body.getAttribute('foo'));
-  assertEquals('head', head.getTagName());
+  assertEquals('HEAD', head.getTagName());
   assertEquals('', head.getAttribute('foo'));
-  assertEquals('title', title.getTagName());
+  assertEquals('TITLE', title.getTagName());
   assertEquals('', title.getAttribute('foo'));
-  assertEquals('html', body.getTagName());
+  assertEquals('HTML', html.getTagName());
   assertEquals('', html.getAttribute('foo'));

   pass('test-pseudo-elements');
Index: src/com/google/caja/plugin/domita.js
===================================================================
--- src/com/google/caja/plugin/domita.js        (revision 3192)
+++ src/com/google/caja/plugin/domita.js        (working copy)
@@ -2586,6 +2586,7 @@
         case 'body': return fakeNodeList([ this.getBody() ]);
         case 'head': return fakeNodeList([ this.getHead() ]);
         case 'title': return fakeNodeList([ this.getTitle() ]);
+        case 'html': return fakeNodeList([ this.getDocumentElement() ]);
         default:
           return tameGetElementsByTagName(
               this.body___, tagName, this.editable___);


Reply via email to