Closed
Bug 349921
Opened 18 years ago
Closed 18 years ago
[FIX]XUL popups in root popupset have wrong parent
Categories
(Core :: Layout, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 2 open bugs)
Details
Attachments
(4 files, 5 obsolete files)
27.04 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
4.67 KB,
patch
|
Details | Diff | Splinter Review | |
1.09 KB,
patch
|
Details | Diff | Splinter Review | |
1.19 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
See discussion in bug 349585.
Assignee | ||
Updated•18 years ago
|
Priority: -- → P1
Assignee | ||
Comment 1•18 years ago
|
||
Assignee | ||
Comment 2•18 years ago
|
||
Attachment #235131 -
Flags: superreview?(roc)
Attachment #235131 -
Flags: review?(roc)
Looks nice, just one question. Why aren't the popups available from the popupSetFrame via GetFirstChild/GetAdditionalChildListName? Wouldn't that make this special casing unnecessary?
+ // Return here, because the postcondition for this function actually
+ // fails for this case, since the popups are not in a "real" frame list
+ // in the popup set.
Assignee | ||
Comment 4•18 years ago
|
||
Yeah, I could try to change that. But nsPopupSetFrame doesn't store the popups in a frame list; it stores a list of nsPopupFrameList structs. I could chain the nsIFrames in those together, but I'd need to figure out what to do in the "entry already exists" case in nsPopupSetFrame::AddPopupFrame, would need to link aPopup to the previous entry there (so would need to modify GetEntry()), and so forth. since it was code I'm not that familiar with, I didn't really want to try mucking with it right now. If you'd like a followup bug on doing that, I would be happy to file one.
Comment on attachment 235128 [details] [diff] [review]
Proposed fix
fair enough
Attachment #235128 -
Flags: superreview+
Attachment #235128 -
Flags: review+
Comment 6•18 years ago
|
||
Attachment #236018 -
Flags: superreview?
Attachment #236018 -
Flags: review?
Updated•18 years ago
|
Attachment #236018 -
Flags: superreview?(roc)
Attachment #236018 -
Flags: superreview?
Attachment #236018 -
Flags: review?(roc)
Attachment #236018 -
Flags: review?
Assignee | ||
Updated•18 years ago
|
Attachment #235131 -
Flags: superreview?(roc)
Attachment #235131 -
Flags: review?(roc)
Assignee | ||
Comment 7•18 years ago
|
||
Comment on attachment 236018 [details] [diff] [review]
Bustage fix for NO XUL configuration
>- mCreatorIsBlock(PR_FALSE),
>- mRootBox(nsIRootBox::GetRootBox(aPresShell))
>+#ifdef MOZ_XUL
>+ mRootBox(nsIRootBox::GetRootBox(aPresShell)),
>+#endif
>+ mCreatorIsBlock(PR_FALSE)
This is bad -- changing the order here triggers warnings. Please put the ',' inside the #ifdef instead.
>+#ifdef MOZ_XUL
> if (isPopup) {
> NS_ASSERTION(aState.mRootBox && aState.mRootBox->GetPopupSetFrame(),
> "How did we get here?");
> geometricParent = aState.mRootBox->GetPopupSetFrame();
> } else {
> geometricParent = aParentFrame;
> }
>+#else
>+ geometricParent = aParentFrame;
>+#endif
I think I'd prefer to have ifdefs around the "if() {} else" part and have the "{ ... }" part outside the ifdefs. That should give the right behavior without code duplication.
Sorry I wasn't more careful about this stuff. :(
Attachment #236018 -
Flags: superreview?(roc)
Attachment #236018 -
Flags: superreview-
Attachment #236018 -
Flags: review?(roc)
Attachment #236018 -
Flags: review-
Comment 8•18 years ago
|
||
Attachment #236018 -
Attachment is obsolete: true
Attachment #236029 -
Flags: superreview?
Attachment #236029 -
Flags: review?
Comment 9•18 years ago
|
||
Attachment #236029 -
Attachment is obsolete: true
Attachment #236032 -
Flags: superreview?
Attachment #236032 -
Flags: review?
Attachment #236029 -
Flags: superreview?
Attachment #236029 -
Flags: review?
Assignee | ||
Comment 10•18 years ago
|
||
Fixed on trunk earlier today. I'll file a followup tomorrow morning.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 11•18 years ago
|
||
Comment on attachment 236032 [details] [diff] [review]
Forgot remove comma :(
>+ } else
>+#else
> geometricParent = aParentFrame;
>+#endif
No, this is fragile. Please look again at what I suggested you do here -- I want those curly braces.
Attachment #236032 -
Flags: superreview?
Attachment #236032 -
Flags: superreview-
Attachment #236032 -
Flags: review?
Attachment #236032 -
Flags: review-
Comment 12•18 years ago
|
||
Attachment #236032 -
Attachment is obsolete: true
Attachment #236066 -
Flags: review?
Assignee | ||
Comment 13•18 years ago
|
||
Comment on attachment 236066 [details] [diff] [review]
It is better? ;)
I want something like:
#ifdef MOZ_XUL
if (isPopup) {
...
}
else
#else
{
geometricParent = aParentFrame;
}
Assignee | ||
Comment 14•18 years ago
|
||
Except with an #endif. I'd do it myself, but I don't have a tree with --disable-xul to test in and can't quickly have one.
Assignee | ||
Updated•18 years ago
|
Attachment #236066 -
Flags: review? → review-
Assignee | ||
Comment 15•18 years ago
|
||
On second thought, it's not like it can get worse than it is now... I checked this in; let me know if there are remaining issues.
Attachment #235131 -
Attachment is obsolete: true
Attachment #236066 -
Attachment is obsolete: true
Assignee | ||
Comment 16•18 years ago
|
||
Assignee | ||
Comment 17•18 years ago
|
||
Since you removed the isReplaced = PR_TRUE, as part of merging the reflow branch to a new branch, I'm adding an IsFrameOfType override in nsMenuPopupFrame.
Assignee | ||
Comment 19•18 years ago
|
||
Er, the isReplaced part shouldn't have gone away. That was a merging mistake (the patch was initially developed against reflow branch, where that line is gone). I'll reinstate it on trunk.
Assignee | ||
Comment 20•18 years ago
|
||
Attachment #236128 -
Flags: superreview+
Attachment #236128 -
Flags: review+
(I undid my merging changes.)
Updated•6 years ago
|
Product: Core → Core Graveyard
Updated•6 years ago
|
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•