* htmlAttrAllowed: * @elt: HTML element * @attr: HTML attribute * @legacy: whether to allow deprecated attributes * * Checks whether an attribute is valid for an element * Has full knowledge of Required and Deprecated attributes * * Returns one of HTML_REQUIRED, HTML_VALID, HTML_DEPRECATED, HTML_INVALID */
| 6062 | * Returns one of HTML_REQUIRED, HTML_VALID, HTML_DEPRECATED, HTML_INVALID |
| 6063 | */ |
| 6064 | htmlStatus |
| 6065 | htmlAttrAllowed(const htmlElemDesc* elt, const xmlChar* attr, int legacy) { |
| 6066 | const char** p ; |
| 6067 | |
| 6068 | if ( !elt || ! attr ) |
| 6069 | return HTML_INVALID ; |
| 6070 | |
| 6071 | if ( elt->attrs_req ) |
| 6072 | for ( p = elt->attrs_req; *p; ++p) |
| 6073 | if ( !xmlStrcmp((const xmlChar*)*p, attr) ) |
| 6074 | return HTML_REQUIRED ; |
| 6075 | |
| 6076 | if ( elt->attrs_opt ) |
| 6077 | for ( p = elt->attrs_opt; *p; ++p) |
| 6078 | if ( !xmlStrcmp((const xmlChar*)*p, attr) ) |
| 6079 | return HTML_VALID ; |
| 6080 | |
| 6081 | if ( legacy && elt->attrs_depr ) |
| 6082 | for ( p = elt->attrs_depr; *p; ++p) |
| 6083 | if ( !xmlStrcmp((const xmlChar*)*p, attr) ) |
| 6084 | return HTML_DEPRECATED ; |
| 6085 | |
| 6086 | return HTML_INVALID ; |
| 6087 | } |
| 6088 | /** |
| 6089 | * htmlNodeStatus: |
| 6090 | * @node: an htmlNodePtr in a tree |
no test coverage detected