Intent to Remove: window.event for Shadow DOM

75 views
Skip to first unread message

Hayato Ito

unread,
Oct 30, 2017, 2:31:03 AM10/30/17
to blink-dev
Primary eng (and PM) emails

Link to “Intent to Deprecate” thread
No. We're skipping "Intent to Deprecate" here because compat risk is very low, I think. We should just try to change the existing behavior here.

Summary
We are trying to standardize certain Microsoft event extensions; 'window.event' is one of them, which Blink already *supports*.

In the discussion, we agreed that window.event should be 'undefined' if an Event's target is in a shadow tree.
That is effectively equivalent to *removing* window.event for Shadow DOM.

Motivation
Improve the conformance to DOM Standard.

Interoperability and Compatibility Risk
Edge: Shadow DOM is not shipped
Firefox: This behavior is what they want; Shadow DOM is being implemented
Safari: No signal

Alternative implementation suggestion for web developers
No. We developers shouldn't use window.event.

Usage information from UseCounter
NA

OWP launch tracking bug

Entry on the feature dashboard


Rick Byers

unread,
Oct 30, 2017, 11:03:52 AM10/30/17
to Hayato Ito, blink-dev
I support making this change based on the idea that window.event is largely legacy (not supported by all browsers, left for compat only) and ShadowDOM is a new thing unlikely to be combined with legacy IE6-specific code etc.

But is there any evidence you can share for the "very low risk" claim?  The existing behavior is somewhat broken, right?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFpjS_0n4yJ%3DdFOJWSc0xZPkn6xRNS0p8DaovfnSQVw0tOLVZQ%40mail.gmail.com.

Hayato Ito

unread,
Oct 30, 2017, 9:55:55 PM10/30/17
to Rick Byers, blink-dev
Ah, there is no evidence. That is my guess, trusting Firefox folks, given that:

- Firefox wants to support window.event for interoperability.
- However, they don't want to support window.event for Shadow DOM.

It sounds that they don't have a trouble for a web site which uses both Shadow DOM and window.event.

Rick Byers

unread,
Oct 30, 2017, 10:03:32 PM10/30/17
to Hayato Ito, Michael Taylor, blink-dev
+Mike in case he has any more concrete data on window.event.

What's our behavior here today?  It's sort of broken, isn't it?

smaug

unread,
Oct 31, 2017, 2:54:35 AM10/31/17
to Rick Byers, Hayato Ito, Michael Taylor, blink-dev
On 10/31/2017 04:03 AM, Rick Byers wrote:
> +Mike in case he has any more concrete data on window.event.
>
> What's our behavior here today? It's sort of broken, isn't it?

Blink exposes the internals of closed ShadowRoot via window.event and that breaks the whole concept of closed ShadowRoot.
I wouldn't we surprised if we had still other similar spec level issues to fix (well, here we haven't really had any spec for window.event IEism).

-Olli

>
> On Mon, Oct 30, 2017 at 9:55 PM, Hayato Ito <hay...@chromium.org <mailto:hay...@chromium.org>> wrote:
>
> Ah, there is no evidence. That is my guess, trusting Firefox folks, given that:
>
> - Firefox wants to support window.event for interoperability.
> - However, they don't want to support window.event for Shadow DOM.
>
> It sounds that they don't have a trouble for a web site which uses both Shadow DOM and window.event.
>
>
> On Tue, Oct 31, 2017 at 12:03 AM Rick Byers <rby...@chromium.org <mailto:rby...@chromium.org>> wrote:
>
> I support making this change based on the idea that window.event is largely legacy (not supported by all browsers, left for compat only) and
> ShadowDOM is a new thing unlikely to be combined with legacy IE6-specific code etc.
>
> But is there any evidence you can share for the "very low risk" claim? The existing behavior is somewhat broken, right?
>
> On Mon, Oct 30, 2017 at 2:30 AM, Hayato Ito <hay...@chromium.org <mailto:hay...@chromium.org>> wrote:
>
> *Primary eng (and PM) emails*
> hay...@chromium.org <mailto:hay...@chromium.org>
>
> *Link to “Intent to Deprecate” thread*
> No. We're skipping "Intent to Deprecate" here because compat risk is very low, I think. We should just try to change the existing behavior
> here.
>
> *Summary*
> The context is: https://github.com/whatwg/dom/issues/334 <https://github.com/whatwg/dom/issues/334>
> We are trying to standardize certain Microsoft event extensions; 'window.event' is one of them, which Blink already *supports*.
>
> In the discussion, we agreed that window.event should be 'undefined' if an Event's target is in a shadow tree.
> That is effectively equivalent to *removing* window.event for Shadow DOM.
>
> *Motivation*
> Improve the conformance to DOM Standard.
>
> *Interoperability and Compatibility Risk*
> Edge: Shadow DOM is not shipped
> Firefox: This behavior is what they want; Shadow DOM is being implemented
> Safari: No signal
>
> *Alternative implementation suggestion for web developers*
> No. We developers shouldn't use window.event.
>
> *Usage information from UseCounter*
> NA
>
> *OWP launch tracking bug*
> http://crbug.com/779461
>
> *Entry on the feature dashboard*
> https://www.chromestatus.com/features/5084727350394880 <https://www.chromestatus.com/features/5084727350394880>
>
>
> --
> You received this message because you are subscribed to the Google Groups "blink-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFpjS_0n4yJ%3DdFOJWSc0xZPkn6xRNS0p8DaovfnSQVw0tOLVZQ%40mail.gmail.com
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFpjS_0n4yJ%3DdFOJWSc0xZPkn6xRNS0p8DaovfnSQVw0tOLVZQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
>
> --
> You received this message because you are subscribed to the Google Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org
> <mailto:blink-dev+...@chromium.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY_R0XT4%3DNyq7dFXj0E7hXpjFvL2V9C8XbKySXje5%3DfDBQ%40mail.gmail.com
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY_R0XT4%3DNyq7dFXj0E7hXpjFvL2V9C8XbKySXje5%3DfDBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Chris Harrelson

