Skip to content
This repository was archived by the owner on Feb 11, 2021. It is now read-only.
This repository was archived by the owner on Feb 11, 2021. It is now read-only.

Getting exception on Android when mutation events aren't supported #204

@mmariano

Description

@mmariano

We are getting an error on Android when mutation events are not supported. The problem is located in the Installer class in the watchSubtree function. The if check targeting.canTarget(target) is returning true but the observer object is null this.observer.observe(target, OBSERVER_INIT);. The target in this case seems to be the document. And the canTarget function is checking if the property document.elementFromPoint exists (which it does).

Installer.prototype = {
    watchSubtree: function(target) {

      // Only watch scopes that can target find, as these are top-level.
      // Otherwise we can see duplicate additions and removals that add noise.
      //
      // TODO(dfreedman): For some instances with ShadowDOMPolyfill, we can see
      // a removal without an insertion when a node is redistributed among
      // shadows. Since it all ends up correct in the document, watching only
      // the document will yield the correct mutations to watch.
      if (targeting.canTarget(target)) {
        this.observer.observe(target, OBSERVER_INIT);
      }
    },

This issue is happening for apps that use the older webview renderer (so not Chrome). In this case we are using Android 4.1-4.3 (e.x., webkit 534.30).

I am not sure what the fix should be. But at the very least if we can check if this.observer is true before running the code it would help our issues. There is most likely something else going on higher up that needs to be addresses, but I am not sure what that is. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions