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)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 2 open bugs)

Details

Attachments

(4 files, 5 obsolete files)

See discussion in bug 349585.
Blocks: 349585
Priority: -- → P1
Attached patch Proposed fixSplinter Review
Attached patch Same as diff -w (review only) (obsolete) — Splinter Review
Attachment #235131 - Flags: superreview?(roc)
Attachment #235131 - Flags: review?(roc)
Blocks: 324721
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.
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.
Attachment #236018 - Flags: superreview?
Attachment #236018 - Flags: review?
Attachment #236018 - Flags: superreview?(roc)
Attachment #236018 - Flags: superreview?
Attachment #236018 - Flags: review?(roc)
Attachment #236018 - Flags: review?
Attachment #235131 - Flags: superreview?(roc)
Attachment #235131 - Flags: review?(roc)
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-
Attached patch Bustage rev 2 (obsolete) — Splinter Review
Attachment #236018 - Attachment is obsolete: true
Attachment #236029 - Flags: superreview?
Attachment #236029 - Flags: review?
Attached patch Forgot remove comma :( (obsolete) — Splinter Review
Attachment #236029 - Attachment is obsolete: true
Attachment #236032 - Flags: superreview?
Attachment #236032 - Flags: review?
Attachment #236029 - Flags: superreview?
Attachment #236029 - Flags: review?
Fixed on trunk earlier today. I'll file a followup tomorrow morning.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
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-
Attached patch It is better? ;) (obsolete) — Splinter Review
Attachment #236032 - Attachment is obsolete: true
Attachment #236066 - Flags: review?
Comment on attachment 236066 [details] [diff] [review] It is better? ;) I want something like: #ifdef MOZ_XUL if (isPopup) { ... } else #else { geometricParent = aParentFrame; }
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.
Attachment #236066 - Flags: review? → review-
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
Blocks: 350740
Filed bug 350740 as a followup per comment 3 and comment 4.
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.
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.
Product: Core → Core Graveyard
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.

Attachment

General

Created:
Updated:
Size: