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

Issue 2183044: Preserve XMLNS declarations in the DOM Parser

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

Description

http://code.google.com/p/google-caja/issues/detail?id=1115 There've been a number of bugs pointing out that we remove XMLNS declarations in the output unless there's an element that uses them. So <div xmlns:svg="..."></div> is rendered as <div></div> This doesn't seem an error to me, but this change preserves XMLNS declarations in the DOM and allows the renderer to output them as long as they don't mask an existing declaration. I'm not convinced this is a good idea though. Some have argued that they are necessary for scripts. E.g. that <div xmlns:foo="bar" id="baz"></div> will behave differently when document.getElementById('baz').innerHTML = '<foo:boo/>'; I don't believe this. Does anyone have a reference to a standard or an actual testcase that demonstrates this.

Patch Set 1 #

Patch Set 2 : Preserve XMLNS declarations in the DOM Parser #

Patch Set 3 : Preserve XMLNS declarations in the DOM Parser #

Total comments: 6

Patch Set 4 : Preserve XMLNS declarations in the DOM Parser #

Patch Set 5 : Preserve XMLNS declarations in the DOM Parser #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -60 lines) Patch
M src/com/google/caja/parser/html/Dom.java View 2 chunks +2 lines, -1 line 0 comments Download
M src/com/google/caja/parser/html/DomParser.java View 1 2 3 chunks +0 lines, -9 lines 0 comments Download
M src/com/google/caja/parser/html/Nodes.java View 1 2 3 4 chunks +8 lines, -4 lines 0 comments Download
M src/com/google/caja/plugin/BuildServiceImplementation.java View 3 chunks +5 lines, -2 lines 0 comments Download
M tests/com/google/caja/parser/html/DomParserTest.java View 1 2 3 4 9 chunks +34 lines, -14 lines 0 comments Download
M tests/com/google/caja/parser/html/NodesTest.java View 1 2 3 8 chunks +37 lines, -18 lines 0 comments Download
M tests/com/google/caja/plugin/HtmlCompiledPluginTest.java View 2 chunks +3 lines, -1 line 0 comments Download
M tests/com/google/caja/plugin/stages/RewriteHtmlStageTest.java View 1 2 3 chunks +33 lines, -4 lines 0 comments Download
M tests/com/google/caja/plugin/templates/IhtmlSanityCheckerTest.java View 2 chunks +2 lines, -1 line 0 comments Download
M tests/com/google/caja/plugin/templates/LocalizerTest.java View 5 chunks +6 lines, -4 lines 0 comments Download
M tests/com/google/caja/plugin/templates/TemplateCompilerTest.java View 2 3 4 3 chunks +12 lines, -1 line 0 comments Download
M tests/com/google/caja/plugin/templates/TemplateSanitizerTest.java View 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 12
MikeSamuel
15 years, 4 months ago (2010-09-17 19:28:19 UTC) #1
chirag
lgtm. I don't have a reference for that specific case, but the opensocial-templates spec uses ...
15 years, 4 months ago (2010-09-20 23:39:14 UTC) #2
MikeSamuel
2010/9/20 <chiragshah1@gmail.com>: > lgtm. I don't have a reference for that specific case, but the ...
15 years, 4 months ago (2010-09-21 01:15:31 UTC) #3
chirag
After shindig converts script tags with type=os/* to equivalent OSML tags, it will re-parse each ...
15 years, 4 months ago (2010-09-21 23:10:33 UTC) #4
MikeSamuel
2010/9/21 <chiragshah1@gmail.com>: > After shindig converts script tags with type=os/* to equivalent OSML > tags, ...
15 years, 4 months ago (2010-09-21 23:42:55 UTC) #5
chirag
Yeah, that is correct when we're rendering server-side templates in shindig. When the document is ...
15 years, 4 months ago (2010-09-22 00:44:39 UTC) #6
chirag
Yeah, that is correct when we're rendering server-side templates in shindig. When the document is ...
15 years, 4 months ago (2010-09-22 00:44:40 UTC) #7
MikeSamuel
2010/9/21 Chirag Shah <chiragshah1@gmail.com>: > Yeah, that is correct when we're rendering server-side templates in ...
15 years, 4 months ago (2010-09-22 05:28:44 UTC) #8
MikeSamuel
Snapshotted. Now we preserve in the DOM, but do not render xmlns attributes.
15 years, 3 months ago (2010-09-27 19:30:35 UTC) #9
Jasvir
LGTM http://codereview.appspot.com/2183044/diff/5002/tests/com/google/caja/parser/html/NodesTest.java File tests/com/google/caja/parser/html/NodesTest.java (right): http://codereview.appspot.com/2183044/diff/5002/tests/com/google/caja/parser/html/NodesTest.java#newcode203 tests/com/google/caja/parser/html/NodesTest.java:203: rendered = Nodes.render(el, true); /* asXML */ true ...
15 years, 3 months ago (2010-09-27 21:19:18 UTC) #10
MikeSamuel
Done, and deprecated the boolean form of Nodes.render since the parameter was obscure. http://codereview.appspot.com/2183044/diff/5002/tests/com/google/caja/parser/html/NodesTest.java File ...
15 years, 3 months ago (2010-09-27 22:28:34 UTC) #11
Jasvir
15 years, 3 months ago (2010-09-29 05:48:23 UTC) #12
LGTM
Sign in to reply to this message.

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