/*** @name Conflicting HTML element attributes* @description If an HTML element has two attributes with the same name* but different values, its behavior may be browser-dependent.* @kind problem* @problem.severity warning* @id js/conflicting-html-attribute* @tags maintainability* correctness* external/cwe/cwe-758* @precision low*/import javascript/*** Holds if `earlier` and `later` are attribute definitions with the same name* and different values, where `earlier` appears textually before `later`.*/predicate conflict(DOM::AttributeDefinition earlier, DOM::AttributeDefinition later) {exists(DOM::ElementDefinition elt, int i, int j |earlier = elt.getAttribute(i) and later = elt.getAttribute(j)|i < j andearlier.getName() = later.getName() andnot earlier.getStringValue() = later.getStringValue())}from DOM::AttributeDefinition earlier, DOM::AttributeDefinition laterwhere conflict(earlier, later) and not conflict(_, earlier)select earlier,"This attribute has the same name as $@ of the same element, " + "but a different value.", later,"another attribute"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。