Closed Bug 88352 Opened 23 years ago Closed 23 years ago

Element with float:right and padding-left:n are not displayed correctly (new in 0.9.1, worked in 0.8.1 and previous)

Categories

(Core :: Layout, defect, P3)

x86
All
defect

Tracking

()

RESOLVED DUPLICATE of bug 85876
mozilla0.9.3

People

(Reporter: darren, Assigned: waterson)

References

()

Details

(Keywords: regression)

Attachments

(2 files)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdksecure i686; en-US; rv:0.9.1)
Gecko/20010622
BuildID:    20010622

The main body text in the page should float to the right of the navbar. This was
displayed correctly in previous versions of mozilla.

Here is a screenshot of how the page should display (and used to):

http://www.cogsci.ed.ac.uk/~ddb/home-ie55.jpg

This is a screenshot of how it is actually displaying:

http://www.cogsci.ed.ac.uk/~ddb/home-moz091.jpg

Note that not only is the main text incorrectly positioned, and but the left
side of the text is truncated.

Reproducible: Always
Steps to Reproduce:
1. Load page http://www.cogsci.ed.ac.uk/~ddb/index.html in browser.


Actual Results:  See screenshot: http://www.cogsci.ed.ac.uk/~ddb/home-moz091.jpg

Expected Results:  See screenshot: http://www.cogsci.ed.ac.uk/~ddb/home-ie55.jpg

http://www.cogsci.ed.ac.uk/~ddb/index.html has been validated for both html and
css at the w3c validation service.
I have misdescribed this bug. It appears to be caused by an element having both
float:right and padding-left:n set. Here is a test case:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>88352 Test Case</title>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <meta name="Author" content="D. D. Brierton">
    <link rev="made" href="mailto:ddb@cogsci.ed.ac.uk">
    <style type="text/css" media="screen">
    <!--
      DIV.navbar { float : left; }
      DIV.main { float : right; padding-left : 2em; padding-right : 1em; }
    -->
    </style>
  </head>
  <body>
    <h1>Bug #88352 Test Case</h1>
    <div class="navbar">
      <p>Navbar 1<br>
       Navbar 2<br>
       Navbar 3<br>
       Navbar 4</p>
    </div>
    <div class="main">
      <p>This is the main body text. The quick brown fox jumps over the lazy
      dog. XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
      XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
      XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
      XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
      XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
      XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
      XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
      XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
      XXXX XXXX XXXX XXXX XXXX XXXX XXXX.</p>
    </div>
  </body>
</html>

If both padding statements are removed from DIV.main style then the page
displays correctly. If the padding-left is then added the div displays below the
navbar. If the both padding-left and padding-right are added the div displays
below and is displaced to the left, truncating the beginning of each line.

Sorry for not checking more carefully. I'll see if this is a duplicate.
Summary: Element with float:right next to element with float:left wrongly positioned (new in 0.9.1, worked in 0.8.1 and previous) → Element with float:right and padding-left:n are not displayed correctly (new in 0.9.1, worked in 0.8.1 and previous)
Attached file testcase
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
It's actually the testcase without padding that we're displaying incorrectly. 
Floats without a width specified should be sized based on the amount of space in
their containing block and based on their content, but not based on space remaining.
QA Contact: petersen → ian
Probably my fault.
Assignee: karnaze → waterson
Status: NEW → ASSIGNED
Keywords: regression
Priority: -- → P3
Target Milestone: --- → mozilla0.9.3

*** This bug has been marked as a duplicate of 85876 ***
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: