Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 209066 - [FIX] incremental reflow goes wrong when block has spaces around it
: [FIX] incremental reflow goes wrong when block has spaces around it
: css1, testcase
Product: Core
Classification: Components
Component: Layout: Block and Inline (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Mats Palmgren (:mats)
: Hixie (not reading bugmail)
: Jet Villegas (:jet)
: 214394 (view as bug list)
Depends on:
Blocks: 38370
  Show dependency treegraph
Reported: 2003-06-11 10:43 PDT by Hixie (not reading bugmail)
Modified: 2003-09-05 21:02 PDT (History)
8 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

dynamic testcase showing the correct behaviour (625 bytes, text/html)
2003-06-11 12:00 PDT, Bernd
no flags Details
reflow log (6.28 KB, text/plain)
2003-06-11 12:02 PDT, Bernd
no flags Details
simpler testcase (425 bytes, text/html; charset=iso-8859-1)
2003-06-11 13:43 PDT, David Baron :dbaron: ⌚️UTC-7
no flags Details
This may also be this same bug.... (258 bytes, text/html)
2003-07-30 00:43 PDT, Boris Zbarsky [:bz] (still a bit busy)
no flags Details
Patch rev. 1 (2.36 KB, patch)
2003-08-18 09:43 PDT, Mats Palmgren (:mats)
dbaron: review+
dbaron: superreview+
asa: approval1.5+
Details | Diff | Splinter Review
Patch rev. 1 (diff -uw for easier review) (1.10 KB, patch)
2003-08-18 09:45 PDT, Mats Palmgren (:mats)
no flags Details | Diff | Splinter Review
Screenshot of 1st testcase in bug 119606 (with the patch applied) (14.95 KB, image/png)
2003-09-03 15:51 PDT, Mats Palmgren (:mats)
no flags Details

Description Hixie (not reading bugmail) 2003-06-11 10:43:44 PDT
  div { border: 1px solid; width: 25em; margin: 2em auto; }
  <table><tr><td><div></div><td valign="bottom"> <div></div> </td></tr></table>

  The spaces around the <div> in the second cell are required to show the bug.

  Two adjacent lines.

  The second line is first drawn too high. A reflow (font zoom change, e.g.) 
  will move the second line down.
Comment 1 Bernd 2003-06-11 12:00:51 PDT
Created attachment 125435 [details]
dynamic testcase showing the correct behaviour
Comment 2 Bernd 2003-06-11 12:02:59 PDT
Created attachment 125437 [details]
reflow log
Comment 3 Bernd 2003-06-11 12:08:12 PDT
the second (resize) reflow
         cell 0266F168 r=2 a=6060,UC c=6030,UC cnt=878 
          block 0266F23C r=2 a=6030,UC c=6030,UC cnt=879 
           text 0266F2E8 r=2 a=6030,UC c=UC,UC cnt=880 
           text 0266F2E8 d=0,0 
           block 0266F39C r=2 a=6030,UC c=6000,UC cnt=881 
           block 0266F39C d=6030,30 
          block 0266F23C d=6030,1470 
         cell 0266F168 d=6060,1500 

and the style change reflow 
         cell 0266F168 r=3 a=6060,UC c=6030,UC cnt=907 
          block 0266F23C r=3 a=6030,UC c=6030,UC cnt=908 
           text 0266F2E8 r=3 a=UC,UC c=UC,UC cnt=909 
           text 0266F2E8 d=0,0 me=0 
           text 0266F2E8 r=3 a=6030,UC c=UC,UC cnt=910 
           text 0266F2E8 d=0,0 
           block 0266F39C r=3 a=6030,UC c=6000,UC cnt=911 
           block 0266F39C d=6030,30 me=6030 m=15 
           text 0266F3F0 r=3 a=UC,UC c=UC,UC cnt=912 
           text 0266F3F0 d=0,0 me=0 
           text 0266F3F0 r=3 a=6030,UC c=UC,UC cnt=913 
           text 0266F3F0 d=0,0 
          block 0266F23C d=6030,990 me=6030 m=15 
         cell 0266F168 d=6060,1020 me=6060 m=6060 

The block is reporting a too large height 1470 instead of 990 ( just a blind
guess 1470 = 990 + 990/2)
This is in my oppinion a block bug
Comment 4 David Baron :dbaron: ⌚️UTC-7 2003-06-11 13:22:37 PDT
This seems to be related to the 'auto' side margins.
Comment 5 David Baron :dbaron: ⌚️UTC-7 2003-06-11 13:43:28 PDT
Created attachment 125444 [details]
simpler testcase

Only one piece of whitespace (plus borders around the table cells).
Comment 6 Boris Zbarsky [:bz] (still a bit busy) 2003-07-30 00:21:16 PDT
*** Bug 214394 has been marked as a duplicate of this bug. ***
Comment 7 Boris Zbarsky [:bz] (still a bit busy) 2003-07-30 00:22:37 PDT
From bug 214394:

The rendering of the testcase changed between 2001-10-23-08 and 
2001-10-26-08.  Of the checkins in that range, the one for bug 86947 arouses the
most suspicion in me, followed by deCOMtamination of nsSpaceManager and
deCOMtamination of nsIFrame that hyatt landed...
Comment 8 Boris Zbarsky [:bz] (still a bit busy) 2003-07-30 00:43:31 PDT
Created attachment 128835 [details]
This may also be this same bug....

In this testcase, the bottom margin of the <div> is absent for some reason. 
Making the left/right margins not auto fixes it....
Comment 9 Adam D. Moss 2003-07-30 02:14:49 PDT
seen on linux, -> all/all
Comment 10 Mats Palmgren (:mats) 2003-08-17 15:49:21 PDT
FWIW, it seems this bug only occurs within tables.
Comment 11 Mats Palmgren (:mats) 2003-08-18 09:32:22 PDT
Taking this since it's unassigned and I have a fix...
Comment 12 Mats Palmgren (:mats) 2003-08-18 09:43:21 PDT
Created attachment 129993 [details] [diff] [review]
Patch rev. 1

The bug is in nsHTMLReflowState::ComputeMargin() - when the containing block
is NS_UNCONSTRAINEDSIZE we simply ignore any specified top/bottom margin and
set the computed value to zero.  I have just removed this bit and let
ComputeHorizontalValue() deal with it (since it can do that now).
Comment 13 Mats Palmgren (:mats) 2003-08-18 09:45:29 PDT
Created attachment 129994 [details] [diff] [review]
Patch rev. 1  (diff -uw for easier review)
Comment 14 Boris Zbarsky [:bz] (still a bit busy) 2003-08-26 08:39:44 PDT
Mats, are you confident enough in this fix to go for getting it into 1.5?  If 
so, please request approval?
Comment 15 Mats Palmgren (:mats) 2003-08-26 10:52:00 PDT
Comment on attachment 129993 [details] [diff] [review]
Patch rev. 1

I am very confident that this patch does the right thing.
Comment 16 Asa Dotzler [:asa] 2003-08-29 09:49:45 PDT
Comment on attachment 129993 [details] [diff] [review]
Patch rev. 1

1.5b shipped. moving request forward.
Comment 17 Asa Dotzler [:asa] 2003-09-03 13:17:07 PDT
Mats, is this likely to break backward compatibility or cause regressions out on
the web?
Comment 18 Mats Palmgren (:mats) 2003-09-03 15:24:57 PDT
No, it only occurs when left or right margin has the specified value 'auto' and
and a specified non-zero top or bottom margin (which we currently ignore).
This combination is rarely used by CSS authors.
(The initial margin value is zero)

It does affect <hr> though (after bug 38370 was fixed) since it now uses this
combination of margin values.  I think it's more likely that there will be
regressions from bug 38370 if this patch is NOT checked in.
Comment 19 Mats Palmgren (:mats) 2003-09-03 15:51:08 PDT
Created attachment 130871 [details]
Screenshot of 1st testcase in bug 119606 (with the patch applied)

Funny, I just stumbled into a regression from bug 38370.  See the first
testcase in bug 119606 and compare the last two columns with this screenshot.
Comment 20 David Baron :dbaron: ⌚️UTC-7 2003-09-03 17:16:51 PDT
I think we should get this in for 1.5.
Comment 21 Asa Dotzler [:asa] 2003-09-04 12:36:45 PDT
Comment on attachment 129993 [details] [diff] [review]
Patch rev. 1

a=asa (on behalf of drivers) for checkin to Mozilla 1.5
Comment 22 Mats Palmgren (:mats) 2003-09-05 16:55:43 PDT
David / Boris - could you check this in for me?  Thanks.
Comment 23 Boris Zbarsky [:bz] (still a bit busy) 2003-09-05 17:39:18 PDT
I have no CVS access till I get back.  biesi, could you do this if dbaron
doesn't get to it soon?
Comment 24 David Baron :dbaron: ⌚️UTC-7 2003-09-05 21:02:18 PDT
Fix checked in to trunk, 2003-09-05 21:01 -0700.

Note You need to log in before you can comment on or make changes to this bug.