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

Issue 6988046: When attributes have no specified value, specify empty string (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by metaweta
Modified:
13 years, 5 months ago
Reviewers:
felix8a, kpreid2, Jasvir
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

We've been rewriting attributes with no specified value to themselves: <div foo>bar</div> currently has the same semantics as <div foo="foo">bar</div> However, this is wrong according to the spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#after-attribute-name-state and current browser behavior. Fixes http://code.google.com/p/google-caja/issues/detail?id=1602 .

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -31 lines) Patch
M src/com/google/caja/parser/html/DomParser.java View 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/plugin/html-emitter.js View 1 chunk +3 lines, -3 lines 0 comments Download
M src/com/google/caja/plugin/html-sanitizer.js View 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/plugin/html-sanitizer-legacy.js View 1 chunk +2 lines, -4 lines 0 comments Download
M src/com/google/caja/plugin/stages/HtmlEmbeddedContentFinder.java View 1 chunk +2 lines, -6 lines 0 comments Download
M tests/com/google/caja/parser/html/DomParserTest.java View 5 chunks +6 lines, -6 lines 0 comments Download
M tests/com/google/caja/parser/html/NodesTest.java View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/com/google/caja/plugin/html-sanitizer-test.js View 2 chunks +4 lines, -4 lines 0 comments Download
M tests/com/google/caja/plugin/stages/RewriteHtmlStageTest.java View 1 chunk +3 lines, -3 lines 0 comments Download
M tests/com/google/caja/service/HtmlHandlerTest.java View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8
metaweta
13 years, 5 months ago (2012-12-20 22:45:06 UTC) #1
kpreid2
LGTM (I accidentally read the whole thing)
13 years, 5 months ago (2012-12-20 22:49:49 UTC) #2
felix8a
relevant section in html5 spec is actually here http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#attributes-0 "Empty attribute syntax: ... The value ...
13 years, 5 months ago (2012-12-20 22:54:27 UTC) #3
felix8a
and the contradictory section in the html4 spec is the "Boolean attributes" section here: http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.3.4.2
13 years, 5 months ago (2012-12-20 23:01:04 UTC) #4
metaweta
On 2012/12/20 23:01:04, felix8a wrote: > and the contradictory section in the html4 spec is ...
13 years, 5 months ago (2012-12-20 23:30:44 UTC) #5
felix8a
IE9 seems to normalize <input checked> into <input checked=""> getAttribute("checked") returns "" in IE9 mode ...
13 years, 5 months ago (2012-12-21 00:11:17 UTC) #6
metaweta
On 2012/12/20 23:30:44, metaweta wrote: > On 2012/12/20 23:01:04, felix8a wrote: > > and the ...
13 years, 5 months ago (2012-12-21 00:12:44 UTC) #7
felix8a
13 years, 5 months ago (2012-12-21 00:13:42 UTC) #8
On 2012/12/21 00:12:44, metaweta wrote:
> On 2012/12/20 23:30:44, metaweta wrote:
> > On 2012/12/20 23:01:04, felix8a wrote:
> > > and the contradictory section in the html4 spec is the "Boolean
attributes"
> > > section here:
> > > http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.3.4.2
> > 
> > Both Chrome and FF just check for the existence of boolean attributes rather
> > than their value.  Anyone know about IE9+?
> 
> IE9 also behaves this way.  I don't have access to IE10, but I don't think it
> will change.  I'm going to submit despite this part of the spec.

sgtm
Sign in to reply to this message.

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