Closed Bug 806364 Opened 13 years ago Closed 13 years ago

Setting SELECT's innerHTML with empty OPTGROUPs with @label will cause Firefox hangs

Categories

(Core :: Layout: Form Controls, defect)

16 Branch
x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19
Tracking Status
firefox16 --- affected
firefox17 + wontfix
firefox18 + verified
firefox19 + fixed

People

(Reporter: borisov.gleb, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: regression, Whiteboard: Regressed by Bug 575294)

Attachments

(2 files, 1 obsolete file)

Attached file Test case
someSelect.innerHTML = '<select><optgroup label="124"></optgroup><optgroup label="123"></optgroup></select>'; will cause firefox hang. Tested on Mac OS X 10.8 with Firefox 16.0.1. Activity Monitor shows 100% cpu load. If we remove label attribute from optgroup all seems good. I've attached minimal test case.
Flags: needinfo?(borisov.gleb)
I can reproduce in windows7. God build: Optgrpup labels are drawn in pull down list. Bad build: 100% CPU core usage. And no upll down list pops up Regresseion window(m-c) Good: http://hg.mozilla.org/mozilla-central/rev/bf37951c1104 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/16.0 Firefox/16.0a1 ID:20120623031143 Bad: http://hg.mozilla.org/mozilla-central/rev/e21173ed2c38 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/16.0 Firefox/16.0 ID:20120623053647 Pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=bf37951c1104&tochange=e21173ed2c38 Regresseion window(m-i) Good: http://hg.mozilla.org/integration/mozilla-inbound/rev/80b8680bda1c Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/16.0 Firefox/16.0 ID:20120622175046 Bad: http://hg.mozilla.org/integration/mozilla-inbound/rev/c35d2d3071ac Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/16.0 Firefox/16.0 ID:20120622182843 Pushlog: http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=80b8680bda1c&tochange=c35d2d3071ac In local build Last Good: 23f5c88adb8f First Bad: 612ee5c6300d Triggered by 612ee5c6300d Mats Palmgren — Bug 575294. part=3/5 r=roc
Status: UNCONFIRMED → NEW
Component: General → Layout: Form Controls
Ever confirmed: true
Keywords: regression
OS: Mac OS X → All
Product: Firefox → Core
Whiteboard: Regressed by Bug 575294
Attachment #676152 - Attachment mime type: text/plain → text/html
This issue reproduces in clean profile and in safe mode too. Do you need more technical information or bug is confirmed? (In reply to Ioana Budnar [QA] from comment #1) > Does this issue reproduce with a clean profile or in safe mode? > http://support.mozilla.com/kb/Basic+Troubleshooting#w_8-make-a-new-profile > http://support.mozilla.com/kb/Safe+Mode
Flags: needinfo?(borisov.gleb)
Oops, sorry about that. I guess you can work around the problem by adding a <option style='display:none'> to innerHTML.
Assignee: nobody → matspal
Thanks for prompt investigation!
We'll try to get this fixed for FF17, but if it carries any risk, it'd likely need to land tomorrow on mozilla-beta to skip up the trains (we'd uplift to FF18 instead).
Doesn't PrincipalChildList potentially include text nodes between <option>s? We don't want to count those, do we?
We only create frames for <option> and <optgroup> in <select>: http://mxr.mozilla.org/mozilla-central/source/layout/base/nsCSSFrameConstructor.cpp#5209
Comment on attachment 676271 [details] [diff] [review] Calculate dropdown height based on number of principal child frames instead of GetNumberOfOptions() which only included <option> nodes, not <optgroup>s. Review of attachment 676271 [details] [diff] [review]: ----------------------------------------------------------------- I'm not totally comfortable with hard-coding the requirement that there's exactly one frame per row. How about creating a helper method GetNumberOfRows(), which calls PrincipalChildList().Length(), and calling that, so that requirement is at least confined to one place. r+ with that.
Attachment #676271 - Flags: review?(roc) → review+
Comment on attachment 676271 [details] [diff] [review] Calculate dropdown height based on number of principal child frames instead of GetNumberOfOptions() which only included <option> nodes, not <optgroup>s. Yeah, this is pretty wrong actually, since we should use the GetOptionsContainer() frame. I'll write up something better...
Attachment #676271 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment on attachment 677015 [details] [diff] [review] fix [Approval Request Comment] Bug caused by (feature/regressing bug #): User impact if declined: hang with 100% CPU load when clicking on a combobox with no <option> but at least one <optgroup> in it Testing completed (on m-c, etc.): on m-c since 2012-11-01 Risk to taking this patch (and alternatives if risky): low risk String or UUID changes made by this patch: none
Attachment #677015 - Flags: approval-mozilla-beta?
Attachment #677015 - Flags: approval-mozilla-aurora?
Although the fix is low risk, the user scenario described in comment 15 is so uncommon that we'll get this first fixed in FF18.
Attachment #677015 - Flags: approval-mozilla-beta?
Attachment #677015 - Flags: approval-mozilla-beta-
Attachment #677015 - Flags: approval-mozilla-aurora?
Attachment #677015 - Flags: approval-mozilla-aurora+
Blocks: 816809
(In reply to Mats Palmgren [:mats] from comment #15) > Comment on attachment 677015 [details] [diff] [review] > User impact if declined: hang with 100% CPU load when clicking on a combobox > with no <option> but at least one <optgroup> in it This is actually wrong. It hangs as soon as the page loads. User doesn't need to click on the combobox and it doesn't happen when there is only one <optgroup>. This is a serious problem and I'm really surprised this wasn't fixed ASAP in Fx 16 and even 17.
Verified as fixed on Firefox 18 beta 4: Mozilla/5.0 (Windows NT 6.1; rv:18.0) Gecko/18.0 Firefox/18.0 Mozilla/5.0 (X11; Linux i686; rv:18.0) Gecko/18.0 Firefox/18.0 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:18.0) Gecko/20100101 Firefox/18.0
Keywords: verifyme
QA Contact: ioana.budnar
mass remove verifyme requests greater than 4 months old
Keywords: verifyme
Depends on: 1212688
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: