* 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)
| 4565 | * attributes have multiple equivalent values. |
| 4566 | */ |
| 4567 | function getValueForAttribute(node, name, expected) { |
| 4568 | { |
| 4569 | if (!isAttributeNameSafe(name)) { |
| 4570 | return; |
| 4571 | } |
| 4572 | if (!node.hasAttribute(name)) { |
| 4573 | return expected === undefined ? undefined : null; |
| 4574 | } |
| 4575 | var value = node.getAttribute(name); |
| 4576 | if (value === '' + expected) { |
| 4577 | return expected; |
| 4578 | } |
| 4579 | return value; |
| 4580 | } |
| 4581 | } |
| 4582 | |
| 4583 | /** |
| 4584 | * Sets the value for a property on a node. |
no test coverage detected