Closed Bug 172816 Opened 23 years ago Closed 23 years ago

Illegal empty <span> changes layout on clicking button

Categories

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

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: harunaga, Assigned: dbaron)

References

()

Details

(Keywords: testcase, Whiteboard: [patch])

Attachments

(1 file)

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...
Attachment #101864 - Attachment description: simpler testcaes → simpler testcase
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.
Component: Layout → Layout: Block & Inline
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
Closed: 23 years ago
Depends on: 44242
Resolution: --- → FIXED
*** Bug 183062 has been marked as a duplicate of this bug. ***
v
Status: RESOLVED → VERIFIED
Keywords: testcase
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: