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

Deal with beforescriptexecute/afterscriptexecute #943

Closed
annevk opened this issue Mar 25, 2016 · 32 comments · Fixed by #1103
Closed

Deal with beforescriptexecute/afterscriptexecute #943

annevk opened this issue Mar 25, 2016 · 32 comments · Fixed by #1103
Labels
needs implementer interest Moving the issue forward requires implementers to express interest normative change removal/deprecation Removing or deprecating a feature

Comments

@annevk
Copy link
Member

annevk commented Mar 25, 2016

Gecko supports these.

WebKit has not moved on these https://bugs.webkit.org/show_bug.cgi?id=91463 (despite developers wanting it) and Chromium hasn't either https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/bChX6leKqtg/Idut6cE4ORcJ. There appears to be some sort of support for this in the Chromium camp, if this was more of a local notification rather than a global one.

We have these options:

  • Keep them, and add their corresponding on* attributes which Gecko already ships
  • Replace them with something else (what?)
  • Remove them
@annevk annevk added normative change removal/deprecation Removing or deprecating a feature needs implementer interest Moving the issue forward requires implementers to express interest labels Mar 25, 2016
@annevk
Copy link
Member Author

annevk commented Mar 25, 2016

Note that #762 requires us dealing with this somehow.

@Hrxn
Copy link

Hrxn commented Mar 25, 2016

If we only had some kind of overview about the pros and cons, I think that could be useful, to understand the reasoning behind different positions.

@domenic
Copy link
Member

domenic commented Apr 11, 2016

I would like to remove these, as they are one vendor only.

domenic added a commit that referenced this issue Apr 11, 2016
They no longer set document.currentScript, or fire beforescriptexecute
and afterscriptexecute events.

Closes #997. See #1013 for a future alternative to
document.currentScript, and #943 for more discussion of the events.
@annevk
Copy link
Member Author

annevk commented Apr 12, 2016

Yeah, @travisleithead @smaug---- @hober, are you all okay with removing these events? They are only implemented by Firefox and Chrome has refused to implement them in their current form. Given that they've been around for quite a while it seems time to declare this addition a failure.

@smaug----
Copy link

IIRC @sicking added the events.

I kind of like the events, and would rather keep them.
blink-dev doesn't seem to quite have valid arguments against these events, but sure, if no one else is going to implement them, after some telemetry period removing them is an option.

@smaug----
Copy link

I guess related to these is the question what we'll do with .currentScript.
The events and .currentScript all expose a state of a <script>.
Do we need some totally new API to work better with shadow DOM?

@annevk
Copy link
Member Author

annevk commented Apr 12, 2016

@smaug---- #1013 has ideas for a potential better API. Unfortunately it requires changes in JavaScript.

@domenic
Copy link
Member

domenic commented Apr 12, 2016

.currentScript is implemented everywhere, so we'd keep that. (Except not for modules as noted there.)

@smaug----
Copy link

and not for shadow scripts.

domenic added a commit that referenced this issue Apr 13, 2016
They set document.currentScript to null, and no longer fire
beforescriptexecute and afterscriptexecute events.

Closes #997. See #1013 for a future alternative to
document.currentScript, and #943 for more discussion of the events.
domenic added a commit that referenced this issue Apr 14, 2016
They set document.currentScript to null, and no longer fire
beforescriptexecute and afterscriptexecute events.

Closes #997. See #1013 for a future alternative to
document.currentScript, and #943 for more discussion of the events.
annevk pushed a commit that referenced this issue Apr 15, 2016
Make module scripts modify less global script state. They set document.currentScript to null, and no longer fire beforescriptexecute and afterscriptexecute events.

Closes #997. See #1013 for a future alternative to document.currentScript, and #943 for more discussion of the events.
domenic added a commit that referenced this issue Apr 22, 2016
These have failed to garner implementer interest beyond one engine.
Fixes #943.
annevk pushed a commit that referenced this issue Apr 23, 2016
These have failed to garner implementer interest beyond one engine. Fixes #943.
@chrcoluk
Copy link

