Replaced elements with display: block apply margin incorrectly beside floats

RESOLVED WORKSFORME

Status

()

Core
Layout
RESOLVED WORKSFORME
10 years ago
10 years ago

People

(Reporter: Nikolai Kondrashov, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-0etch1)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2pre) Gecko/2007112205 Minefield/3.0b2pre

When some replaced element with "display" CSS property set to "block" is placed beside a float in the same container, its margins start from the float boundary not from the container inner boundary.

Reproducible: Always

Steps to Reproduce:
1. Open a page contain the following:

<SPAN style="float:left; width:10em; text-align:right;">Text:</SPAN>
<INPUT type="text" style="display:block;margin-left:11em;">

Actual Results:  
It renders like:

        Text:           [          ]



Expected Results:  
Should be rendered like:

        Text: [          ]


This works in IE and Opera and in Firefox 2.x.
BUT, in Firefox 2.x it behaves the same with multi-line selects.

If in the above example you replace replaced element with
just some inline element, everything works as expected.
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → Trunk
(Reporter)

Comment 1

10 years ago
I have setup a demo page at http://oktetlabs.ru/~knu/bug_405080.html
to help you confirm the bug.

If this bug is not fixed, I will need to rewrite a lot of (currently) perfectly working markup when Firefox 3 comes out. And a lot is, like, a hundred pages.
And this will make the source ugly. Plus I don't think I will be alone in this.

Thank you in advance.
(Reporter)

Comment 2

10 years ago
Well, I have just tried the latest night build (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5pre) Gecko/2008032605 Minefield/3.0b5pre) and the bug is still there. I.e. it hasn't been fixed accidentally.

Please, at least confirm this bug. Visit the test page: http://oktetlabs.ru/~knu/bug_405080.html
(Reporter)

Comment 3

10 years ago
Created attachment 311990 [details]
Demo page
(Reporter)

Comment 4

10 years ago
It seems, that it is fixed! Checked on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008041606 Minefield/3.0pre.

Thank you very much:)!
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Comment 5

10 years ago
No bug / patch identified as the browser code fix.

-> WORKSFORME
Resolution: FIXED → WORKSFORME
You need to log in before you can comment on or make changes to this bug.