Closed Bug 387486 Opened 17 years ago Closed 17 years ago

XUL tree / editor element within a xul grid breaks the window

Categories

(Core :: XUL, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: asaf, Assigned: enndeakin)

References

Details

(Keywords: regression)

Attachments

(2 files)

XUL editor element within a xul grid breaks the window.

1. Apply the WIP patch in bug 387485, on a mac.
2. Accel+D
3. Notice the right-hand column width.
Flags: blocking1.9?
Attached file reduced testcase
The editor here is causing box layout to overflow:

###!!! ASSERTION: A Box's child is constantly growing!!!!!: 'passes < 10', file /builds/trunk-places/mozilla/layout/xul/base/src/nsSprocketLayout.cpp, line 627

Will investigate some more. The align="center" as well as the -moz-appearance: textfield seem necessary as well
Attachment #272033 - Attachment is patch: false
Attachment #272033 - Attachment mime type: text/plain → application/vnd.mozilla.xul+xml
Flags: blocking1.9? → blocking1.9+
The same issue occurs if any inline element with a -moz-appearance is used instead of an editor.

Looks like a problem where the size of an inline inside a box is getting its minimum/prefered width calculated with some extra size to account for the native theme (margin / minsize / border, haven't determined what), yet when Layout is called, this size is not being included, causing the the sprocket layout code to think the size has changed. This causes a loop.

Also, this issue doesn't seem to occur in 1.8, so I suspect a reflow branch regression.
 
I see this with xul trees as well now.
Blocks: 385266
Keywords: regression
Summary: XUL editor element within a xul grid breaks the window → XUL tree / editor element within a xul grid breaks the window
Though, my tree is a direct child of the containing grid (in-between <row> elements).
This is a regression from bug 370659 caused because an overflow rect is being included. Commenting out the code in nsNativeThemeCocoa::GetWidgetOverflow fixes this bug. That code is actually correct though.

The issue is in nsFrame::BoxReflow which is called twice, once to calculate the min/max/pref width and the other during reflow. In the former case, the NS_FRAME_OUTSIDE_CHILDREN bit isn't yet set, but in the latter it is which causes the overflow rect to be added to the desired size. I'm not sure what this code is for or why the overflow area is being added to the size though.
Depends on: 370659
Attached patch simple changeSplinter Review
This isn't really the right patch, but a simple fix is to just ignore the native theme overflow for box wrapped blocks. This does mean that this small number of pixels might get cut off in this very unlikely case where an inline or block has a moz-appearance set, but that would be easier to workaround than it would be to fix how overflow on boxes works.
Assignee: jag → enndeakin
Status: NEW → ASSIGNED
Attachment #277593 - Flags: superreview?(roc)
Attachment #277593 - Flags: review?(roc)
See bug 375180.

I'm fine with taking this patch as a workaround.
This does mean that HTML form elements with native theming that get wrapped as XUL boxes won't include the overflow, and possibly similar issues with XUL elements inside HTML containers inside a box context --- all these could experience painting/invalidation problems.

I wonder which of the patch in bug 375180 and the patch here is the lesser of the two evils.
Roc, I think that unless we have a better idea, we should take this patch for M8 so we can get some testing. The only difference I've seen from testing is that there is a smaller gap around a native themed block. Also, this only affects Mac as neither Windows/Linux native themes include an extra overflow area (except Linux scrollbuttons)
Attachment #277593 - Flags: superreview?(roc)
Attachment #277593 - Flags: superreview+
Attachment #277593 - Flags: review?(roc)
Attachment #277593 - Flags: review+
Attachment #277593 - Flags: approval1.9?
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: