-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Do not parse bindings inside script tags #3872
Do not parse bindings inside script tags #3872
Conversation
9fdadd0
to
9cb224b
Compare
The failure on Firefox is a result of Therefore you can craft the incorrect script behavior in Chrome, but you can not in Firefox. |
You can see the bug live here btw: https://timvdlippe.github.io/blog/#/b1-carbon-route |
As a side note, this free-style parsing also becomes an issue with string literals as they are layered and parsed en masse at browser discretion; issues include ui collapse in favor of traditional don-insertions—elements placed on the dom at a previous time, removed, placed in a mobile ui, and then called (textarea was the villain) fall back to their old pointer location, and wipe current screen, solid garbage collection fixes this issue. On the “in script tag issue”, soon we will all be “stringing” things together, and the location and timing of the parse will be a challenge at best to identify… I sort of have an inkling their is a larger order of operations issue that Also, Tim, on the library work: There are some simple element related parsing patterns with ternaries that make api building way easier: tabs, numbered sets of questions, all lists, list like columns, and /poorman’s tables/ fall under a one three element set, columned numbered lined animated text, drop down menus, toggle buttons, animated inputs with dropdown menus, dropdown menu cells that can animate to full pages—tested at sets of 50 dropdown items in 2500 inputs sharing the same dropdown, but filling it with different data, fall into the second. The ternaries can get dicey if dealing with poor data sets on the way in, but if regularized in a professional setting, they could ad a dynamism, universality, polymorphism, and standards adherence (they endlessly destroy themselves and recreate themselves) that the more declarative, and state aware— i do miss that awareness, but that’s the opposite of the standard—approach offered. Again, you guys can have anything I have done, and I only want to offer some help, if its possible. Thanks again. No response needed. Keep up the awesome work. Sincerely, Jason
|
@TimvdLippe Please note that, unfortunately, my workaround for
May result in another bug |
@tomalec I am sorry but I do not understand what you mean. Could you maybe elaborate on what you want to say? |
I have found a workaround for the fact that "a result of Thanks to that, I believe the fix you provided is even more useful. Even though it fails in Firefox, authors would be able to run it there with this workaround. Then, what i tried to say in the comment above, is that today, I found a buggy side-effect of my workaround, which is described at webcomponents/webcomponentsjs#470 (comment) :(. |
@tomalec Ah I understand now. Yes that sounds like a good fix, hopefully you can find a solution for the side-effect so we can get this merged in 🎉 |
@tomalec What is the status of your PR on the polyfill? Since the v1 polyfill is now being actively developed, will the v0 polyfill still be updated to work around this bug? |
I haven't made a PR for that, yet. Also, I haven't tested it with v1, as back then I found more bugs in wc.js stopping me to get there. I would try to take another look somewhere in the middle of February. What's more the ongoing redesign of HTML Imports polyfill behavior webcomponents/html-imports#1 may change the story drastically. Especially, that imported document may no longer be... er... a |
I will update this PR to both ignore styles and scripts, as that is really unintended. I will update the tests as well to work on non-Chrome browsers. |
Superseded by #4841 |
Scripts are now ignored when parsing bindings. This makes it impossible to craft weird functions like
returnStringWithBindingInScript
.Reference Issue
Fixes #3726