* Return the name of the object attribute that store the current formatted data in the DOM element. * * @returns {string} * @private
()
| 1619 | * @private |
| 1620 | */ |
| 1621 | _getAttributeToWatch() { |
| 1622 | let attributeToWatch; |
| 1623 | if (this.isInputElement) { |
| 1624 | attributeToWatch = 'value'; |
| 1625 | } else { |
| 1626 | const nodeType = this.domElement.nodeType; |
| 1627 | if (nodeType === Node.ELEMENT_NODE || |
| 1628 | nodeType === Node.DOCUMENT_NODE || |
| 1629 | nodeType === Node.DOCUMENT_FRAGMENT_NODE) { |
| 1630 | attributeToWatch = 'textContent'; |
| 1631 | } else if (nodeType === Node.TEXT_NODE) { |
| 1632 | attributeToWatch = 'nodeValue'; |
| 1633 | } |
| 1634 | } |
| 1635 | |
| 1636 | return attributeToWatch; |
| 1637 | } |
| 1638 | |
| 1639 | /** |
| 1640 | * Save the current raw value into the history table, along with the selection information. |