Closed
Bug 1266724
Opened 9 years ago
Closed 8 years ago
JavaScript error: TypeError: sourceDocument.defaultView is null
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect)
Core
DOM: Copy & Paste and Drag & Drop
Tracking
()
RESOLVED
FIXED
mozilla49
People
(Reporter: alessarik, Assigned: ajain2, Mentored)
References
Details
(Whiteboard: [good first bug] btpp-backlog)
Attachments
(1 file)
(deleted),
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
JavaScript error: file: .../dist/bin/components/contentAreaDropListener.js, line 123: TypeError: sourceDocument.defaultView is null
Looks like it happens in
> if (sourceDocument && eventDocument) {
> let sourceRoot = sourceDocument.defaultView.top;
> if (sourceRoot && sourceRoot == eventDocument.defaultView.top)
> return false;
> }
It happens if we go to new page by link, but before page loaded we drag some picture element on previous page and try to move it over new loaded page.
Updated•9 years ago
|
Component: Untriaged → Drag and Drop
Product: Firefox → Core
Comment 1•9 years ago
|
||
We can just null-check sourceDocument.defaultView here and return true. This can happen if someone removes the node being dragged from its document while dragging.
Mentor: enndeakin
Comment 2•9 years ago
|
||
Neil, is this a good first bug? Backlog?
Flags: needinfo?(enndeakin)
Whiteboard: btpp-followup-2016-05-05
Updated•9 years ago
|
Whiteboard: btpp-followup-2016-05-05 → [good first bug] btpp-backlog
Assignee | ||
Comment 4•8 years ago
|
||
Can I work on this? I am a beginner so Could someone help me fix this bug?
Comment 5•8 years ago
|
||
Hi, thanks you helping out. You can take this bug by assigning it yourself.
The error is shown in the first comment:
sourceDocument.defaultView is null
To fix this, add a null check for this in contentAreaDropListener.js.
Assignee | ||
Comment 6•8 years ago
|
||
Hi Neil, thanks you for that. What release do I need to clone?
I tried to find but failed to get the link.
Comment 7•8 years ago
|
||
If you'd like to build Mozilla, you can get mozilla-central as described at
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build
Assignee | ||
Comment 8•8 years ago
|
||
Hi there,
There are two such files, one under /dom/base/ and one under ../dist/bin/components/ . Does both files need change or just under the ../dist/bin/components?
Comment 9•8 years ago
|
||
Just the one under dom/base. The one under dist/bin/components is the generated output.
Assignee | ||
Comment 10•8 years ago
|
||
Within my knowledge I think I should check the null value for equality(==) and not identity(===), right?
> if (sourceDocument && eventDocument) {
> if(sourceDocument.defaultView == null)
> return true;
> let sourceRoot = sourceDocument.defaultView.top;
> if (sourceRoot && sourceRoot == eventDocument.defaultView.top)
> return false;
> }
I am building it right now but What do you think about this snippet?
Comment 11•8 years ago
|
||
That looks good. You will need to attach a patch to the bug and request review from me.
Assignee | ||
Comment 12•8 years ago
|
||
Thanks for the response. Any suggestions on how to submit a patch for a review? How do I request a review tag for the patch?
Flags: needinfo?(enndeakin)
Assignee | ||
Comment 13•8 years ago
|
||
The Build was successful on my local system. Please review the patch and let me know the changes, if any. Thanks
Comment 14•8 years ago
|
||
Comment on attachment 8753705 [details] [diff] [review]
DefaultViewNull.patch
OK thanks! I reviewed this patch. In future, you can request review from someone when attaching a patch; there should be a dropdown where you can set it to a question mark, then fill in the reviewer.
The next step would normally be to post it to our 'try' server which would perform all of our automated tests. That probably isn't necessary for this patch as it is just a null check on code that isn't easily tested automatically.
Otherwise, I can check this in. Thanks again.
Flags: needinfo?(enndeakin)
Attachment #8753705 -
Flags: review+
Comment 16•8 years ago
|
||
(In reply to Neil Deakin from comment #14)
> Otherwise, I can check this in. Thanks again.
@Neil: I think you should check in to trunk
Comment 17•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/74724ded165f579d12fe6bacf49e08c4f27e1c87
Bug 1266724, add null check of defaultView, r=neil
Comment 18•8 years ago
|
||
Comment 19•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in
before you can comment on or make changes to this bug.
Description
•