On 2009/07/08 05:47:48, ihab.awad wrote:
http://codereview.appspot.com/90071/diff/1/3 File src/com/google/caja/lang/html/html4-attributes-defs.json (right):
http://codereview.appspot.com/90071/diff/1/3#newcode510 Line 510: "mimeTypes": "image/*", "type": "URI", "optional": true }, When would you use an IMG without a SRC?
very common for delay-loaded images. in html you say <img id="x">, and in js, you modify x.src dynamically. note there's a difference between <img id="x"> and <img id="x" src=""> src="" is a valid relative url, meaning "this page", and <img src=""> causes the browser to try to use "this page" as the img.
http://codereview.appspot.com/90071/diff/1/3#newcode558 Line 558: "optional": true }, Requiring TYPE for SCRIPT and STYLE seems like generally clean and
defensive and
standards-based. It will default to "text/javascript" and "text/css" respectively, but leaving them out just seems sloppy and
non-future-proof. Is
there a real need for making these optional?
type= is optional in the html5 draft. the problem is that the code that enforces mandatory attributes is going to emit type="" rather than type="text/javascript", which might not mean the same thing. though this doesn't actually happen in the full cajoler at the moment, because style and script elements are pulled out and never enter this code-path. I think "optional" in this file is a little confused. the values come from the html4.01 spec, which is not quite how browsers behave, but optional=false is also being used to force particular rewritings. disentangling that is more work than I want to tackle at the moment. setting optional=true was a quick fix.
http://codereview.appspot.com/90071/diff/1/2 File tests/com/google/caja/plugin/templates/TemplateCompilerTest.java
(right):
http://codereview.appspot.com/90071/diff/1/2#newcode305 Line 305: public void test1056Textarea() throws Exception { Once again, please do not name test cases after bug numbers! This test
could be
called something like "testNonRequiredAttributesMissing" (if this is
not already
tested elsewhere in this file, which it might be...).
ok http://codereview.appspot.com/90071
