mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1650562: Add missing null check for document BrowsingContext. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D82988
This commit is contained in:
parent
e0ac748fab
commit
f57f59c446
@ -5562,9 +5562,8 @@ bool nsContentUtils::CheckForSubFrameDrop(nsIDragSession* aDragSession,
|
||||
|
||||
// If there is no source node, then this is a drag from another
|
||||
// application, which should be allowed.
|
||||
RefPtr<Document> doc;
|
||||
aDragSession->GetSourceDocument(getter_AddRefs(doc));
|
||||
if (doc) {
|
||||
RefPtr<Document> doc(aDragSession->GetSourceDocument());
|
||||
if (doc && doc->GetBrowsingContext()) {
|
||||
// Get each successive parent of the source document and compare it to
|
||||
// the drop document. If they match, then this is a drag from a child frame.
|
||||
for (BrowsingContext* bc = doc->GetBrowsingContext()->GetParent(); bc;
|
||||
|
@ -49,6 +49,7 @@ interface nsIDragSession : nsISupports
|
||||
* drag originated outside the application. Useful for determining if a drop
|
||||
* originated in the same document.
|
||||
*/
|
||||
[infallible]
|
||||
readonly attribute Document sourceDocument;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user