GoogleChrome / dialog-polyfill

Polyfill for the HTML dialog element
BSD 3-Clause "New" or "Revised" License
2.45k stars 245 forks source link

Move the script tag to the body in the example #125

Closed Flimm closed 7 years ago

Flimm commented 7 years ago

This means that the script won't block rendering earlier than needed. A preferable solution would be to use the async HTML attribute, but that would require a way to put the custom code in a callback, and this library isn't ready for that yet.

If you don't want to change the example code, than at least document that the script tag's location is not required to be in the section. As it stands, developers that are using the polyfill do not know the best place to put it by default as you said, because it doesn't just depend on the site infrastructure, it also depends on the behaviour of the script. For example, if a script is calling document.write, it will behave differently depending on whether it's in the section or not. Even if I fully review the script's code and determine that it behaves correctly when included in the section now, I don't have the reassurances of the documentation that an upgrade won't break it.

googlebot commented 7 years ago

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).

:memo: 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.


googlebot commented 7 years ago

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).

:memo: 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.


Flimm commented 7 years ago

I signed it.

googlebot commented 7 years ago

CLAs look good, thanks!

googlebot commented 7 years ago

CLAs look good, thanks!