Reviewers: ihab.awad,

Description:
Fixes <https://code.google.com/p/google-caja/issues/detail?id=1669>.

Updated jQuery UI test counts. The regressions are from r5464, but this
patch fixes the major one in 'accordion'.

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

Affected files:
  M     src/com/google/caja/plugin/domado.js
  M     tests/com/google/caja/plugin/es53-test-domado-dom-guest.html
  M     tests/com/google/caja/plugin/third-party-tests.json


Index: tests/com/google/caja/plugin/third-party-tests.json
===================================================================
--- tests/com/google/caja/plugin/third-party-tests.json (revision 5479)
+++ tests/com/google/caja/plugin/third-party-tests.json (working copy)
@@ -203,7 +203,7 @@
       },
       {
         "guest": "button",
-        "expected-pass": "all"
+        "expected-pass": 78
       },
       {
         "guest": "core",
@@ -225,7 +225,7 @@
       },
       {
         "guest": "dialog",
-        "expected-pass": { "firefox": 220, "chrome": 227 },
+        "expected-pass": { "firefox": 219, "chrome": 226 },
         "comment": [
           "Current failure categories:",
             "What may be event simulation failures",
@@ -278,7 +278,7 @@
       },
       {
         "guest": "tabs",
-        "expected-pass": { "firefox": 487, "chrome": 519 },
+        "expected-pass": { "firefox": 485, "chrome": 517 },
         "comment": [
           "Current modifications made to test suite:",
"Work around lost-signal problems due to lack of event simulation",
Index: tests/com/google/caja/plugin/es53-test-domado-dom-guest.html
===================================================================
--- tests/com/google/caja/plugin/es53-test-domado-dom-guest.html (revision 5479) +++ tests/com/google/caja/plugin/es53-test-domado-dom-guest.html (working copy)
@@ -895,8 +895,22 @@
     assertQueryResult('#testQuerySelector p', ['a', 'b']);
assertEquals('scoped query', 2, container.querySelectorAll('p').length);
     expectFailure(function() {
+      document.querySelector(':unrecognized');
+    }, 'syntax error solo', function(e) {
+      return e.name === 'SyntaxError';
+    });
+    expectFailure(function() {
+      document.querySelector('good,:unrecognized');
+    }, 'syntax error one of two', function(e) {
+      return e.name === 'SyntaxError';
+    });
+    expectFailure(function() {
       document.querySelector(',');
-    }, 'syntax error');
+    }, 'syntax error one of two', function(e) {
+      // https://code.google.com/p/google-caja/issues/detail?id=1804
+      //return e.name === 'SyntaxError';
+      return true;
+    });

     // test non-liveness
     var list = container.querySelectorAll('p');
Index: src/com/google/caja/plugin/domado.js
===================================================================
--- src/com/google/caja/plugin/domado.js        (revision 5479)
+++ src/com/google/caja/plugin/domado.js        (working copy)
@@ -3329,11 +3329,18 @@
         }
       }

+      function querySelectorFail(tokens) {
+ var error = new Error('Erroneous or unsupported selector syntax: ' +
+            tokens.join(''));
+        error.name = 'SyntaxError';
+        throw error;
+      }
       function tameQuerySelector(rootFeralNode, guestSelector, returnAll) {
         var virtualizedSelectors = sanitizeCssSelectors(
           lexCss(guestSelector),
           idClass,
-          tagPolicy);
+          tagPolicy,
+          querySelectorFail);
         var historyInsensitiveVirtualizedSelectors =
           virtualizedSelectors[0].join(',');
         if (returnAll) {


--

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