So if I understand correctly, google can control the standards by simply choosing to not implement what it doesnt like in chrome?

It seems they refused to add it because they feel web site developers should have control in what appears in the end user's browser.

@domenic
Copy link
Member

domenic commented Jul 12, 2016

@chrcoluk almost. All implementers collaborate together on standards; Google is one of them. In this case, 3/4 rendering engines gave feedback that they'd rather not include this in the standard, so it was clear this was not going to be part of the interoperable web, and thus we removed it from the standard.

@Ms2ger
Copy link
Member

Ms2ger commented Jul 14, 2016

@mario98
Copy link

mario98 commented Oct 24, 2016

I can tell you why this was not included in the standard. With this functionality, the users were able to block, for example, annoying ads (AdDefend etc.), tracking and other crapware. However, website owners don't want the users to do this, because they don't care about privacy or the security of the users, therefore they try everything to prevent the user from defending themselves from crapware. And WHATWG, probably after getting some donations, fulfilled their desire and removed this from the standard. SAD!

@domenic
Copy link
Member

domenic commented Oct 24, 2016

Hi @mario98, welcome to the WHATWG community.

You've made some rather extraordinary claims, which go directly against the reasons presented above in this thread and discussed at length. Namely, that we spec what is implemented, and if there is no implementer interest, putting something in the standard does not accomplish anything.

Do you have any proof for these accusations of yours? Ideally your first act of participation in a community such as ours would be less hostile.

@mario98
Copy link

mario98 commented Oct 24, 2016

Well, it must be clear that Google, being part of the advertisement system itself, will of course oppose this standard. Therefore, if you rely on Google making your decision, this opens the door for Google dictating the rules for a web in favor of large corporations. You should rather be independent from Google and make your decisions yourself, depending on what's best for the users (not Google).

@domenic
Copy link
Member

domenic commented Oct 24, 2016

Unfortunately that would just lead to a world in which we create fiction, not web standards. We're interested in creating web standards that are implemented everywhere, not just documents that make us feel good by talking about what we ideally wish the world would be like.

@Hrxn
Copy link

Hrxn commented Oct 24, 2016

But you work for Google, and that is not just an accusation. Not that it's inherently wrong or something..

I don't think it is too hard to understand where the possible conflict of interest is here in this case, I'm sure you can see that.

@domenic
Copy link
Member

domenic commented Oct 24, 2016

@Hrxn as a spec editor, it is my duty to reflect implementer consensus, not my employer's wishes. Do you have any evidence, beyond just accusations, that a conflict of interest is interfering with our duties as spec editors? Or do you think perhaps that the reasons given in this thread---that we simply don't spec things without implementer interest---might be more accurate?

@Hrxn
Copy link

Hrxn commented Oct 24, 2016

And now take a good hard guess where this 'implementer's interest' is coming from, and what factors contribute to influence such decisions.

@Swyter
Copy link

Swyter commented Oct 24, 2016

Now the Web world is divided in a bipartisan system, Mozilla and Chromium/WebKit. Microsoft Edge just lags a little behind everyone else, by picking what is popular.

This is shipping in Firefox right now. By passively marking as WontFix without explaining their reasons in the Chromium issue tracker a single company with sizeable market weight can silently steer standards, influencing issues that can tangentially affect its main source of income without almost anyone batting an eye.

One can understand the decision if there's a solid technical or conceptual issue, but a little of transparency in the process of the implementers would be nice, instead of: 'Uh. Okay, no interest, let's remove it.

Seeing that this is a trivial trigger that solves a specific shortcoming, specially when compared to hardcore innovation for all kinds of ancillary uses that browsers are receiving lately all this seems a bit fishy. Or not?

@domenic
Copy link
Member

domenic commented Oct 24, 2016

@Swyter it's legitimate to ask implementers why they remove something or do not implement it. However, that's best done on their bug trackers, not on this one.

@Swyter
Copy link

Swyter commented Oct 24, 2016

I understand. But the WHATWG should enforce this kind of transparency by default, specially when a possible conflict of interest arises, just to clear up any doubt. Isn't that reasonable?

@domenic
Copy link
Member

