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