Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(84)

Issue 17063: Issue 967: embedded rendering mode should parenthesize post-decrement inside comparisons (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
17 years, 9 months ago by MikeSamuel
Modified:
17 years, 4 months ago
Reviewers:
Jasvir
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

The code x-- > 3 is valid javascript. HTML 4 says of the grammar for comments: White space is not permitted between the markup declaration open delimiter("<!") and the comment open delimiter ("--"), but is permitted between the comment close delimiter ("--") and the markup declaration close delimiter (">"). So the -- > in the javascript snippet above could end an HTML comment, thus defeating embedded mode guarantees. This can be solved by rendering it as (x--) > 3. This has to be done for post-decrement ops as the left hand argument to the following operators >, >=, >>, >>>, >>=, >>>=. This may be a security issue if clients use embedding and browsers implement escaping text spans using the same grammar as HTML4 comments. HTML5 has a tighter syntax for comments, and so a strict HTML5 parser would not lose embedding.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -0 lines) Patch
M src/com/google/caja/parser/js/Operation.java View 1 chunk +16 lines, -0 lines 0 comments Download
M tests/com/google/caja/parser/js/parsertest6.js View 1 chunk +5 lines, -0 lines 0 comments Download
M tests/com/google/caja/parser/js/rendergolden6.txt View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3
MikeSamuel
17 years, 9 months ago (2009-02-14 02:47:53 UTC) #1
Jasvir
LGTM
17 years, 9 months ago (2009-02-14 18:52:03 UTC) #2
MikeSamuel
17 years, 9 months ago (2009-02-15 20:55:38 UTC) #3
@3258
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b