This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23669 - [Custom]: "leftView" type of callbacks should not be called on "this document has a browsing context"
Summary: [Custom]: "leftView" type of callbacks should not be called on "this document...
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14968
  Show dependency treegraph
 
Reported: 2013-10-29 08:17 UTC by Tetsuharu OHZEKI
Modified: 2013-11-11 08:07 UTC (History)
0 users

See Also:


Attachments

Description Tetsuharu OHZEKI 2013-10-29 08:17:34 UTC
[reproducible revision]
http://www.w3.org/TR/2013/WD-custom-elements-20131024/

In this spec revision, 5.2 Types of Callbacks defines "leftView" type like this:
> Unless specified otherwise, this callback must be enqueued whenever custom
> element is removed from the document and this document has a browsing context.

But this last sentence, "this callback must be enqueued whenever ... this document has a browsing context", is same sentence as the definition of "enteredView":
> Unless specified otherwise, this callback must be enqueued whenever custom
> element is removed from the document and this document has a browsing context.

I think the definition of "leftView" should be "this document lost a browsing context" from the viewpoint of symmetry between "enteredView" and "leftView".
Comment 1 Dimitri Glazkov 2013-11-08 20:48:39 UTC
(In reply to Tetsuharu OHZEKI from comment #0)
> [reproducible revision]
> http://www.w3.org/TR/2013/WD-custom-elements-20131024/
> 
> In this spec revision, 5.2 Types of Callbacks defines "leftView" type like
> this:
> > Unless specified otherwise, this callback must be enqueued whenever custom
> > element is removed from the document and this document has a browsing context.
> 
> But this last sentence, "this callback must be enqueued whenever ... this
> document has a browsing context", is same sentence as the definition of
> "enteredView":
> > Unless specified otherwise, this callback must be enqueued whenever custom
> > element is removed from the document and this document has a browsing context.
> 
> I think the definition of "leftView" should be "this document lost a
> browsing context" from the viewpoint of symmetry between "enteredView" and
> "leftView".

This is intentional. "leftView" is only called when the element's document changes, not when the document changes itself.

One motivation here is avoid slowing down destruction of the document by invoking a bunch of callbacks on its elements.

If you have a specific use case that you feel needs to be address, please reopen the bug and post it here :)
Comment 2 Tetsuharu OHZEKI 2013-11-11 04:28:14 UTC
(In reply to Dimitri Glazkov from comment #1)
> This is intentional. "leftView" is only called when the element's document
> changes, not when the document changes itself.
> 
> One motivation here is avoid slowing down destruction of the document by
> invoking a bunch of callbacks on its elements.

So do you mean these?:
* "leftView" is only called when changing the document which is the ancestor of the element.
* "leftView" is not called when changing the document which is the ancestor of the element.

If you said them, I understand with your account.
However, I seems the spec description are complex...
Comment 3 Tetsuharu OHZEKI 2013-11-11 04:38:33 UTC
(In reply to Dimitri Glazkov from comment #1)
> This is intentional. "leftView" is only called when the element's document
> changes, not when the document changes itself.
> 
> One motivation here is avoid slowing down destruction of the document by
> invoking a bunch of callbacks on its elements.
> 
> If you have a specific use case that you feel needs to be address, please
> reopen the bug and post it here :)

Ah, I have the one more question about it. Will "leftView" not be called when "unload" event is dispatched on the element's document? I feel that this spec avoids it intentionally from your comment.
Comment 4 Dimitri Glazkov 2013-11-11 05:20:11 UTC
(In reply to Tetsuharu OHZEKI from comment #3)
> (In reply to Dimitri Glazkov from comment #1)
> > This is intentional. "leftView" is only called when the element's document
> > changes, not when the document changes itself.
> > 
> > One motivation here is avoid slowing down destruction of the document by
> > invoking a bunch of callbacks on its elements.
> > 
> > If you have a specific use case that you feel needs to be address, please
> > reopen the bug and post it here :)
> 
> Ah, I have the one more question about it. Will "leftView" not be called
> when "unload" event is dispatched on the element's document? I feel that
> this spec avoids it intentionally from your comment.

Right. This callback is only called when the element is moved, not when the document's state is changed. The spec is very clear on that.

Unload event is perfectly usable all by itself, there's no reason to duplicate its functionality in a callback.
Comment 5 Tetsuharu OHZEKI 2013-11-11 08:07:05 UTC
(In reply to Dimitri Glazkov from comment #4)
> Right. This callback is only called when the element is moved, not when the
> document's state is changed. The spec is very clear on that.

OK. I understand its behavior.

> Unload event is perfectly usable all by itself, there's no reason to
> duplicate its functionality in a callback.

Aha, I agree it.

Thank you for your account.