Illegal empty <span> changes layout on clicking button

VERIFIED FIXED

Status

()

VERIFIED FIXED
16 years ago
16 years ago

People

(Reporter: harunaga, Assigned: dbaron)

Tracking

({testcase})

Trunk
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [patch], URL)

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
Illegal empty <span></span> which is just before <form> in strict
document changes layout when you click button.

Steps:
1. Load URL above.
2. Click the button.

Actulal:
The contents after the illegal <span> shift upward.

Expected:
Layout should not be changed.

Confirming with 2002100208-trunk/FreeBSD and 2002100308-trunk/MacOS
9.2.
At a guess, what's happening here is that margins collapse in the incremental
reflow but not in the initial reflow...
I wrote IsEmpty while assuming that we gave empty inlines size in standards
mode.  We don't seem to.  The patch would be trivial, but is it correct?  Ian?
Assignee: attinasi → dbaron
Status: UNCONFIRMED → NEW
Ever confirmed: true
(The patch would be to remove the first 4 lines of nsInlineFrame::IsEmpty, I think.)
If the question is "do we want the 3em margin", the answer is yes, because the
anonymous block around the inline has 0 top margin, which collapses with the 3em
bottom margin on the block, leaving a 3em gap.
But why does the span not give the block the height of the normal 'line-height'
and thus make it non-empty?
The following markup:

  <div style="margin-bottom: 3em;">Test</div>
  <div style="display: inline"></div>
  <div><input type="button" value="Click here"></div>

...becomes:

  <block>
   <block> <inline> Test </inline> </block>       | block has 3em bottom margin
   <block> <inline> </inline> </block>            | empty inline
   <block> <inline> <input/> </inline> </block>   | replaced inline element
  </block>

...which should render as, including construction lines:

  .-------------------------------.
  | .---------------------------. |
  | | Test                      | |   the block
  | `---------------------------' |
  |                               |
  |                               |   3em of margin
  |                               |
  | .                             |
  | |                             |   the empty inline
  | '                             |
  | .---------------------------. |
  | | [Click Here]              | |   the second block
  | `---------------------------' |
  `-------------------------------'

So, from the block to the inline, you get a 3em gap.
(Reporter)

Comment 8

16 years ago
2002112608 has this problem, but 2002120103 doesn't.
fixed by Bug 44242?
Yes, I fixed nsInlineFrame::IsEmpty as part of bug 44242.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Depends on: 44242
Resolution: --- → FIXED

Comment 11

16 years ago
v
Status: RESOLVED → VERIFIED
Keywords: testcase
You need to log in before you can comment on or make changes to this bug.