Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Hold references to the pre-patched environment to prevent calling into later-applied polyfills. #102

Closed
wants to merge 97 commits into from

Conversation

bicknellr
Copy link
Contributor

@bicknellr bicknellr commented Jun 15, 2017

Most of this PR is leading whitespace changes:
https://github.com/webcomponents/custom-elements/pull/102/files?w=1

const addEventListenerMethod =
method(descriptors.addEventListener) ||
// IE11
method(getDescriptor(window['Node'].prototype, 'addEventListener'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bicknellr VERY slick! I <3 it.

@bicknellr
Copy link
Contributor Author

For reference, this JSBin (forked from this one, produced by @robdodson, to force the polyfills) shows a symptom of the current polyfills' layering problems. In particular, the first element should be able to find the second during its connectedCallback because the element construction and insertion is atomic and all the connectedCallback reactions should happen afterwards. Currently, the polyfills call into each other incorrectly in such a way that each individual child node of the constructed result of the set to innerHTML is inserted in its own step, with any connectedCallback reactions being called before moving on to inserting the next child.

@snuggs
Copy link
Contributor

snuggs commented Sep 27, 2017

@bicknellr this explains so much! Been through this project a bunch of times and have to understand sometimes things are just the way they are just because!

@bicknellr
Copy link
Contributor Author

I didn't really include much description for the PR beyond the title; Rob recently ran across the issue being fixed here and showed me that link so I figured I'd add it here since for more context.

things are just the way they are just because!

If you find something that isn't explained well, let me know and I'd be happy to answer questions and/or add docs as needed.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@googlebot
Copy link

CLAs look good, thanks!

@dfreedm
Copy link
Contributor

dfreedm commented Jun 10, 2019

Remaking this PR in the polyfills monorepo!

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

Successfully merging this pull request may close these issues.

4 participants