Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Drop down selector (combobox) stuck following new selection

RESOLVED FIXED in Firefox 17

Status

()

Core
Layout: Form Controls
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Olivier, Assigned: Mats Palmgren (vacation - back in August))

Tracking

({regression})

16 Branch
mozilla19
regression
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(firefox17 fixed, firefox18 verified)

Details

Attachments

(3 attachments)

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0
Build ID: 20121010144125

Steps to reproduce:

I have a drop down selector with multiple items into it. After selecting a new item with the mouse, when I complete the selection, if I click again on the selector to select another item, it is stuck. I have to click somewhere else on the page to allow the selection to happen again. Otherwise, the drop down selector will just not react to the mouse click.


Actual results:

I saw this problem happening while having events attached to the selection. For instance, selecting item 1 will show a div "A" with some form elements and hide a div "B" with some other form elements. Selecting item 2 will show div "B" with some form elements and hide div "A" with other form elements. It looks like the show/hide of div is somehow the trigger of the drop down lock.

In the Firefox debugging tool, I have the following exception :
[object XPC_WN_ModsAllowed_NoCall_Proto_JSClass]

Not sure if it is related but it is what is reported when the problem happens.

Please note that this issue is only present in Firefox 16. It wasn't there in Firefox 15.


Expected results:

Drop down shouldn't have been stuck after new selection.

Comment 1

5 years ago
Could you attach a small html testcase, please. It's more easy to test and debug.
(Reporter)

Comment 2

5 years ago
Here is some sample code :
1/ HTML :
  <div class="combotitle">Size</div>
  <form>
        <select id="Size" name="Size" class="criterion">
        <option value="1">Size 1</option>
        <option value="2">Size 2</option>
        </select>
  </form>

  <div id="combotitle1" style="display:none;">Style
  <form>
        <select id="Style" name="Style" class="criterion">
        <option value="1">Style 1</option>
        <option value="2">Style 2</option>
        </select>
  </form></div>

  <div id="combotitle2" style="display:none;">Color
  <form>
        <select id="Color" name="Color" class="criterion">
        <option value="1">Color 1</option>
        <option value="2">Color 2</option>
        </select>
  </form></div>

2/ Jquery code :
jQuery('#Size').change(function()
{
    var currentsel = jQuery('#Size option:selected').val();

if (currentsel == 1)
{
    jQuery('#combotitle1').css('display','inline');
    jQuery('#combotitle2').css('display','none');
}    
else
{
    jQuery('#combotitle1').css('display','none');
    jQuery('#combotitle2').css('display','inline');
}
    
    return false;
});

Feel free to play with this on http://jsfiddle.net. You'll be able to see the issue.

Comment 3

5 years ago
Could you post directly the jsfiddle testcase, please.
(Reporter)

Comment 4

5 years ago
Here it is :
http://jsfiddle.net/Swztb/
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=bb4b37094b9f&tochange=cb2904476d14

I'll bisect tomorrow if nobody has any idea what caused this.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM
Ever confirmed: true
Keywords: regression
OS: Windows 7 → All
Product: Firefox → Core
Hardware: x86_64 → All

Comment 6

5 years ago
Likely to be bug 575294 fallout.

Virgil, form control interaction issues are almost certainly not DOM problems, fwiw.
Blocks: 575294
Component: DOM → Layout: Form Controls

Updated

5 years ago
Summary: Drop down selector stuck following new selection → Drop down selector (combobox) stuck following new selection
Created attachment 677500 [details]
Testcase #1
Assignee: nobody → matspal
Created attachment 677504 [details]
Testcase #2

It seems it only occurs if the 2nd <select> is in a block-in-inline
situation, and it must be a combobox too, not <input> or <select mutliple>
for example.  Weird.
The IB split makes the frame ctor a bit brutal -- it calls RecreateFramesForContent
on the parent, that is <body>, which reframes the first <select> too.
So when nsComboboxControlFrame::ShowDropDown is called (on the second click)
it sees "sFocused != this" so we delay it waiting for an expected SetFocus call.
But FocusManager doesn't call Focus on content if it's already focused:
http://hg.mozilla.org/mozilla-central/annotate/aabf7175cc84/dom/base/nsFocusManager.cpp#l1109
Created attachment 677606 [details] [diff] [review]
fix

It looks like sFocused is some kind of hack for bug 32920; I shouldn't
have used it :(

Check our *content* with the focus manager instead.
Attachment #677606 - Flags: review?(roc)
Attachment #677606 - Flags: review?(roc) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/0829f3b5c51e
https://hg.mozilla.org/mozilla-central/rev/0829f3b5c51e

Possible to test this?
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment on attachment 677606 [details] [diff] [review]
fix

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 575294
User impact if declined: After script does certain restyle changes on a combobox or its ancestors, clicking the combobox does not open the menu unless you unfocus it and click it again
Testing completed (on m-c, etc.): on m-c since 2012-11-02
Risk to taking this patch (and alternatives if risky): very low risk
String or UUID changes made by this patch: none
Attachment #677606 - Flags: approval-mozilla-beta?
Attachment #677606 - Flags: approval-mozilla-aurora?
Comment on attachment 677606 [details] [diff] [review]
fix

Please land this to branches today so we have it in tomorrow's beta.
Attachment #677606 - Flags: approval-mozilla-beta?
Attachment #677606 - Flags: approval-mozilla-beta+
Attachment #677606 - Flags: approval-mozilla-aurora?
Attachment #677606 - Flags: approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/35607764ecd3
https://hg.mozilla.org/releases/mozilla-beta/rev/07fe19d85b51
status-firefox17: --- → fixed
status-firefox18: --- → fixed
Mozilla/5.0 (X11; Linux i686; rv:18.0) Gecko/20100101 Firefox/18.0

Verified Windows 8, Ubuntu 12.04 and Mac OS 10.7 with Firefox beta 6. 
Both testcases and jsfiddle work as expected.
status-firefox18: fixed → verified
QA Contact: virgil.dicu
You need to log in before you can comment on or make changes to this bug.