* Set up the single global MutationObserver and delegated input/change * listeners that power attribute, property, and query tracking.
()
| 3218 | * listeners that power attribute, property, and query tracking. |
| 3219 | */ |
| 3220 | _initGlobalObserver() { |
| 3221 | if (typeof document === "undefined") return; |
| 3222 | if (!this._observer) { |
| 3223 | var reactivity2 = this; |
| 3224 | this._observer = new MutationObserver(function(mutations) { |
| 3225 | reactivity2._handleMutations(mutations); |
| 3226 | }); |
| 3227 | this._inputHandler = function(e) { |
| 3228 | reactivity2._handleDOMEvent(e); |
| 3229 | }; |
| 3230 | this._changeHandler = function(e) { |
| 3231 | reactivity2._handleDOMEvent(e); |
| 3232 | }; |
| 3233 | } |
| 3234 | this._observer.observe(document, { |
| 3235 | attributes: true, |
| 3236 | childList: true, |
| 3237 | subtree: true |
| 3238 | }); |
| 3239 | document.addEventListener("input", this._inputHandler, true); |
| 3240 | document.addEventListener("change", this._changeHandler, true); |
| 3241 | } |
| 3242 | /** |
| 3243 | * Handle MutationObserver callbacks. Dispatches to attribute and query |
| 3244 | * subscriptions based on mutation type. |
no test coverage detected