Reviewers: metaweta,

Description:
Right now caja.js and the Playground will call the cajoler
without an idClass parameter, which means that rewriting html ids
is deferred until gadget instantiation time.

I don't see much benefit to doing that, since there isn't an api
for multiply-instantiatiating the same gadget on the same host
page, and there isn't any particular demand for doing so.

This change makes caja.js and the Playground pass an idClass to
the cajoler in some cases, which has a few performance benefits:

1. With early-binding of idClass, the cajoler doesn't have to
generate html-emitter statements to set every html id, which
reduces the amount of js that the cajoler processes, which speeds
up the cajoler.

2. Avoiding all those html-emitter statements also speeds
up client-side rendering.

If in the future we do want to support multiply-instantiating
a gadget without calling cajole each time, then it's easy enough
to add an option for that.

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

Affected files:
  M     src/com/google/caja/demos/playground/client/Playground.java
  M     src/com/google/caja/demos/playground/client/PlaygroundService.java
M src/com/google/caja/demos/playground/client/PlaygroundServiceAsync.java
  M     src/com/google/caja/demos/playground/client/ui/PlaygroundView.java
M src/com/google/caja/demos/playground/server/GWTCajolingServiceImpl.java
  M     src/com/google/caja/gwtbeans/shared/Caja.java
  M     src/com/google/caja/plugin/CssDynamicExpressionRewriter.java
  M     src/com/google/caja/plugin/caja.js
  M     src/com/google/caja/plugin/cajoling-service-client.js
  M     src/com/google/caja/plugin/es53-frame-group.js
  M     src/com/google/caja/plugin/guest-manager.js
  D     src/com/google/caja/plugin/oldcaja.js
  M     src/com/google/caja/plugin/ses-frame-group.js
  M     src/com/google/caja/service/CajaArguments.java
  M     src/com/google/caja/service/HtmlHandler.java
M tests/com/google/caja/demos/playground/GWTCajolingServiceImplTest.java


Reply via email to