Closed Bug 282607 Opened 20 years ago Closed 19 years ago

Select have problem with the pseudo element ::first-letter

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: liperuf, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: testcase)

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Look at this small code. 

<html>
<head>
<style>
	div:first-letter { /* void anyway */  }
</style>
</head>

<body>
<div> Select &nbsp;&nbsp;&nbsp;
	<select name="Sistema">
         <option value="1">QUALID</option>
         <option value="2">SIST_MASTER</option>
         <option value="3">ITG</option>
         <option value="4">GERADOR</option>
         <option value="5">SIST_INTEG</option>
	</select>
</div>
</body>
</html>

If you RUN it in FF1.0, the select goes insane! The value that I have selected
go to the last place and nothing appears. I dont know what to do! Im from
Brazil, sorry for my poor english, when I know more about your language I'll
describe it better!

Reproducible: Always

Steps to Reproduce:
1. Write the CSS and HTML code
2. Open Firefox
3. Load the page (both)
4. Try to select one value
5. The problem happens

Actual Results:  
The select avoid and the selected value goes to the last place (and cannot be
selected again)

Expected Results:  
Shows nothing and moved the option to the last place.

<html>
<head>
<style>
	div:first-letter { /* void anyway */  }
</style>
</head>

<body>
<div> Select &nbsp;&nbsp;&nbsp;
	<select name="Sistema">
         <option value="1">QUALID</option>
         <option value="2">SIST_MASTER</option>
         <option value="3">ITG</option>
         <option value="4">GERADOR</option>
         <option value="5">SIST_INTEG</option>
	</select>
</div>
</body>
</html>
Assignee: firefox → nobody
Severity: critical → major
Status: UNCONFIRMED → NEW
Component: General → Layout: Form Controls
Ever confirmed: true
Keywords: testcase
OS: Windows 2000 → All
Product: Firefox → Core
QA Contact: general → layout.form-controls
Hardware: PC → All
Summary: Select have problem with the pseudo class ' first-letter ' → Select have problem with the pseudo element ::first-letter
Version: unspecified → Trunk
Attached file Reporter's testcase
Taking this...
Assignee: nobody → mats.palmgren
Attached file Testcase #2
Attached file stack
This stack pretty much sums it up. When the frame construtor is notified of
the content change it recreates frames, and since it doesn't know better,
it uses GetContentInsertionFrame() which in this case is wrong.
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/base/nsCSSFrameConstructor.cpp&rev=1.1059&root=/cvsroot&mark=9277,9282-9286#9275
Attached patch Patch rev. 1Splinter Review
The nsIDOMHTMLCollection -> nsIDOMHTMLOptionsCollection change is unrelated to
this bug but it's a simple correction to make this file compile when
DO_NEW_REFLOW or DO_REFLOW_COUNTER is defined (they are both off by default).
Let me know if you want this bit as a separate patch.
Attachment #174737 - Flags: superreview?(bzbarsky)
Attachment #174737 - Flags: review?(bzbarsky)
Comment on attachment 174737 [details] [diff] [review]
Patch rev. 1

> nsComboboxControlFrame::RedisplayText(PRInt32 aIndex)
> {

Add 

  NS_PRECONDITION(!mInRedisplayText, "Nested RedisplayText");

or something here, since you're assuming that won't happen?

With that, r+sr=bzbarsky
Attachment #174737 - Flags: superreview?(bzbarsky)
Attachment #174737 - Flags: superreview+
Attachment #174737 - Flags: review?(bzbarsky)
Attachment #174737 - Flags: review+
Added the suggested pre-condition and checked in 2005-02-19 15:54 PDT.

-> FIXED
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Blocks: 283117
No longer blocks: 283117
Depends on: 283117
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: