* 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)
| 4452 | * attributes have multiple equivalent values. |
| 4453 | */ |
| 4454 | function getValueForAttribute(node, name, expected) { |
| 4455 | { |
| 4456 | if (!isAttributeNameSafe(name)) { |
| 4457 | return; |
| 4458 | } |
| 4459 | if (!node.hasAttribute(name)) { |
| 4460 | return expected === undefined ? undefined : null; |
| 4461 | } |
| 4462 | var value = node.getAttribute(name); |
| 4463 | if (value === '' + expected) { |
| 4464 | return expected; |
| 4465 | } |
| 4466 | return value; |
| 4467 | } |
| 4468 | } |
| 4469 | |
| 4470 | /** |
| 4471 | * Sets the value for a property on a node. |
no test coverage detected