I'd like you to do a code review. To review this change, run gvn review --project https://google-caja.googlecode.com/svn mikesamuel/[EMAIL PROTECTED]
Alternatively, to review the latest snapshot of this change branch, run gvn --project https://google-caja.googlecode.com/svn review mikesamuel/bug-900-fix-demos to review the following change: *mikesamuel/[EMAIL PROTECTED] | mikesamuel | 2008-11-12 17:35:07 -0800 (Wed, 12 Nov 2008) Description: Partial fix for calendar demo. * updates taming decisions * fix bug with el.onclick = ...; in dDOMita. * add CSS back to the cajoled calendar. Affected Paths: M //trunk/build.xml M //trunk/src/com/google/caja/cajita.js M //trunk/src/com/google/caja/demos/calendar/demo-cajoled.html M //trunk/src/com/google/caja/demos/calendar/main.js M //trunk/src/com/google/caja/plugin/domita.js M //trunk/tests/com/google/caja/plugin/domita_test_untrusted.html This is a semiautomated message from "gvn mail". See <http://code.google.com/p/gvn/> to learn more. Index: build.xml =================================================================== --- build.xml (^/trunk/[EMAIL PROTECTED]) +++ build.xml (^/changes/mikesamuel/bug-900-fix-demos/trunk/[EMAIL PROTECTED]) @@ -806,8 +806,38 @@ <transform> <output file="${lib}/com/google/caja/demos/calendar/calendar-minified.js" language="javascript" renderer="minify"/> + <include file="${demos}/calendar/util.js"/> + <include file="${demos}/calendar/bitset.js"/> + <include file="${lib}/com/google/caja/plugin/html4-defs.js"/> + <include file="${src}/com/google/caja/plugin/html-sanitizer.js"/> + <include file="${demos}/calendar/uformat.js"/> + <include file="${demos}/calendar/time-cajita.js"/> + <include file="${demos}/calendar/weekday-cajita.js"/> + <include file="${demos}/calendar/timezone-cajita.js"/> + <include file="${demos}/calendar/time_util-cajita.js"/> + <include file="${demos}/calendar/hcalendar.js"/> + <include file="${demos}/calendar/generators-cajita.js"/> + <include file="${demos}/calendar/instanceGenerators-cajita.js"/> + <include file="${demos}/calendar/conditions-cajita.js"/> + <include file="${demos}/calendar/predicates-cajita.js"/> + <include file="${demos}/calendar/filters-cajita.js"/> + <include file="${demos}/calendar/rrule-cajita.js"/> + <include file="${demos}/calendar/event.js"/> + <include file="${demos}/calendar/chip.js"/> + <include file="${demos}/calendar/calendar.js"/> + <include file="${demos}/calendar/event_store.js"/> + <include file="${demos}/calendar/axis.js"/> + <include file="${demos}/calendar/layout_policy.js"/> + <include file="${demos}/calendar/layout.js"/> + <include file="${demos}/calendar/overlap.js"/> + <include file="${demos}/calendar/widget.js"/> + <include file="${demos}/calendar/widget-html.js"/> + <include file="${demos}/calendar/main.js"/> + </transform> + <transform> <output file="${lib}/com/google/caja/demos/calendar/calendar.vo.js" language="valija" debug="false"/> + <include file="${demos}/calendar/widget.css"/> <include file="${demos}/calendar/util.js"/> <include file="${demos}/calendar/bitset.js"/> <include file="${lib}/com/google/caja/plugin/html4-defs.js"/> Index: src/com/google/caja/cajita.js =================================================================== --- src/com/google/caja/cajita.js (^/trunk/src/com/google/caja/[EMAIL PROTECTED]) +++ src/com/google/caja/cajita.js (^/changes/mikesamuel/bug-900-fix-demos/trunk/src/com/google/caja/[EMAIL PROTECTED]) @@ -1176,7 +1176,7 @@ var ___; //////////////////////////////////////////////////////////////////////// /** - * Can a Caja client of <tt>obj</tt> read its <name> property? + * Can a Caja client of <tt>obj</tt> read its [EMAIL PROTECTED] name} property? * <p> * If the property is Internal (i.e. ends in an '_'), then no. * If the property was defined by Caja code, then yes. If it was Index: src/com/google/caja/demos/calendar/demo-cajoled.html =================================================================== --- src/com/google/caja/demos/calendar/demo-cajoled.html (^/trunk/src/com/google/caja/demos/calendar/[EMAIL PROTECTED]) +++ src/com/google/caja/demos/calendar/demo-cajoled.html (^/changes/mikesamuel/bug-900-fix-demos/trunk/src/com/google/caja/demos/calendar/[EMAIL PROTECTED]) @@ -56,12 +56,6 @@ </div> </div> <td class=pre___> - <!-- Populated by main.js --> - <div id=controls-pre___> - <span class=control id=prev-button-pre___>«</span> - <span class=control id=next-button-pre___>»</span> - </div> - <div id=container-pre___></div> </table> </body> @@ -145,10 +139,12 @@ imports.StringInterpolation = StringInterpolation; ___.all2(___.grantRead, imports, ['window', 'htmlInterp', 'StringInterpolation']); - ___.grantCall(htmlInterp, 'safeHtml'); - ___.simpleFunc(StringInterpolation); + ___.grantRead(htmlInterp, 'safeHtml'); + ___.simpleFrozenFunc(htmlInterp.safeHtml); + ___.ctor(StringInterpolation, undefined, 'StringInterpolation'); ___.grantCall(StringInterpolation.prototype, 'append'); + ___.grantTypedGeneric(StringInterpolation.prototype, 'append'); window.imports = imports; })();</script> Index: src/com/google/caja/demos/calendar/main.js =================================================================== --- src/com/google/caja/demos/calendar/main.js (^/trunk/src/com/google/caja/demos/calendar/[EMAIL PROTECTED]) +++ src/com/google/caja/demos/calendar/main.js (^/changes/mikesamuel/bug-900-fix-demos/trunk/src/com/google/caja/demos/calendar/[EMAIL PROTECTED]) @@ -57,6 +57,5 @@ console.timeEnd('next'); }; - var t1 = (new Date).getTime(); console.timeEnd('main'); })(); Index: src/com/google/caja/plugin/domita.js =================================================================== --- src/com/google/caja/plugin/domita.js (^/trunk/src/com/google/caja/plugin/[EMAIL PROTECTED]) +++ src/com/google/caja/plugin/domita.js (^/changes/mikesamuel/bug-900-fix-demos/trunk/src/com/google/caja/plugin/[EMAIL PROTECTED]) @@ -904,7 +904,7 @@ attachDocumentStub = (function () { return listener; } }); - })(html4Attrib.match(attrNameRe)[0]); + })(html4Attrib.match(attrNameRe)[1]); } } })(); Index: tests/com/google/caja/plugin/domita_test_untrusted.html =================================================================== --- tests/com/google/caja/plugin/domita_test_untrusted.html (^/trunk/tests/com/google/caja/plugin/[EMAIL PROTECTED]) +++ tests/com/google/caja/plugin/domita_test_untrusted.html (^/changes/mikesamuel/bug-900-fix-demos/trunk/tests/com/google/caja/plugin/[EMAIL PROTECTED]) @@ -104,8 +104,9 @@ <input type="checkbox"> </form> -<p class="testcontainer" id="test-inline-event-handlers"> - <input onclick="autoclicky.click()" id="autoclicker" type="checkbox"> +<p class="testcontainer" id="test-event-handler-attributes"> + <input onclick="autoclicky.click(0)" id="autoclicker" type="checkbox"> + <input id="set-onclick-on-me" type="checkbox"> </p> <p class="testcontainer" id="test-inner-HTML-style-sanitizer"></p> @@ -726,19 +727,28 @@ jsunitRegister('testInputDefaultValue', }); var autoclicky = { - clicked: false, - click: function () { + clicked: [false, false], + click: function (i) { console.log('clicking'); - autoclicky.clicked = true; + autoclicky.clicked[i] = true; } }; -jsunitRegister('testInlineEventHandlers', - function testInlineEventHandlers() { - assertFalse(autoclicky.clicked); +jsunitRegister('testEventHandlerAttributes', + function testEventHandlerAttributes() { + assertFalse(autoclicky.clicked[0]); directAccess.click(document.getElementById('autoclicker')); - assertTrue(autoclicky.clicked); - pass('test-inline-event-handlers'); + assertTrue(autoclicky.clicked[0]); + + var setOnclickOnMe = document.getElementById('set-onclick-on-me'); + assertFalse(autoclicky.clicked[1]); + directAccess.click(setOnclickOnMe); + assertFalse(autoclicky.clicked[1]); + setOnclickOnMe.onclick = function () { autoclicky.click(1); }; + directAccess.click(setOnclickOnMe); + assertTrue(autoclicky.clicked[1]); + + pass('test-event-handler-attributes'); }); jsunitRegister('testInnerHTMLStyleSanitizer', --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to http://groups.google.com/group/google-caja-discuss To unsubscribe, email [EMAIL PROTECTED] -~----------~----~----~----~------~----~------~--~---
