DocShell/Window targeting: Difference between revisions

m (raising a question)
Line 3: Line 3:


# Identify the docshell making the targeting request.  For links this is the container of the document the link is in.  For <code>window.open</code> calls this is the docshell of the window the script that calls <code>window.open</code> is running in.  This is the originating docshell.  In what follows we always make sure that the originating docshell is allowed to perform a load in any docshell that we find matching the name that was passed in.
# Identify the docshell making the targeting request.  For links this is the container of the document the link is in.  For <code>window.open</code> calls this is the docshell of the window the script that calls <code>window.open</code> is running in.  This is the originating docshell.  In what follows we always make sure that the originating docshell is allowed to perform a load in any docshell that we find matching the name that was passed in.
# Identify the docshell the targeting request is being made of.  For links this is the container of the document the link is in. (<-- same as the point #1? or just a mistake caused by copy-and-pasting?) For <code>window.open</code> calls this is the docshell of the window whose <code>open</code> method is being called.  This is the initial target docshell from now on.
# Identify the docshell the targeting request is being made of.  For links this is the container of the document the link is in. (<-- same as the point #1? or just a mistake caused by copy-and-pasting?  
----
) For <code>window.open</code> calls this is the docshell of the window whose <code>open</code> method is being called.  This is the initial target docshell from now on.
# FindItemWithName is called on the initial target docshell.  From here on, we do each step only if the previous step found nothing.
# FindItemWithName is called on the initial target docshell.  From here on, we do each step only if the previous step found nothing.
# The docshell checks for a few special target names that depend on the initial target: <code>"_self"</code>, <code>"_parent"</code>, <code>"_top"</code>.  If the name is one of those, the proper docshell is returned to the caller.
# The docshell checks for a few special target names that depend on the initial target: <code>"_self"</code>, <code>"_parent"</code>, <code>"_top"</code>.  If the name is one of those, the proper docshell is returned to the caller.