Revision: 5637
Author:   [email protected]
Date:     Fri Nov 22 21:19:39 2013 UTC
Log:      allow multiple css pseudo-selectors (merge from trunk)
svn merge -c 5636 https://google-caja.googlecode.com/svn/trunk/

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

Modified:
 /branches/es53
 /branches/es53/src/com/google/caja/plugin/sanitizecss.js
 /branches/es53/tests/com/google/caja/plugin/csslexer-test.js
 /branches/es53/tests/com/google/caja/plugin/sanitizecss_test.js

=======================================
--- /branches/es53/src/com/google/caja/plugin/sanitizecss.js Wed Sep 18 20:40:53 2013 UTC +++ /branches/es53/src/com/google/caja/plugin/sanitizecss.js Fri Nov 22 21:19:39 2013 UTC
@@ -637,12 +637,11 @@
                 valid = false;
               }
               historySensitive = true;
-              pseudoSelector = ':' + tok;
+              pseudoSelector += ':' + tok;
               element = 'a';
             } else if (
-              HISTORY_NON_SENSITIVE_PSEUDO_SELECTOR_WHITELIST.test(tok)) {
-              historySensitive = false;
-              pseudoSelector = ':' + tok;
+ HISTORY_NON_SENSITIVE_PSEUDO_SELECTOR_WHITELIST.test(tok)) {
+              pseudoSelector += ':' + tok;
             } else {
               break;
             }
=======================================
--- /branches/es53/tests/com/google/caja/plugin/csslexer-test.js Wed Jul 24 18:20:09 2013 UTC +++ /branches/es53/tests/com/google/caja/plugin/csslexer-test.js Fri Nov 22 21:19:39 2013 UTC
@@ -966,6 +966,13 @@
   jsunit.pass();
 });

+jsunitRegister('testLex60', function testLex59() {
+  assertLexedCss(
+    'a:hover:focus',
+    'a', ':', 'hover', ':', 'focus');
+  jsunit.pass();
+});
+
 jsunitRegister('testIssue1804', function testIssue1804() {
   assertLexedCss(',',  ',');
   assertLexedCss('a,', 'a', ',');
=======================================
--- /branches/es53/tests/com/google/caja/plugin/sanitizecss_test.js Wed Aug 28 18:22:02 2013 UTC +++ /branches/es53/tests/com/google/caja/plugin/sanitizecss_test.js Fri Nov 22 21:19:39 2013 UTC
@@ -287,6 +287,7 @@
     "#foo:first-letter", "sfx", [[".sfx #foo-sfx:first-letter"], []]);
   assertSelector("#foo:focus", "sfx", [[".sfx #foo-sfx:focus"], []]);
   assertSelector("#foo:hover", "sfx", [[".sfx #foo-sfx:hover"], []]);
+ assertSelector("#x:hover:focus", "sfx", [[".sfx #x-sfx:hover:focus"], []]);
   assertSelector("#foo:bogus", "sfx", [[], []]);
   jsunit.pass();
 });

--

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