Make nsDocShell::DoFindItemWithName use GetSameTypeParent

NEW
Unassigned

Status

()

Core
DOM
P3
normal
10 months ago
2 months ago

People

(Reporter: mystor, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

bz suggested this in bug 1303196 comment 25 but pointed out some problems with the current implementation which make it unsuitable:

> >@@ -3789,33 +3766,37 @@ nsDocShell::DoFindItemWithName(const char16_t* aName,
> >+    if (!GetIsMozBrowserOrApp() && parentAsTreeItem->ItemType() == mItemType) {
> 
> Hmm....
> 
> I was going to suggest you just use GetSameTypeParent here, but that doesn't
> quite work because:
> 
> 1)  This would break the aRequestor check, since
> nsDocShell::FindChildWithName can in fact cross type boundaries if aSameType
> is false.
> 
> 2)  This would also break the aRequestor check because
> nsDocShell::FindChildWithName doesn't actually stop at mozbrowser/app
> boundaries.
> 
> In both cases you would end up calling to the docgroup instead of returning
> null as now...
> 
> I think #2 is just buggy.  I strongly suspect the existence of the aSameType
> thing is also buggy and we should always behave as if it were true.  Please
> file a followup bug on all that and add a comment in FindChildWithName
> referencing that bug and pointing out that if this is all fixed then this
> code can just get simplified to use GetSameTypeParent.
(Reporter)

Updated

10 months ago
Depends on: 1303196

Updated

10 months ago
Priority: -- → P2

Updated

2 months ago
Priority: P2 → P3
You need to log in before you can comment on or make changes to this bug.