Closed
Bug 706609
Opened 14 years ago
Closed 13 years ago
drop downs do not resize to the text properly when in portrait mode
Categories
(Firefox for Android Graveyard :: General, defect, P1)
Tracking
(fennec11+)
VERIFIED
FIXED
Firefox 12
| Tracking | Status | |
|---|---|---|
| fennec | 11+ | --- |
People
(Reporter: nhirata, Assigned: dbaron)
References
()
Details
(Whiteboard: readability, [font-inflation: form controls])
Attachments
(12 files, 5 obsolete files)
1. install latest nightly (20111130)
2. set device to portrait mode
3. go to http://people.mozilla.com/~nhirata/html_tp/formsninput.html
4. look at dropdown
Expected: to be able to read the current selection
Actual: the dropdown is not resized to the text.
Note:
1. does not occur on the default browser
| Reporter | ||
Comment 1•14 years ago
|
||
| Reporter | ||
Updated•14 years ago
|
OS: Mac OS X → Android
Hardware: x86 → ARM
Updated•14 years ago
|
Assignee: nobody → dbaron
Priority: -- → P2
Whiteboard: readability
| Assignee | ||
Updated•14 years ago
|
Blocks: font-inflation
Priority: P2 → --
| Assignee | ||
Comment 2•14 years ago
|
||
Yeah, this requires changes to nsListControlFrame.
Updated•14 years ago
|
Whiteboard: readability → readability, [font-inflation: form controls]
Updated•14 years ago
|
Priority: -- → P1
| Assignee | ||
Comment 4•13 years ago
|
||
So I think the best way to proceed here, since a combobox contains a listbox in its dropdown, is to:
1. fix listboxes
2. fix comboboxes, if the fix for (1) doesn't already fix comboboxes
I tried https://hg.mozilla.org/users/dbaron_mozilla.com/patches/file/fdf7f5b496e4/font-inflation-selects but it doesn't work yet, though; I haven't yet had a chance to debug why.
| Assignee | ||
Comment 5•13 years ago
|
||
Handling nsSelectsAreaFrame in IsContainerForFontSizeInflation:
https://hg.mozilla.org/users/dbaron_mozilla.com/patches/file/be2789ce52ad/font-inflation-selects
fixes the text size and height issues for both list boxes and comboboxes, but widths are still wrong. That probably does require hacking list controls and or comboboxes.
| Assignee | ||
Comment 6•13 years ago
|
||
I think the width calculation for dropdowns is just nsContainerFrame::ComputeAutoSize and nsFrame::ShrinkWidthToFit. Ideally, ComputeAutoSize would consider inflation throughout when we're in subtrees that don't contain inflation containers, but it depends on GetMinWidth and GetPrefWidth which, in general, can't.
| Assignee | ||
Comment 7•13 years ago
|
||
(In reply to David Baron [:dbaron] from comment #6)
> I think the width calculation for dropdowns is just
> nsContainerFrame::ComputeAutoSize and nsFrame::ShrinkWidthToFit. Ideally,
> ComputeAutoSize would consider inflation throughout when we're in subtrees
> that don't contain inflation containers, but it depends on GetMinWidth and
> GetPrefWidth which, in general, can't.
Er, really, it's not specific to ComputeAutoSize: it's just about doing
intrinsic width calculations in subtrees that don't contain inflation
containers.
| Assignee | ||
Comment 8•13 years ago
|
||
The simplest solution to that problem I can think of is:
* add a frame state bit for whether a frame is a container for font size inflation, and set it during frame construction so we have it cheaply in the future
* add a boolean parameter to GetPrefWidth, GetMinWidth, and AddInline{Min,Pref}Width that says whether to consider font size inflation. Set it to false at the very start of the method for anything that's an inflation container; then pass it down to descendants.
Updated•13 years ago
|
tracking-fennec: --- → 11+
| Assignee | ||
Comment 9•13 years ago
|
||
Attachment #589941 -
Flags: review?(roc)
| Assignee | ||
Comment 10•13 years ago
|
||
Attachment #589942 -
Flags: review?(roc)
| Assignee | ||
Comment 11•13 years ago
|
||
Attachment #589943 -
Flags: review?(roc)
| Assignee | ||
Comment 12•13 years ago
|
||
Attachment #589944 -
Flags: review?(roc)
| Assignee | ||
Comment 13•13 years ago
|
||
Attachment #589945 -
Flags: review?(roc)
| Assignee | ||
Comment 14•13 years ago
|
||
Attachment #589946 -
Flags: review?(roc)
| Assignee | ||
Comment 15•13 years ago
|
||
Attachment #589947 -
Flags: review?(roc)
| Assignee | ||
Comment 16•13 years ago
|
||
Attachment #589948 -
Flags: review?(roc)
Comment on attachment 589941 [details] [diff] [review]
Add a frame state bit for whether a frame is a container for font size inflation (, patch 1)
Review of attachment 589941 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/generic/nsFrame.cpp
@@ +519,5 @@
> +#endif
> + ) {
> + if (IsFontSizeInflationContainer(this)) {
> + mState |= NS_FRAME_FONT_INFLATION_CONTAINER;
> + }
Pass nsStyleDisplay as a parameter to IsFontSizeInflationContainer and reuse the call to GetStyleDisplay() for transforms.
Attachment #589941 -
Flags: review?(roc) → review+
Attachment #589942 -
Flags: review?(roc) → review+
Attachment #589943 -
Flags: review?(roc) → review+
| Assignee | ||
Comment 18•13 years ago
|
||
In addition to addressing comment 17, this also adds an exception to an assertion for br frames, since the assertion was firing in a harmless way.
Attachment #590047 -
Flags: review?(roc)
| Assignee | ||
Updated•13 years ago
|
Attachment #589941 -
Attachment is obsolete: true
| Assignee | ||
Comment 19•13 years ago
|
||
Attachment #590048 -
Flags: review?(roc)
Comment on attachment 589944 [details] [diff] [review]
Set inflation container to null during parts of intrinsic sizing that should not have inflation applied. (, patch 4)
Review of attachment 589944 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/nsLayoutUtils.cpp
@@ +2240,5 @@
> + if (nsLayoutUtils::IsContainerForFontSizeInflation(aFrame)) {
> + // If aFrame is a container for font size inflation, then shrink
> + // wrapping inside of it should not apply font size inflation.
> + presContext->mCurrentInflationContainer = nsnull;
> + }
What about having a slightly different and more efficient AutoRestore API that doesn't save and restore unless the condition is true? e.g.
AutoRestore<T> ar;
if (cond) {
ar.SaveAndSet(&value, v);
}
Better still, have dedicated AutoSetInflationContainer(nsIFrame*) class that encapsulates this into one line.
| Assignee | ||
Comment 22•13 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #20)
> What about having a slightly different and more efficient AutoRestore API
> that doesn't save and restore unless the condition is true? e.g.
> AutoRestore<T> ar;
> if (cond) {
> ar.SaveAndSet(&value, v);
> }
That's more complicated, since then the restoring has to be conditional too and the condition has to be stored. Feels like over-optimizing to me.
| Assignee | ||
Comment 23•13 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #21)
> Better still, have dedicated AutoSetInflationContainer(nsIFrame*) class that
> encapsulates this into one line.
I suppose that's probably worth it, though.
Comment on attachment 589945 [details] [diff] [review]
Switch nsLayoutUtils inflation methods to the new setup with state on the pres context. (, patch 5)
Review of attachment 589945 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/nsLayoutUtils.h
@@ +1490,5 @@
> * smaller than 1.
> *
> + * The WidthDetermination parameter says how we determine the width of
> + * the nearest inflation container: when not in reflow we look at the
> + * frame tree; when in reflow we look at state stored on the pres
fix double space
::: layout/forms/nsTextControlFrame.cpp
@@ +503,5 @@
> // FIXME: This won't turn out so well for the height; maybe disable
> // inflation entirely in this case?
> inflation = 1.0f;
> } else {
> + // FIXME: THIS IS WRONG
Why? Can this be called from outside reflow?
Attachment #589946 -
Flags: review?(roc) → review+
Attachment #589947 -
Flags: review?(roc) → review+
Attachment #589948 -
Flags: review?(roc) → review+
Comment on attachment 589948 [details] [diff] [review]
Make selects and things inside them not be containers for font size inflation, so that font inflation inflate selects appropriately along with what surrounds them. (, patch 8)
Review of attachment 589948 [details] [diff] [review]:
-----------------------------------------------------------------
Hmm, actually, what about optgroup?
This is actually a bit ugly. For example it means an <option> element outside a <select> will get special treatment. Ideally something would explicitly check if we're inside a select (or just a popup). I'm not sure what the cleanest way to do that would be...
Attachment #590047 -
Flags: review?(roc) → review+
Comment on attachment 590048 [details] [diff] [review]
Make floating :first-letter frames not be containers for font size inflation, to avoid triggering assertions. (, patch 3.5)
Review of attachment 590048 [details] [diff] [review]:
-----------------------------------------------------------------
I wish this wasn't getting to be more and more overhead... preface this with a check for aStyleDisplay->IsFloating()?
Attachment #590048 -
Flags: review?(roc) → review+
| Assignee | ||
Comment 27•13 years ago
|
||
This does as comment 21 suggests, though with a different name.
Attachment #590884 -
Flags: review?(roc)
| Assignee | ||
Updated•13 years ago
|
Attachment #589944 -
Attachment is obsolete: true
Attachment #589944 -
Flags: review?(roc)
| Assignee | ||
Comment 28•13 years ago
|
||
This is a new patch to address the FIXMEs in patch 5: I realize that treating ComputeSize the same as intrinsic width computation will simplify that FIXME.
Attachment #590885 -
Flags: review?(roc)
| Assignee | ||
Comment 29•13 years ago
|
||
And here's the revised version of patch 5 without those FIXMEs, on top of patch 4.5
Attachment #590886 -
Flags: review?(roc)
| Assignee | ||
Updated•13 years ago
|
Attachment #589945 -
Attachment is obsolete: true
Attachment #589945 -
Flags: review?(roc)
Comment on attachment 590884 [details] [diff] [review]
Set inflation container to null during parts of intrinsic sizing that should not have inflation applied. (, patch 4)
Review of attachment 590884 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/nsLayoutUtils.h
@@ +1668,5 @@
> + }
> + private:
> + const bool mIsInflationContainer;
> + nsPresContext *mPresContext;
> + nsIFrame *mOldValue;
You don't need the bool, you can just let mPresContext be null to indicate that you didn't set the current container to null.
Attachment #590885 -
Flags: review?(roc) → review+
Attachment #590886 -
Flags: review?(roc) → review+
| Assignee | ||
Updated•13 years ago
|
Attachment #590884 -
Attachment is obsolete: true
Attachment #590884 -
Flags: review?(roc)
Attachment #590898 -
Flags: review?(roc) → review+
| Assignee | ||
Comment 32•13 years ago
|
||
To address the optgroup issue (comment 25), this adds one extra check for optgroup (didn't see any obvious better choice), and adds select-listbox-2 and select-combobox-2 tests to match.
Attachment #590928 -
Flags: review?(roc)
| Assignee | ||
Updated•13 years ago
|
Attachment #589948 -
Attachment is obsolete: true
Every one of these checks adds a tiny bit of overhead to the construction of most frames. And I'm not super happy about <option>s and <optgroup>s getting special treatment when outside a <select>, either.
Could nsCSSFrameConstructor detect when we're constructing frames under a <select>, and clear out the inflation-container bits for those frames?
| Assignee | ||
Comment 34•13 years ago
|
||
(In reply to David Baron [:dbaron] from comment #18)
> In addition to addressing comment 17, this also adds an exception to an
> assertion for br frames, since the assertion was firing in a harmless way.
It turns out I need to make the same exception for MathML frames, for the same reason. With that fix, try is green; now just waiting on review on the changes to patch 8.
What about comment #33?
| Assignee | ||
Comment 36•13 years ago
|
||
Sorry, I missed comment 33. I suppose I should do something about the fact that I'm getting too much bugmail to actually read it and have time to do other things.
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #33)
> Every one of these checks adds a tiny bit of overhead to the construction of
> most frames.
See below (last comment).
> And I'm not super happy about <option>s and <optgroup>s getting
> special treatment when outside a <select>, either.
I'm not concerned about that. I think the fact that we, internally, treat option and optgroup as 'display:block' isn't something that Web authors should depend on. If we were honestly concerned about this we should make them display:block only when they're inside selects -- and then your concern would go away since as non-blocks outside of selects they wouldn't be inflation containers.
> Could nsCSSFrameConstructor detect when we're constructing frames under a
> <select>, and clear out the inflation-container bits for those frames?
I'm not sure this would be faster, since we'd have to set up this state on every mutation.
I could move this into a frame subclass, except that we're going to have to make this code a *lot* more complicated to fix bug 706193 -- that's going to make inflation container setting require textrun-construction-like analysis (but slightly different). So I'd really rather not try to optimize it until during or after I work on bug 706193.
Comment on attachment 590928 [details] [diff] [review]
Make selects and things inside them not be containers for font size inflation, so that font inflation inflate selects appropriately along with what surrounds them. (, patch 8)
Review of attachment 590928 [details] [diff] [review]:
-----------------------------------------------------------------
OK.
Attachment #590928 -
Flags: review?(roc) → review+
| Assignee | ||
Comment 38•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/479a6867fcd3
https://hg.mozilla.org/integration/mozilla-inbound/rev/2e49b2f5abc1
https://hg.mozilla.org/integration/mozilla-inbound/rev/bdb0f1de8252
https://hg.mozilla.org/integration/mozilla-inbound/rev/b626d3cc9ab1
https://hg.mozilla.org/integration/mozilla-inbound/rev/3051be6f12c2
https://hg.mozilla.org/integration/mozilla-inbound/rev/8213675b8a78
https://hg.mozilla.org/integration/mozilla-inbound/rev/561d7fded0cc
https://hg.mozilla.org/integration/mozilla-inbound/rev/7a0cbba01ab5
https://hg.mozilla.org/integration/mozilla-inbound/rev/5d3bf7112023
https://hg.mozilla.org/integration/mozilla-inbound/rev/2bad4ac7fefe
Target Milestone: --- → Firefox 11
Comment 39•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/479a6867fcd3
https://hg.mozilla.org/mozilla-central/rev/2e49b2f5abc1
https://hg.mozilla.org/mozilla-central/rev/bdb0f1de8252
https://hg.mozilla.org/mozilla-central/rev/b626d3cc9ab1
https://hg.mozilla.org/mozilla-central/rev/3051be6f12c2
https://hg.mozilla.org/mozilla-central/rev/8213675b8a78
https://hg.mozilla.org/mozilla-central/rev/561d7fded0cc
https://hg.mozilla.org/mozilla-central/rev/7a0cbba01ab5
https://hg.mozilla.org/mozilla-central/rev/5d3bf7112023
https://hg.mozilla.org/mozilla-central/rev/2bad4ac7fefe
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: Firefox 11 → Firefox 12
Comment 40•13 years ago
|
||
Verified fix on 1-26-2012 nightly. Changing font size also retains the text size property in the drop down.
Status: RESOLVED → VERIFIED
| Assignee | ||
Comment 41•13 years ago
|
||
Comment on attachment 590928 [details] [diff] [review]
Make selects and things inside them not be containers for font size inflation, so that font inflation inflate selects appropriately along with what surrounds them. (, patch 8)
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Testing completed (on m-c, etc.):
Risk to taking this patch (and alternatives if risky):
Attachment #590928 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•13 years ago
|
Attachment #589942 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•13 years ago
|
Attachment #589943 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•13 years ago
|
Attachment #589946 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•13 years ago
|
Attachment #589947 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•13 years ago
|
Attachment #590047 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•13 years ago
|
Attachment #590048 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•13 years ago
|
Attachment #590885 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•13 years ago
|
Attachment #590886 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•13 years ago
|
Attachment #590898 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Comment 42•13 years ago
|
||
[Approval Request Comment]
Regression caused by (bug #): bug 627842 (new feature)
User impact if declined: Font inflation won't apply to <select> elements.
Testing completed (on m-c, etc.):
Risk to taking this patch (and alternatives if risky): Changes behavior of font size inflation a bit. Shouldn't change behavior in non-DEBUG cases where font size inflation isn't enabled.
Comment 43•13 years ago
|
||
Comment on attachment 590928 [details] [diff] [review]
Make selects and things inside them not be containers for font size inflation, so that font inflation inflate selects appropriately along with what surrounds them. (, patch 8)
[Triage Comment]
Mobile only - approved for Aurora.
Attachment #590928 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #589942 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #589943 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #589946 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #589947 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #590047 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #590048 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #590885 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #590886 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #590898 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
| Assignee | ||
Comment 44•13 years ago
|
||
I'm not going to have time to land this on aurora before leaving for vacation. It turns out it also requires landing on aurora some other font inflation patches that haven't been landed on aurora, and figuring out what those are will be a bit of work. (The first one I hit is changeset c248c37f9cf7, but it has a merge conflict in tests which indicates there's something else under it.) (If we're going to ship font inflation from a release based on current aurora, we'll want them... though I'm honestly not sure what our current plans are.)
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•