You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Henry Saputra <hs...@apache.org> on 2012/03/26 20:44:47 UTC
Review Request: Cleanup the sites and holder close flow to delegate removing
iframe of the gadget wrapper element to the holder from site responsibility
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/
-----------------------------------------------------------
Review request for shindig and Dan Dumont.
Summary
-------
As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
Diffs
-----
trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
trunk/features/src/main/javascript/features/container.site/site.js 1305481
trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
Diff: https://reviews.apache.org/r/4486/diff
Testing
-------
Modify the jsunit and pass the unit tests. Run it through common container test page.
Thanks,
Henry
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Dan Dumont <dd...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review6431
-----------------------------------------------------------
Thanks for working on this!
- Dan
On 2012-03-27 16:09:19, Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated 2012-03-27 16:09:19)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Summary
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry
>
>
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Henry Saputra <hs...@apache.org>.
> On 2012-03-27 20:24:42, Dan Dumont wrote:
> > So I've been looking at this a bit more because something came up where I'll probably have to start using it.
> >
> > IT made me thing that instead of
> > this.loadingGadgetEl_ = args['bufferEl'];
> >
> > it might be better to pass in a Holder (maybe even introduce a LoadingHolder class). So that the container can have more control over the lifecycle of the loading element display.
> >
> > Also, I think I see what you were doing with the ordering change. I think I was confused. I'd like to clean up the naming of these variables to be much more clear about what they mean.
> > I might be working on this shortly, and since you've been in here recently, I'll add you to the review when I have one.
> >
> > What do you think of those changes?
Thanks Dan, please do create a review. The delegation of site and holder need to be clarified
- Henry
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review6443
-----------------------------------------------------------
On 2012-03-27 16:09:19, Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated 2012-03-27 16:09:19)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Summary
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry
>
>
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Dan Dumont <dd...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review6443
-----------------------------------------------------------
So I've been looking at this a bit more because something came up where I'll probably have to start using it.
IT made me thing that instead of
this.loadingGadgetEl_ = args['bufferEl'];
it might be better to pass in a Holder (maybe even introduce a LoadingHolder class). So that the container can have more control over the lifecycle of the loading element display.
Also, I think I see what you were doing with the ordering change. I think I was confused. I'd like to clean up the naming of these variables to be much more clear about what they mean.
I might be working on this shortly, and since you've been in here recently, I'll add you to the review when I have one.
What do you think of those changes?
- Dan
On 2012-03-27 16:09:19, Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated 2012-03-27 16:09:19)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Summary
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry
>
>
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Dan Dumont <dd...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review8614
-----------------------------------------------------------
Hey Henry, what's the status of this review? Committed? Not needed?
- Dan Dumont
On March 27, 2012, 4:09 p.m., Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated March 27, 2012, 4:09 p.m.)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Description
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff/
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry Saputra
>
>
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Henry Saputra <hs...@apache.org>.
> On 2012-03-27 17:18:31, Dan Dumont wrote:
> > LGTM
Cool, thanks for the review. Committed as revision 1305953.
- Henry
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review6430
-----------------------------------------------------------
On 2012-03-27 16:09:19, Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated 2012-03-27 16:09:19)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Summary
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry
>
>
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Dan Dumont <dd...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review6430
-----------------------------------------------------------
Ship it!
LGTM
- Dan
On 2012-03-27 16:09:19, Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated 2012-03-27 16:09:19)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Summary
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry
>
>
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Henry Saputra <hs...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/
-----------------------------------------------------------
(Updated 2012-03-27 16:09:19.774748)
Review request for shindig and Dan Dumont.
Changes
-------
Revert ordering of loadingGadgetHolder_ and this.currentGadgetHolder_ in the GadgetSite.getActiveSiteHolder per request from Dan.
Summary
-------
As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
Diffs (updated)
-----
trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
trunk/features/src/main/javascript/features/container.site/site.js 1305481
trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
Diff: https://reviews.apache.org/r/4486/diff
Testing
-------
Modify the jsunit and pass the unit tests. Run it through common container test page.
Thanks,
Henry
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Henry Saputra <hs...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/
-----------------------------------------------------------
(Updated 2012-03-26 23:21:33.080908)
Review request for shindig and Dan Dumont.
Changes
-------
Update the url_site_test.js to test remove the child element via holder.
Summary
-------
As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
Diffs (updated)
-----
trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
trunk/features/src/main/javascript/features/container.site/site.js 1305481
trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
Diff: https://reviews.apache.org/r/4486/diff
Testing
-------
Modify the jsunit and pass the unit tests. Run it through common container test page.
Thanks,
Henry
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Henry Saputra <hs...@apache.org>.
> On 2012-03-26 18:54:24, Dan Dumont wrote:
> > trunk/features/src/test/javascript/features/container.url/url_site_test.js, line 83
> > <https://reviews.apache.org/r/4486/diff/2/?file=95901#file95901line83>
> >
> > Hmm, can we replace this test with another one? Why did this fail?
It fails because now the url_site.Close() no longer responsible to remove the iframe child element. The task is delegated to the site_holder.dispose().
I dont think we have test for both site_holder and site once we do we could add this test to the base class test cases.
> On 2012-03-26 18:54:24, Dan Dumont wrote:
> > trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js, line 140
> > <https://reviews.apache.org/r/4486/diff/2/?file=95897#file95897line140>
> >
> > I didn't get the reasoning behind changing this.
> >
> > One scenario I can think of is a period of time where the loading holder is showing the content of the site because the current holder (which should probably be called the 'main' holder or something) is still loading (nothing yet to render)
> >
> > The completion of the load, iirc, removed the loading holder, and then all calls would route correctly to the current holder.
> >
> > With this new logic you may get the current holder before it is ready.
Thanks for the review Dan.
With the way single threaded JS work I dont think that scenario ever happen. The rendering flow will not yield until it injects the iframe DOM to the parent HTML element is dont synchronously.
Until the load is complete, which will replace the current holder with loading one and remove the prev current holder, calls to getActiveHolder should return the "active" one which is the whatever current holder is.
Unless I misunderstood the meaning of active, the loading holder is not active until it becomes the current holder. Please correct me if I am wrong here, in other env where it supports yield to user action, there could be scenario where the render flow is interrupted such that the gadget site is in the state where the GadgetSite.getActiveHolder is called when it has both loadingGadgetHolder_ and currentGadgetHolder_ but I dont see how it could be happen in browser scenario.
- Henry
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review6352
-----------------------------------------------------------
On 2012-03-26 18:44:47, Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated 2012-03-26 18:44:47)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Summary
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry
>
>
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Dan Dumont <dd...@us.ibm.com>.
> On 2012-03-26 18:54:24, Dan Dumont wrote:
> > trunk/features/src/test/javascript/features/container.url/url_site_test.js, line 83
> > <https://reviews.apache.org/r/4486/diff/2/?file=95901#file95901line83>
> >
> > Hmm, can we replace this test with another one? Why did this fail?
>
> Henry Saputra wrote:
> It fails because now the url_site.Close() no longer responsible to remove the iframe child element. The task is delegated to the site_holder.dispose().
>
> I dont think we have test for both site_holder and site once we do we could add this test to the base class test cases.
ok
> On 2012-03-26 18:54:24, Dan Dumont wrote:
> > trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js, line 140
> > <https://reviews.apache.org/r/4486/diff/2/?file=95897#file95897line140>
> >
> > I didn't get the reasoning behind changing this.
> >
> > One scenario I can think of is a period of time where the loading holder is showing the content of the site because the current holder (which should probably be called the 'main' holder or something) is still loading (nothing yet to render)
> >
> > The completion of the load, iirc, removed the loading holder, and then all calls would route correctly to the current holder.
> >
> > With this new logic you may get the current holder before it is ready.
>
> Henry Saputra wrote:
> Thanks for the review Dan.
>
> With the way single threaded JS work I dont think that scenario ever happen. The rendering flow will not yield until it injects the iframe DOM to the parent HTML element is dont synchronously.
> Until the load is complete, which will replace the current holder with loading one and remove the prev current holder, calls to getActiveHolder should return the "active" one which is the whatever current holder is.
>
> Unless I misunderstood the meaning of active, the loading holder is not active until it becomes the current holder. Please correct me if I am wrong here, in other env where it supports yield to user action, there could be scenario where the render flow is interrupted such that the gadget site is in the state where the GadgetSite.getActiveHolder is called when it has both loadingGadgetHolder_ and currentGadgetHolder_ but I dont see how it could be happen in browser scenario.
Darn, forgot to hit publish on this. Sorry for the delay.
Hmm. Are you sure execution control is not given up at all in between dom injection and iframe onload event? (it might be for most browsers, but iirc, opera gives an execution thread to each iframe on a page).
In any case, for UX purposes there should probably be another event (done in the gadget to signal everything is ready) so that containers can choose to gracefully handle horribly broken gadgets with the loading holder.
If you disagree that it would be a desirable thing to do down the road, then I guess I'm fine with the reordering. Does leaving the order the way it was cause any problems, or were you just trying to clarify the return?
It might be best some time in the future to spend some time setting up a loading flag that can be used to return the appropriate holders, as well as introducing some new lifecycle events to key off of when switching the holders out.
- Dan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review6352
-----------------------------------------------------------
On 2012-03-26 23:21:33, Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated 2012-03-26 23:21:33)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Summary
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry
>
>
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Henry Saputra <hs...@apache.org>.
> On 2012-03-26 18:54:24, Dan Dumont wrote:
> > trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js, line 140
> > <https://reviews.apache.org/r/4486/diff/2/?file=95897#file95897line140>
> >
> > I didn't get the reasoning behind changing this.
> >
> > One scenario I can think of is a period of time where the loading holder is showing the content of the site because the current holder (which should probably be called the 'main' holder or something) is still loading (nothing yet to render)
> >
> > The completion of the load, iirc, removed the loading holder, and then all calls would route correctly to the current holder.
> >
> > With this new logic you may get the current holder before it is ready.
>
> Henry Saputra wrote:
> Thanks for the review Dan.
>
> With the way single threaded JS work I dont think that scenario ever happen. The rendering flow will not yield until it injects the iframe DOM to the parent HTML element is dont synchronously.
> Until the load is complete, which will replace the current holder with loading one and remove the prev current holder, calls to getActiveHolder should return the "active" one which is the whatever current holder is.
>
> Unless I misunderstood the meaning of active, the loading holder is not active until it becomes the current holder. Please correct me if I am wrong here, in other env where it supports yield to user action, there could be scenario where the render flow is interrupted such that the gadget site is in the state where the GadgetSite.getActiveHolder is called when it has both loadingGadgetHolder_ and currentGadgetHolder_ but I dont see how it could be happen in browser scenario.
>
> Dan Dumont wrote:
> Darn, forgot to hit publish on this. Sorry for the delay.
>
> Hmm. Are you sure execution control is not given up at all in between dom injection and iframe onload event? (it might be for most browsers, but iirc, opera gives an execution thread to each iframe on a page).
>
> In any case, for UX purposes there should probably be another event (done in the gadget to signal everything is ready) so that containers can choose to gracefully handle horribly broken gadgets with the loading holder.
>
> If you disagree that it would be a desirable thing to do down the road, then I guess I'm fine with the reordering. Does leaving the order the way it was cause any problems, or were you just trying to clarify the return?
>
> It might be best some time in the future to spend some time setting up a loading flag that can be used to return the appropriate holders, as well as introducing some new lifecycle events to key off of when switching the holders out.
For the sake of the cleanup of the close() flow of site classes, I will revert the ordering change for now because I havent encountered problem with the original ordering. I will create separate issue to clarify the intent of the GadgetSite .getActiveHolder function.
- Henry
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review6352
-----------------------------------------------------------
On 2012-03-26 23:21:33, Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated 2012-03-26 23:21:33)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Summary
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry
>
>
Re: Review Request: Cleanup the sites and holder close flow to delegate
removing iframe of the gadget wrapper element to the holder from site
responsibility
Posted by Dan Dumont <dd...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4486/#review6352
-----------------------------------------------------------
trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js
<https://reviews.apache.org/r/4486/#comment13776>
I didn't get the reasoning behind changing this.
One scenario I can think of is a period of time where the loading holder is showing the content of the site because the current holder (which should probably be called the 'main' holder or something) is still loading (nothing yet to render)
The completion of the load, iirc, removed the loading holder, and then all calls would route correctly to the current holder.
With this new logic you may get the current holder before it is ready.
trunk/features/src/test/javascript/features/container.url/url_site_test.js
<https://reviews.apache.org/r/4486/#comment13777>
Hmm, can we replace this test with another one? Why did this fail?
- Dan
On 2012-03-26 18:44:47, Henry Saputra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4486/
> -----------------------------------------------------------
>
> (Updated 2012-03-26 18:44:47)
>
>
> Review request for shindig and Dan Dumont.
>
>
> Summary
> -------
>
> As part of continuing refactoring of the site and holder code, this is another cleanup to simplify the close flow:
> 1. Move the responsibility of delete first element of the gadget HTML element wrapper to site_holder
> 2. The GadgetSite.getActiveSiteHolder now check for currentGadgetHolder_ then loadingGadgetHolder_ because its a public API that should modify currently active holder.
> 3. osapi.container.SiteHolder.prototype.dispose now responsible to remove child element.
> 4. osapi.container.GadgetHolder.prototype.dispose and osapi.container.UrlHolder.prototype.dispose need to call parent function
>
>
> Diffs
> -----
>
> trunk/features/src/main/javascript/features/container.site/site_holder.js 1305481
> trunk/features/src/test/javascript/features/container.url/url_site_test.js 1305481
> trunk/features/src/main/javascript/features/container.site/site.js 1305481
> trunk/features/src/main/javascript/features/container.site.url/url_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js 1305481
> trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js 1305481
>
> Diff: https://reviews.apache.org/r/4486/diff
>
>
> Testing
> -------
>
> Modify the jsunit and pass the unit tests. Run it through common container test page.
>
>
> Thanks,
>
> Henry
>
>