|
37 | 37 | _(u"'%(attributeName)s' attribute is not allowed on <input type=%(inputType)s>."), |
38 | 38 | "deprecated-attribute": |
39 | 39 | _(u"'%(attributeName)s' attribute is deprecated on <%(tagName)s>."), |
40 | | -"invalid-class-attribute": |
41 | | -_(u"Invalid class attribute value on <%(tagName)s>."), |
42 | 40 | "duplicate-value-in-token-list": |
43 | 41 | _(u"Duplicate value '%(attributeValue)s' in token list in '%(attributeName)s' attribute on <%(tagName)s>."), |
| 42 | +"invalid-attribute-value": |
| 43 | +_(u"Invalid value for '%(attributeName)s' attribute on <%(tagName)s>."), |
44 | 44 | }) |
45 | 45 |
|
46 | 46 | globalAttributes=frozenset(('class','contenteditable','contextmenu','dir', |
@@ -317,8 +317,17 @@ def validateAttributeValueClass(self, token, tagName, attrName, attrValue): |
317 | 317 | fortinself.checkTokenList(tagName,attrName,attrValue)or []: |
318 | 318 | yieldt |
319 | 319 | yield {"type":"ParseError", |
320 | | -"data":"invalid-class-attribute", |
321 | | -"datavars": {"tagName":tagName}} |
| 320 | +"data":"invalid-attribute-value", |
| 321 | +"datavars": {"tagName":tagName, |
| 322 | +"attributeName":attrName}} |
| 323 | + |
| 324 | +defvalidateAttributeValueContenteditable(self,token,tagName,attrName,attrValue): |
| 325 | +attrValue=attrValue.lower() |
| 326 | +ifattrValuenotinfrozenset(('true','false','')): |
| 327 | +yield {"type":"ParseError", |
| 328 | +"data":"invalid-attribute-value", |
| 329 | +"datavars": {"tagName":tagName, |
| 330 | +"attributeName":attrName}} |
322 | 331 |
|
323 | 332 | defcheckTokenList(self,tagName,attrName,attrValue): |
324 | 333 | # The "token" in the method name refers to tokens in an attribute value |
|