* 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)
| 3675 | * attributes have multiple equivalent values. |
| 3676 | */ |
| 3677 | function getValueForAttribute(node, name, expected) { |
| 3678 | { |
| 3679 | if (!isAttributeNameSafe(name)) { |
| 3680 | return; |
| 3681 | } |
| 3682 | if (!node.hasAttribute(name)) { |
| 3683 | return expected === undefined ? undefined : null; |
| 3684 | } |
| 3685 | var value = node.getAttribute(name); |
| 3686 | if (value === '' + expected) { |
| 3687 | return expected; |
| 3688 | } |
| 3689 | return value; |
| 3690 | } |
| 3691 | } |
| 3692 | |
| 3693 | /** |
| 3694 | * Sets the value for a property on a node. |
no test coverage detected