Closed Bug 273946 Opened 20 years ago Closed 20 years ago

spacing improperly rendered on spreadfirefox.com - top margin ignored

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: ivan.icin, Assigned: roc)

References

()

Details

(Keywords: regression, testcase)

Attachments

(6 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a6) Gecko/20041209 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a6) Gecko/20041209 Firefox/1.0+

The spacing between top box and log-in box does not exist in trunk build,
although it exists in 1.0 (and other browsers).

Reproducible: Always
Steps to Reproduce:
1. go to spreadfirefox.com
2. see the spacing between these two boxes
3.




I think I saw this on some more pages with less complicated CSS, but I didn't
write them down. I'll try to report on them later.
Assignee: parser → nobody
Component: HTML: Parser → Layout
QA Contact: mrbkap → core.layout
I don't see the bug in:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041125 7:07 am
I can see the bug in:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041125
Firefox/0.9.1+ 10:19am

This must be a regression from the fix of bug 209694.
Blocks: 209694
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression, testcase
Blocks: 274249
Attached file Testcase 2 - Quirk
Slightly different case, here is the margin-top ignored from the body element.
Flags: blocking1.8a6?
Simple workaround is to set height or min-height for element with margins.
wasn't that a reason why everybody bitched about IE, the lack of a good css
rendering engine. If we start thinking of not patching and creating workarounds
for a CSS property as basic as margin-top that is not working right, won't we
get as bad as IE ?? 
I'm not sure whether the behavior is incorrect according to CSS.  The
interaction of margin collapsing and floats is very complicated, and I'd rather
have Hixie or roc evaluate it.
We can enter in the complexity of words and papers, or we can try to deal with
the obvious

a) The gecko engine never ignored the margin-top value in that kind of scenario
before. We are speaking of all the 0.x and 1.x releases, up to 1.8alpha;

b) Opera, Safari, internet explorer (might not be the best browser to refer to,
but it goes along the point I want to make) and other browsers aren't ignoring
this margin-top value.

just switching behavior on 'words interpretation' when on the other hand you
shipped so many versions of gecko before with the old behavior and that many
other browsers act the same way seems to me a bit ... odd.

I'm all for standards and sticking to official specs etc.etc. but not really on
breaking, for an unclear specification in the guideline or various stretched
interpretations, something that worked for so long in your own rendering engine
+ other 'respectable' browser (that statement now excludes IE ;) )

That being said, I never read the whole CSS 2.1 reference document; the behavior
might be crystal clear and worth applying in the gecko engine.
Flags: blocking-aviary1.1?
OS: Windows XP → All
Hardware: PC → All
Summary: spacing improperly rendered on spreadfirefox.com → spacing improperly rendered on spreadfirefox.com - top margin ignored
Both testcases are in quirks mode. I'll need a standards-mode testcase before I
can make a definite assessment. I'll have a moment in a few days to work on this.
Attachment #168355 - Attachment description: Testcase → Testcase 1 - Quirk
Attached file Testcase 1 - Std. mode
Attachment #168911 - Attachment description: Testcase2 → Testcase2 - Quirk mode
Attached file Testcase 2 - Std. mode
Attachment #168911 - Attachment description: Testcase2 - Quirk mode → Testcase 2 - Quirk
Yes, those testcases IMHO show bugs.
too late for 1.8a6. blocking-
Flags: blocking1.8a6? → blocking1.8a6-
Flags: blocking1.8b?
This bug is causing many many websites on internet (including spreadfirefox,
apple and more) to look very different from what they used to look.

I tracked down the date on which it started to occur and that december 3 2004.
On  december 2 everything was fine.

it looks like december 2 was a bad day. This is the second major/blocking bug I
found that started on builds the day after. What happened, sabotage?
re: comment #13.  Perhaps it has been lost amongst the other comments on this
bug, but it has already been determined that this is a regression caused by the
checkin for bug 209694, so don't waste a lot of time trying to isolate a
regression window.
Assignee: nobody → roc
Component: Layout → Layout: Block and Inline
The relevant language is:
> If the top and bottom margins of a box are adjoining, then it is possible for
> margins to collapse through it. In this case, the position of the element
> depends on its relationship with the other elements whose margins are being
> collapsed.
>
>     * If the element's margins are collapsed with its parent's top margin, the
> top border edge of the box is defined to be the same as the parent's.
>     * Otherwise, either the element's parent is not taking part in the margin
> collapsing, or only the parent's bottom margin is involved. The position of
> the element's top border edge is the same as it would have been if the element
> had a non-zero top border.

I agree that the first testcase shows a bug; 'columns' is not collapsing its top
margin with its parent's top margin, so we should treat 'columns' as if it had a
non-zero top border and not collapse through it.

However, I believe our rendering of the second testcase is correct. In this
testcase, BODY's top and bottom margins are adjoining so we invoke the above
paragraph. BODY's margins collapse with its parent's top margin, so we place the
top border-edge of BODY at the top border-edge of HTML, i.e., the top of the
viewport. The float is then also placed at the top of the viewport. Ian, correct
me if I'm wrong :-).
Oh, never mind. Our rendering of the second testcase is indeed incorrect, because:

> # Margins of the root element's box do not collapse.

That will actually make this easier to fix :-).
Attached patch fixSplinter Review
It turns out that we don't really have to reset the y-coordinate of empty
blocks. If the empty block's top margin is collapsing with its parent's top
margin, then it will already be positioned in the right place.

We do have to fix nsBlockFrame::ShouldApplyTopMargin so that empty blocks with
clearance stop subsequent lines' top margins from collapsing with the parent.
We also want to collapse top and bottom margins for an empty block even if it
has clearance.
Attachment #172482 - Flags: superreview?(dbaron)
Attachment #172482 - Flags: review?(dbaron)
Attachment #172482 - Flags: superreview?(dbaron)
Attachment #172482 - Flags: superreview+
Attachment #172482 - Flags: review?(dbaron)
Attachment #172482 - Flags: review+
checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Attached file Testcase #3
Robert, could you take a look at this testcase please.

The computed height of the outermost DIV is 200px - shouldn't it be 100px
and the float overflowing its lower border?
(the testcase comes from bug 274249 if you'll rather handle it there)
Flags: blocking1.8b?
Flags: blocking-aviary1.1?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: