Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari 9: inserting into a different document fires inserted #86

Closed
daffl opened this issue Sep 20, 2016 · 8 comments
Closed

Safari 9: inserting into a different document fires inserted #86

daffl opened this issue Sep 20, 2016 · 8 comments
Assignees

Comments

@daffl
Copy link
Contributor

daffl commented Sep 20, 2016

https://github.com/canjs/can-util/blob/master/dom/mutate/mutate-test.js#L36 is failing on Safari 9.0:

screen shot 2016-09-20 at 4 34 40 pm

@matthewp
Copy link
Contributor

I think this is related to what you were seeing yesterday, with Safari not firing events unless it's in the DOM.

@matthewp
Copy link
Contributor

This doesn't work in Safari:

<script>
(function(){
    var doc = document.implementation.createHTMLDocument('Demo');

    var div = document.createElement("div");
    div.addEventListener("inserted", function(){
        console.log("called");
    });

  doc.body.appendChild(div);

  var ev = doc.createEvent('HTMLEvents');
  ev.initEvent("inserted", true, false);
  div.dispatchEvent(ev);
})();
</script>

Nor does new Event()

@matthewp
Copy link
Contributor

Submitted this: web-platform-tests/wpt#3788

If they don't object I'll also file a bug against WebKit.

Thinking about a workaround.

@matthewp
Copy link
Contributor

So what this test is really just testing is that mutate uses the DOCUMENT() getter to know which document to fire the inserted event against. I'm not sure how else to test this.

@daffl
Copy link
Contributor Author

daffl commented Sep 21, 2016

If it is a bug in Webkit we can probably just run the test conditionally for now?

@matthewp
Copy link
Contributor

I guess we could. I'm going to wait and see what they say about the test I submitted and come back to this later.

@daffl
Copy link
Contributor Author

daffl commented Sep 21, 2016

I created #93 which feature detects if the test can be run so that we'll at least get everything else to pass on Safari.

@matthewp
Copy link
Contributor

Fixed by #93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants