http://codereview.appspot.com/130076/diff/19/23
File src/com/google/caja/plugin/html-emitter.js (right):

http://codereview.appspot.com/130076/diff/19/23#newcode220
Line 220: var isLimitClosed = detached[0].parentNode !== limit;
Good point.  Done

http://codereview.appspot.com/130076/diff/19/23#newcode290
Line 290: var eltype = html4.ELEMENTS[tagName];
On 2009/10/15 19:39:59, felix8a wrote:
need hasOwnProperty test here

Done.

http://codereview.appspot.com/130076/diff/19/23#newcode291
Line 291: if ((eltype & html4.eflags.UNSAFE) !== 0) { return; }
On 2009/10/15 19:39:59, felix8a wrote:
it looks to me like if a startTag is rejected, the matching endTag
will never
find the right tag to close, so it will close all open tags, screwing
up the
rest of the structure.  which is ok, but should be documented.

I don't think it will.  endTag never changes the insertionPoint unless
it finds a match.

http://codereview.appspot.com/130076/diff/19/23#newcode291
Line 291: if ((eltype & html4.eflags.UNSAFE) !== 0) { return; }
On 2009/10/15 19:39:59, felix8a wrote:
it also looks like this doesn't cope too well with optional-close,
like <p>.
which is ok, but should also be documented.

Fixed.  If the element type is optional, and the top is an element of
the same type, then this will bump up one level.
That should handle <p>'s and <li>'s and <td>'s closing each other, but
will not address the problem of an <h1> closing a <p>.  To do that, we'd
need to keep track of what are block level elements, or allowed
containment relationships.

http://codereview.appspot.com/130076/diff/19/23#newcode351
Line 351: ___.grantRead(tameDoc, 'writeln');
On 2009/10/15 19:39:59, felix8a wrote:
shouldn't this be grantFunc?


Done.

http://codereview.appspot.com/130076

Reply via email to