Closed
Bug 569583
Opened 15 years ago
Closed 9 years ago
nsWindow::GetParent() should use nsWindow::mParent now that we have it
Categories
(Core :: Widget: Win32, defect, P5)
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Assigned: jimm)
References
Details
(Whiteboard: [tpi:+])
Attachments
(1 file, 6 obsolete files)
1.04 KB,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
nsWindow::GetParent() should use nsWindow::mParent now that we have it.
Follow-up from bug 530070.
![]() |
Assignee | |
Updated•11 years ago
|
Assignee: mats → nobody
Mentor: jmathies, tabraldes, netzen
Whiteboard: [good first bug][lang=c++]
Comment 1•11 years ago
|
||
I'd like to have a go at this bug. Could someone assign it to me?
http://dxr.mozilla.org/mozilla-central/source/widget/windows/nsWindow.cpp#989
It seems to be as simple as returning mParent instead of calling GetParentWindow(). Is there more to this (I would imagine there is)?
Updated•11 years ago
|
Flags: needinfo?(mats)
Reporter | ||
Comment 3•11 years ago
|
||
(In reply to Amit S. Lakamsani [:asl] from comment #1)
> It seems to be as simple as returning mParent instead of calling
> GetParentWindow(). Is there more to this (I would imagine there is)?
I kind of doubt it's as simple as that ;-)
You'll probably need a local debug build to work on this.
I would probably start by adding
NS_ASSERTION(GetParentWindow(false) == mParent, "")
in nsWindow::GetParent just to get an idea of when/why they differ.
mParent is setup in nsWindow::Create, compare that with
GetParentWindowBase(false).
Make sure you test with pages that use the Flash plugin. For example,
dragging a tab containing a page that plays a Flash video from one window
to another window (the video should keep playing without disruption).
(our automated test coverage of plugins is poor)
Other things to test are the context menu and <select> dropdown menu.
(again, our test coverage is poor)
Dragging tabs between windows invokes SetParent, IIRC.
I suggest you keep this logic for now:
if (mInDtor || mOnDestroyCalled)
return nullptr;
(rather than trying to null out mParent at the right moment)
We can simplify/remove that in a follow-up bug.
Flags: needinfo?(mats)
Comment 4•11 years ago
|
||
I apologize for my absence. I cannot take up this bug right now, and will leave it for someone else.
Updated•11 years ago
|
Assignee: aslakamsani → nobody
Updated•11 years ago
|
Assignee: nobody → harshvd95
Comment 5•11 years ago
|
||
Attachment #8508995 -
Flags: review?(netzen)
![]() |
Assignee | |
Comment 6•11 years ago
|
||
Comment on attachment 8508995 [details] [diff] [review]
Code Cleanup for GetParent()
Review of attachment 8508995 [details] [diff] [review]:
-----------------------------------------------------------------
::: widget/windows/nsWindow.cpp
@@ +987,5 @@
> }
>
> +nsIWidget* nsWindow::GetParent()
> +{
> + if (mWindowType == eWindowType_dialog || mWindowType == eWindowType_toplevel || mWindowType == eWindowType_popup || mWindowType == eWindowType_invisible) {
Please wrap and format this so that it fits within ~80 character line length.
Although, I think you just want to use mIsTopWidgetWindow per the comments here -
http://mxr.mozilla.org/mozilla-central/source/widget/windows/nsWindow.cpp#1030
It would be interesting to push this to try for a full test run to see what shows up.
@@ +991,5 @@
> + if (mWindowType == eWindowType_dialog || mWindowType == eWindowType_toplevel || mWindowType == eWindowType_popup || mWindowType == eWindowType_invisible) {
> + return nullptr;
> + }
> + return mParent;
> +}
nit - white space
Attachment #8508995 -
Flags: review?(netzen) → review-
Comment 7•11 years ago
|
||
Attachment #8509054 -
Flags: review?(jmathies)
![]() |
Assignee | |
Updated•11 years ago
|
Attachment #8508995 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 8•11 years ago
|
||
![]() |
Assignee | |
Comment 9•11 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #8)
> remote:
> https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=8fb6fe9e8845
> remote: https://tbpl.mozilla.org/?tree=Try&rev=8fb6fe9e8845
We've got bc1 test failures here, most of which indicate:
application crashed [@ nsCOMPtr<nsIWidget>::assign_assuming_AddRef(nsIWidget *)]
![]() |
Assignee | |
Comment 10•11 years ago
|
||
Comment on attachment 8509054 [details] [diff] [review]
Code Cleanup in nsWindow.cpp
We need to sort out those test failures.
Attachment #8509054 -
Flags: review?(jmathies) → review-
![]() |
Assignee | |
Comment 11•11 years ago
|
||
There's some functionality in GetParentWindowBase which we haven't replicated here -
http://dxr.mozilla.org/mozilla-central/source/widget/windows/nsWindow.cpp#1037
That added check might be tripping up these tests. Just a guess.
Reporter | ||
Comment 12•11 years ago
|
||
It might be safer to add that check also in GetParent() for now (as I suggested
in comment 3).
Updated•11 years ago
|
Flags: needinfo?(jmathies)
![]() |
Assignee | |
Updated•11 years ago
|
Flags: needinfo?(jmathies)
Comment 13•10 years ago
|
||
Couldn't drag tabs between windows and after playing youtube video whereas right clicking on the video-playing tab and selecting "Move to new Window" works.
Comment 14•10 years ago
|
||
Attachment #8509054 -
Attachment is obsolete: true
Attachment #8615129 -
Flags: review?(jmathies)
Comment 15•10 years ago
|
||
I think the assertions which I had set, like this, NS_ASSERTION(GetParentWindow(false) == mParent, "")
in nsWindow::GetParent() was the reason I couldn't drag tabs from one window to another window.
Updated•10 years ago
|
Keywords: checkin-needed
![]() |
Assignee | |
Comment 16•10 years ago
|
||
You can't request checkin until you have review.
Keywords: checkin-needed
![]() |
Assignee | |
Comment 17•10 years ago
|
||
![]() |
Assignee | |
Comment 18•10 years ago
|
||
Comment on attachment 8615129 [details] [diff] [review]
GetParent now returns mParent in nsWindow.cpp
Review of attachment 8615129 [details] [diff] [review]:
-----------------------------------------------------------------
cleanup the whitespace and I think we're good to go here.
::: widget/windows/nsWindow.cpp
@@ +989,5 @@
>
> nsIWidget* nsWindow::GetParent(void)
> {
> + nsIWidget* widget = 0;
> +
nit - you have white space throughout this patch, please clean that up first. Look at your patch in splinter view to see this.
Attachment #8615129 -
Flags: review?(jmathies) → review-
![]() |
Assignee | |
Comment 19•10 years ago
|
||
Comment on attachment 8615129 [details] [diff] [review]
GetParent now returns mParent in nsWindow.cpp
Review of attachment 8615129 [details] [diff] [review]:
-----------------------------------------------------------------
cleanup the whitespace and I think we're good to go here.
::: widget/windows/nsWindow.cpp
@@ +988,5 @@
> }
>
> nsIWidget* nsWindow::GetParent(void)
> {
> + nsIWidget* widget = 0;
use nullptr here as well. Also, below you have one if block without braces, and one if block with braces.
@@ +989,5 @@
>
> nsIWidget* nsWindow::GetParent(void)
> {
> + nsIWidget* widget = 0;
> +
nit - you have white space throughout this patch, please clean that up first. Look at your patch in splinter view to see this.
Reporter | ||
Comment 20•10 years ago
|
||
Comment on attachment 8615129 [details] [diff] [review]
GetParent now returns mParent in nsWindow.cpp
AddRef-ing the result here seems wrong. This method doesn't currently AddRef,
nor does GetParent() on other platforms.
Flags: needinfo?(jmathies)
![]() |
Assignee | |
Comment 21•10 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #20)
> Comment on attachment 8615129 [details] [diff] [review]
> GetParent now returns mParent in nsWindow.cpp
>
> AddRef-ing the result here seems wrong. This method doesn't currently
> AddRef,
> nor does GetParent() on other platforms.
Good lord, you're right. What's that doing in there?
Flags: needinfo?(jmathies)
Comment 22•10 years ago
|
||
Oh, I read this doc : https://developer.mozilla.org/en/docs/NS_IF_ADDREF
Comment 23•10 years ago
|
||
Attachment #8615129 -
Attachment is obsolete: true
Attachment #8617348 -
Flags: review?(jmathies)
![]() |
Assignee | |
Comment 24•10 years ago
|
||
Comment on attachment 8617348 [details] [diff] [review]
GetParent now returns mParent in nsWindow.cpp
Review of attachment 8617348 [details] [diff] [review]:
-----------------------------------------------------------------
closer but not quite there yet!
::: widget/windows/nsWindow.cpp
@@ +988,5 @@
> }
>
> nsIWidget* nsWindow::GetParent(void)
> {
> + nsIWidget* widget = nullptr;
get rid of this
@@ +992,5 @@
> + nsIWidget* widget = nullptr;
> + if (mIsTopWidgetWindow) {
> + return nullptr;
> + }
> + if (mInDtor || mOnDestroyCalled) {
nit - white space on the end of this line.
@@ +996,5 @@
> + if (mInDtor || mOnDestroyCalled) {
> + return nullptr;
> + }
> + widget = (nsIWidget *)mParent;
> + return widget;
here you can just return mParent, no need for the assignment.
Attachment #8617348 -
Flags: review?(jmathies) → review-
Comment 25•10 years ago
|
||
Attachment #8617348 -
Attachment is obsolete: true
Attachment #8617967 -
Flags: review?(jmathies)
![]() |
Assignee | |
Updated•10 years ago
|
Attachment #8617967 -
Flags: review?(jmathies) → review+
Comment 26•9 years ago
|
||
patch r+ over a year ago. what to do here?
Flags: needinfo?(jmathies)
Whiteboard: [good first bug][lang=c++] → [good first bug][lang=c++][tpi:?]
![]() |
Assignee | |
Updated•9 years ago
|
Flags: needinfo?(jmathies)
Priority: -- → P5
Whiteboard: [good first bug][lang=c++][tpi:?] → [good first bug][lang=c++][tpi:+]
Comment 27•9 years ago
|
||
Hello,
What would be needed in order to have the submitted patch integrated ?
Thanks,
Comment 29•9 years ago
|
||
Hello,
If needed, i am happy to help to get the patch proposed by Harsh Vardhan landing.
Thanks,
![]() |
Assignee | |
Comment 30•9 years ago
|
||
Yeah this can land after some testing and a try run. I'd prefer someone with checkin perms who's interested in dealing with any fallout.
Assignee: harshvd95 → nobody
Mentor: jmathies, netzen, timabraldes
Flags: needinfo?(jmathies)
Whiteboard: [good first bug][lang=c++][tpi:+] → [tpi:+]
Comment 31•9 years ago
|
||
Try run is clean:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=25848fb44f6e51ad95bccfb98ae9e5e0a638f7fd
(I'm not planning on working on this bug any further.)
Comment 32•9 years ago
|
||
Hello,
Please tell me if i can help on this issue.
Thanks,
Comment 33•9 years ago
|
||
Hello,
What should be the next steps in order to make this fix landing ?
Thanks,
![]() |
Assignee | |
Comment 34•9 years ago
|
||
(In reply to jbonnafo from comment #33)
> Hello,
>
> What should be the next steps in order to make this fix landing ?
>
> Thanks,
Just needs to be checked in.
Assignee: nobody → jmathies
Keywords: checkin-needed
Comment 35•9 years ago
|
||
please rebase the trunk.
--
adding 569583 to series file
renamed 569583 -> bug569583_returnsmParent.diff
applying bug569583_returnsmParent.diff
patching file widget/windows/nsWindow.cpp
Hunk #1 FAILED at 983
1 out of 1 hunks FAILED -- saving rejects to file widget/windows/nsWindow.cpp.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working directory
errors during apply, please fix and qrefresh bug569583_returnsmParent.diff
Keywords: checkin-needed
Comment 36•9 years ago
|
||
Patch proposal following code rebase.
Attachment #8824548 -
Flags: review?(jmathies)
![]() |
Assignee | |
Comment 37•9 years ago
|
||
Comment on attachment 8824548 [details] [diff] [review]
GetParent now returns mParent in nsWindow.cpp, following code rebase
this doesn't return anything!
Attachment #8824548 -
Flags: review?(jmathies) → review-
Comment 38•9 years ago
|
||
Amended patch proposal to return a value.
Attachment #8824548 -
Attachment is obsolete: true
Attachment #8825497 -
Flags: review?(jmathies)
![]() |
Assignee | |
Updated•9 years ago
|
Attachment #8825497 -
Flags: review?(jmathies) → review+
Updated•9 years ago
|
Attachment #8617967 -
Attachment is obsolete: true
Comment 40•9 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2e56d8197334
GetParent returns nsWindow::mParent in nsWindow.cpp. r=jimm
Keywords: checkin-needed
Comment 41•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•