Reviewers: MikeSamuel,

Description:
html4 only defines the onload= attribute for a few elements.
html5 defines onload= for all elements.

in particular, <img onload=...> is useful and supported
by most browsers.

this change defines *::ONLOAD and adds it to the whitelist.

Please review this at http://codereview.appspot.com/115084

Affected files:
  M     src/com/google/caja/lang/html/html4-attributes-extensions-defs.json


Index: src/com/google/caja/lang/html/html4-attributes-extensions-defs.json
===================================================================
--- src/com/google/caja/lang/html/html4-attributes-extensions-defs.json (revision 3717) +++ src/com/google/caja/lang/html/html4-attributes-extensions-defs.json (working copy)
@@ -5,6 +5,17 @@

   "types": [
       { "key": "*::NAME", "description": "other name",
-        "type": "GLOBAL_NAME", "optional": true }
+        "type": "GLOBAL_NAME", "optional": true },
+
+      { "key": "*::ONLOAD", "description": "fires when content is loaded",
+        "type": "SCRIPT", "optional": true,
+        "comment": [
+          "HTML5 defines onload for every element.  In particular,",
+          "<img onload=> is useful and supported by most browsers." ] }
+
+      ],
+
+  "allowed": [
+      "*::ONLOAD"
       ]
-}
\ No newline at end of file
+}


Reply via email to