unread,
Nov 10, 2017, 1:53:17 PM11/10/17
to smaug, Rick Byers, Hayato Ito, Michael Taylor, blink-dev
Hi,

I'm unsure of the status of this intent. From my reading the amount of compat risk sounds uncertain. Is that accurate/inaccurate? Is there more data that could be gathered?

Chris

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org
<mailto:blink-dev+unsubscribe@chromium.org>.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/185dadff-f369-30df-242c-beab3933a4d1%40welho.com.


Hayato Ito

unread,
Nov 12, 2017, 10:33:08 PM11/12/17
to Chris Harrelson, smaug, Rick Byers, Michael Taylor, blink-dev
This didn't get enough LGTMs yet.

I am thinking that this "intent to remove" is unlikely to get LGTMs from API owners unless the actual usage data is shown, though I thought that it might not be worth spending time.
However, it is not good for us to align with other browser vendors.

In order to get LGTMs without a concern, let me change the *strategy* a little bit. How about the followings?

- Let me limit the focus of this "Intent to Remove" only on Shadow DOM v1. Because Shadow DOM v1's usage (0.05%) is much lower than V0's (11.1%).
  I can't imagine any modern site which uses Shadow DOM v1, but also uses legacy window.event at the same time.

- That doesn't mean that we will support window.event for Shadow DOM v0 forever. We're aiming to deprecate and remove Shadow DOM v0 in the near future.
  Once we remove Shadow DOM v0 from Blink, all will be set.

Does this sound good?


To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org
<mailto:blink-dev+...@chromium.org>.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Dimitri Glazkov

unread,
Nov 14, 2017, 12:16:45 PM11/14/17
to Hayato Ito, Chris Harrelson, smaug, Rick Byers, Michael Taylor, blink-dev

Chris Harrelson

unread,
Nov 14, 2017, 12:18:24 PM11/14/17
to Dimitri Glazkov, Hayato Ito, smaug, Rick Byers, Michael Taylor, blink-dev
LGTM2

LGTM1

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org
<mailto:blink-dev+unsubscribe@chromium.org>.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

Rick Byers

unread,
Nov 14, 2017, 3:20:13 PM11/14/17
to Chris Harrelson, Dimitri Glazkov, Hayato Ito, smaug, Michael Taylor, blink-dev
LGTM3

But is it trivial to add a UseCounter to measure access to window.event within ShadowDOM v0 at the same time as removing from v1?  I think we all expect the usage to be very low, I was only questioning whether we had any data whatsoever to justify that expectation.  If it's trivial to gather such data it would be a shame to leave it in very long.  If it's non-trivial (eg. if we have evidence that the metric would be dominated by the problem of code that enumerates the entire window object) then perhaps we should just try and see if we get any reports of breakage.

Hayato Ito

unread,
Nov 14, 2017, 7:25:47 PM11/14/17
to Rick Byers, Chris Harrelson, Dimitri Glazkov, smaug, Michael Taylor, blink-dev
Thank you for LGTMs.

On Wed, Nov 15, 2017 at 5:20 AM Rick Byers <rby...@chromium.org> wrote:
LGTM3

But is it trivial to add a UseCounter to measure access to window.event within ShadowDOM v0 at the same time as removing from v1?  I think we all expect the usage to be very low, I was only questioning whether we had any data whatsoever to justify that expectation.  If it's trivial to gather such data it would be a shame to leave it in very long.  If it's non-trivial (eg. if we have evidence that the metric would be dominated by the problem of code that enumerates the entire window object) then perhaps we should just try and see if we get any reports of breakage.


Thank you for the suggestion. That makes sense. I think it's trivial to add use counters for v0. Let me do it.

If I find any difficulties to adding use counters, I'll report it back in this thread.
 
LGTM2

LGTM1

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org
<mailto:blink-dev+...@chromium.org>.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
Reply all
Reply to author
Forward
0 new messages