Closed Bug 1112243 Opened 10 years ago Closed 9 years ago

[e10s] <select> dropdowns are blank, if there are many options (e.g. at http://www.bls.gov/data/inflation_calculator.htm )

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
e10s m5+ ---

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

STR:

1) Go to http://www.bls.gov/data/inflation_calculator.htm
2) Click on the dropdown to select the year

ER:

Should see scrollable popup listing the years I can select

AR:

A popup appears, and it's scrollable, but it's also blank.

We might not be serializing our menupopup correctly.
Attached file testcase 1
Broadening summary & adding keyword & dependency from duplicate-bug 1112248.
Blocks: fxe10s, 1053981
Keywords: regression
Hardware: x86 → All
Summary: [e10s] "Years" select dropdown is blank on http://www.bls.gov/data/inflation_calculator.htm → [e10s] <select> dropdowns are blank, if there are many options (e.g. at http://www.bls.gov/data/inflation_calculator.htm )
Version: unspecified → Trunk
Assignee: nobody → mconley
Status: NEW → ASSIGNED
Status: ASSIGNED → NEW
The XUL menulist popup that we use for displaying <html:select> dropdowns
from the content process is sometimes not wide enough to properly display
the labels inside of it - especially if there is a scrollbar. The sizetopopup
attribute allows us to make sure that the popup assumes its preferred size
and is not constrained by the size of the menulist item. This ensures that
all labels are displayed properly.
Comment on attachment 8555996 [details] [diff] [review]
[e10s] Set sizetopopup="always" on ContentSelectDropdown. r=?

The XUL menulist popup that we use for displaying <html:select> dropdowns
from the content process is sometimes not wide enough to properly display
the labels inside of it - especially if there is a scrollbar. The sizetopopup
attribute allows us to make sure that the popup assumes its preferred size
and is not constrained by the size of the menulist item. This ensures that
all labels are displayed properly.
Attachment #8555996 - Flags: review?(dao)
Comment on attachment 8555996 [details] [diff] [review]
[e10s] Set sizetopopup="always" on ContentSelectDropdown. r=?

I don't think I understand this patch. https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/menulist says:

"If the sizetopopup attribute is left out or set to none, the menu will be its preferred width and the popup may extend outside of this width, unaffected by the maximum width of the menu itself."

which is pretty much what we want, isn't it?
Attachment #8555996 - Flags: review?(dao)
So I dug into this more, because you're right Dao - that documentation doesn't really make a whole lot of sense with what I'm seeing.

It looks like this sizetopopup fix is a bit of a hack that's taking advantage of the fact that at the point of laying out the menupopup, the menulist should have calculated its preferred width to match the needs of the menupopup. Then, this bit of code executes in nsMenuPopupFrame::LayoutPopup:

  // get the preferred, minimum and maximum size. If the menu is sized to the
  // popup, then the popup's width is the menu's width.
...
  if (aSizedToPopup) {
    prefSize.width = aParentMenu->GetRect().width;
  }

Which makes it so that the preferred size of the menupopup matches that of the menulist. And that's what's causing my patch to work. aSizedToPopup is only ever true in this context if sizetopopup="always" or "pref".

So, to sum, I guess this is a hack that's taking advantage of this decision to set the preferred size of the popup to match the parent when sizetopopup="always" or "pref".

Maybe the better solution would be to make it so that for long menulists (with a scrollbar) with short labels, the menupopup does a better job of calculating its preferred size so that labels are displayed[1].

Neil, does that sound right?

[1]: Because after testing it, it seems like this is true for all <xul:menulists>. Without a sizetopopup attribute set to "pref" or "always", long menulists with a scrollbar and short labels cause the labels to get squished out so that they're not visible.
Flags: needinfo?(enndeakin)
What you should do is add:

    <content sizetopopup="pref">

to the menulist-popuponly binding, as the other menulist bindings have, so they always default to sizing themselves properly.

That's not actually the width you want though for the ContentSelectDropdown; you actually want the popup to be same width as the <select> element. But that's best done after 873923.
Flags: needinfo?(enndeakin)
Yes, that works nicely. Thanks!
The rest of the menulist bindings have this, and is used to properly size
the menupopup when the menulist is opened. Without it, for long menulists
with a scrollbar, and short labels, the labels will get squeezed out during
layout and not be visible.
Attachment #8555996 - Attachment is obsolete: true
Comment on attachment 8556557 [details] [diff] [review]
add sizetopref to menulist-popuponly binding content. r=?

This works well! Asking for review from Dao since it was Enn that suggested this change in the first place.
Attachment #8556557 - Flags: review?(dao)
Attachment #8556557 - Flags: review?(dao) → review+
https://hg.mozilla.org/mozilla-central/rev/a465bbe65e90
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
QA Whiteboard: [good first verify][verify in Nightly only]
Per dupe bug 1168247, this is not actually fixed. (The testcase attached here -- attachment 8537362 [details] -- still reproduces the bug as well.)

Reopening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I'm seeing this bug (blank dropdown) w/ attached testcase, in latest nightly on Linux, with a fresh profile. Nightly 41.0a1 (2015-05-25)
(Looks like this was really fixed for a while, and then regressed. I tested a random Nightly between comment 14 and now (2015-02-16) and it shows the correct rendering.  For sanity's sake, I'll re-close this, since it was fixed at one point, and reclassify bug 1168247 as a regression.)
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: