Open Bug 1310344 Opened 8 years ago Updated 2 years ago

Make nsDocShell::DoFindItemWithName use GetSameTypeParent

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

People

(Reporter: nika, Unassigned)

References

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.
Depends on: 1303196
Priority: -- → P2
Priority: P2 → P3
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.