domenic commented Oct 24, 2016

We don't control implementers, so we can't really enforce anything in the way you're describing. It's indeed ideal if everyone explains all of their decisions all the time, but we don't have a system set up where the WHATWG can in some way punish people for not doing so.

@Swyter
Copy link

Swyter commented Oct 24, 2016

Food for thought.

@zcorpan
Copy link
Member

zcorpan commented Oct 25, 2016

For rationale to not implement these events in Blink, please read this thread: https://groups.google.com/a/chromium.org/d/msg/blink-dev/bChX6leKqtg/Idut6cE4ORcJ

@Hixie
Copy link
Member

Hixie commented Oct 25, 2016

Hey now, if y'all are taking bribes for not including stuff, I want my cut too.

@mario98
Copy link

mario98 commented Oct 25, 2016

@Hixie: Confused. I think you are already paid by Google, or did I get something wrong about your CV? http://ian.hixie.ch/career/resume.html
Please stop pretending that you're independent.

The bitter irony is, however, that WHATWG was originally founded by Mozilla, but nowadays Mozilla is just referred to as "no implementer".

@annevk
Copy link
Member Author

annevk commented Oct 25, 2016

FWIW, I work for Mozilla and I support this resolution. These events (and currentScript) don't work well for script elements when it comes to shadow trees. We need a different approach as I mentioned in #943 (comment).

@rianby64
Copy link

rianby64 commented Oct 26, 2016

@mario98 I can't understand your comments. If you have any idea that concerns how to deal with beforescriptexecute/afterscriptexecute, please, expose it.

@mario98
Copy link

mario98 commented Oct 26, 2016

@rianby64: Here is what I would do:

  1. Realize that this standard is implemented by a founding member of WHATWG and a pioneer of web browsing, Mozilla.
  2. Realize that there is huge developer interest. Even the most used addon of all time is interested in such a feature, because this would help them to make their addon more efficient. (However, they didn't implement it because they have to stick to the lowest common denominator across all browsers)
  3. Realize that other applications, such as uBlock (~half a million users) and others already rely on this feature.
  4. Realize that this is sort of a chicken egg problem. As long as not everyone has implemented this, we won't see much application. But once it's an accepted web standard (and the organization behind this web standard will not back down because of special interest), this will be implemented by other browser engines as well, then we will see this feature in action everywhere.
  5. Come to the conclusion that this is a valuable standard which needs to be defended instead of abolished.
  6. Tell Google that they have two options: Either implement this standard or not implement this standard, but this standard is not going to be removed.

Possible side effects:

  • Websites whose business model is to sell out their users to large advertisement networks may be not amused.
  • Ordinary people will be very amused.
  • Those who are working for Google may not get an increase in their salary in the next few month.

@domenic
Copy link
Member

domenic commented Oct 26, 2016

I think we need to lock this thread, as it's going in circles and emailing at least 155 people for every reply. We've already stated that the WHATWG is not in the business of writing fiction that does not achieve multiple interoperable implementations, and yet some people seem to ignore that and think that we should put proprietary single-vendor fiction in the standard anyway.

(It doesn't make a difference whether that single vendor is Mozilla---that doesn't give their proprietary single-vendor extensions any more claim to being a standard. Similarly, it doesn't matter if popular extensions or developers are using the Mozilla-only proprietary extensions---that isn't a good reason to put something in a standard.)

If anyone has any concerns or evidence of corruption, bribes, or bias in the standards process, please feel free to reach out to the editors directly by email. We take such accusations very seriously and will work with you to the best of our abilities to get to the root of such situations. But given that nothing concrete has been shown, we should not be wasting 155+ peoples' time with simple innuendo and wishful thinking.

@whatwg whatwg locked and limited conversation to collaborators Oct 26, 2016
@Hixie
Copy link
Member

Hixie commented Oct 27, 2016

@mario98 the problem with your conspiracy theory is that I'm the one who added it to the spec in the first place...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs implementer interest Moving the issue forward requires implementers to express interest normative change removal/deprecation Removing or deprecating a feature
Development

Successfully merging a pull request may close this issue.