* Get the value for a attribute on a node. Only used in DEV for SSR validation. * The third argument is used as a hint of what the expected value is. Some * attributes have multiple equivalent values.
(node, name, expected)
| 4407 | * attributes have multiple equivalent values. |
| 4408 | */ |
| 4409 | function getValueForAttribute(node, name, expected) { |
| 4410 | { |
| 4411 | if (!isAttributeNameSafe(name)) { |
| 4412 | return; |
| 4413 | } |
| 4414 | if (!node.hasAttribute(name)) { |
| 4415 | return expected === undefined ? undefined : null; |
| 4416 | } |
| 4417 | var value = node.getAttribute(name); |
| 4418 | if (value === '' + expected) { |
| 4419 | return expected; |
| 4420 | } |
| 4421 | return value; |
| 4422 | } |
| 4423 | } |
| 4424 | |
| 4425 | /** |
| 4426 | * Sets the value for a property on a node. |
no test coverage detected