| 33 | } |
| 34 | |
| 35 | function isValueDirty(node) { |
| 36 | // Return the "dirty value flag" as defined in the HTML spec. Cast to text |
| 37 | // input to sidestep complicated value sanitization behaviors. |
| 38 | const copy = node.cloneNode(); |
| 39 | copy.type = 'text'; |
| 40 | // If modifying the attribute now doesn't change the value, the value was already detached. |
| 41 | copy.defaultValue += Math.random(); |
| 42 | return copy.value === node.value; |
| 43 | } |
| 44 | |
| 45 | function isCheckedDirty(node) { |
| 46 | // Return the "dirty checked flag" as defined in the HTML spec. |