<pre> inside <div> is misdrawn when window width is less than the width of <pre> text

RESOLVED DUPLICATE of bug 3701

Status

()

RESOLVED DUPLICATE of bug 3701
16 years ago
16 years ago

People

(Reporter: finlay_bugzilla_2003, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312

In HTML 4.0 / CSS1 pages where <pre> text is enclosed within a <div>, such as
the following page:

<div style="background: #ff9999">
  <pre>
             1         2         3         4         5         6         7
    1234567890123456789012345678901234567890123456789012345678901234567890     
     
  </pre>
</div>

if the browser window is resized to be too narrow to show all the <pre>
text, the div background isn't drawn properly on the very right side of
the browser window.  It gets worse if the browser is then horizontally 
scrolled.

Reproducible: Always

Steps to Reproduce:
1. load page with above html code 
2. horizontally shrink browser window, until window is too narrow to contain
   desired text.  
3. grab horizontal scrollbar and drag it rightward.

  
Actual Results:  
in 2, above, text is shown outside bounds of its enclosing <div> (in the
      narrow white margin on the extreme right side of the browser window).

in 3, above, exposed area of <div> isn't drawn with div's background colour,
      so now more of the <pre> text appears to be outside its enclosing
      <div>


Expected Results:  
1. there shouldn't be that white margin on the right side of the div block
   when the window is too small - the div should go right the way to the
   end

2. text inside a div shouldn't be drawn outside it

3. the div background should be correctly drawn when it's exposed, as 
   described above.
(Reporter)

Comment 1

16 years ago
Created attachment 118247 [details]
view before resize
(Reporter)

Comment 2

16 years ago
Created attachment 118248 [details]
view after resize
(Reporter)

Comment 3

16 years ago
Created attachment 118249 [details]
view after horizontal scroll
(Reporter)

Comment 4

16 years ago
correction - the <pre> is irrelevant - this happens even without it,
on pages like:

<div style="background: #ff9999">
    1234567890123456789012345678901234567890123456789012345678901234567890     
</div>

If I were a betting man, I'd guess that the code which calculates the
right extend of the div's background block is mistakenly using the width
of the window (minus the margin size) rather than the width of the page
(minus the margin size).  Comparable implementations of CSS1 (Opera7, IE6)
don't show the right margin in the window-too-small case - their divs
go right the way to the very righthand edge of the window.

Comment 5

16 years ago
This reminds me a bit of bug 152273
Duplicate of invalid bug.  Our behavior is correct.

*** This bug has been marked as a duplicate of 3701 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.