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

Don't create a vbuf for a sub-document when the top document is still busy #898

Closed
nvaccessAuto opened this issue Sep 10, 2010 · 3 comments
Assignees
Milestone

Comments

@nvaccessAuto
Copy link

Reported by jteh on 2010-09-10 04:52
If a document contains sub-documents (iframes or frames) and one of the sub-documents finishes loading before the top document finishes loading, focus landing inside the loaded sub-document will cause a buffer to be created for that document. This is because we scan downward from the highest new focus ancestor and skip the top document because it's busy. Unfortunately, when the top document finishes loading, we don't render a buffer for it because we've already created a buffer for the sub-document. The user therefore remains stuck in the sub-document. We shouldn't render a buffer for a sub-document while the top document is still busy.

In the wild, I've seen this mostly on Blogger blogs and !PennyTel.

I think we need to do the following:

  • Rename !TreeInterceptor.isTransitioning to isReady.
  • Instantiate !VirtualBuffer objects for busy documents, but don't load the buffer and set isReady to False.
  • isReady should only be set to True once the buffer is loaded.
  • Change scriptHandler so that it doesn't pass scripts to buffers which aren't ready. (eventHandler already behaves as desired.)
@nvaccessAuto
Copy link
Author

Comment 1 by jteh on 2010-10-19 08:14
Actually, we can't get rid of isTransitioning because the buffer should never be killed while loading, even if not isAlive. However, in the new case, the buffer might not be ready, but it should still be killed if not isAlive. Therefore, we need to:

  • Introduce a new propertty called isReady, which:
    • returns False if isTransitioning is True
    • returns False if VBufHandle is None
    • returns True otherwise.
  • scriptHandler, eventHandler, etc. will then check isReady. treeInterceptorHandler.update() will still check isTransitioning/isAlive.
  • eventHandler.doPreDocumentLoadComplete() will call a new notifyReady() method if an interceptor already exists but is not ready.

@nvaccessAuto
Copy link
Author

Comment 2 by jteh on 2010-10-22 01:58
So now we are getting rid of isTransitioning. Instead, buffers have isLoading and their isAlive returns True if isLoading is True to stop them from being killed while loading. isTransitioning was always a bit of a hack which didn't quite fit into the tree interceptor framework, so this is nicer.

@nvaccessAuto
Copy link
Author

Comment 3 by mdcurran on 2010-12-02 01:24
Fixed in 6271b77 and one or two other subsiquent commits
Changes:
State: closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants