Closed Bug 690164 Opened 13 years ago Closed 13 years ago

white space between hidden elements causes line break in list item elements

Categories

(Core :: Layout, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: mozilla, Assigned: ehsan.akhgari)

References

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.4 (KHTML, like Gecko) Chrome/16.0.889.0 Safari/535.4

Steps to reproduce:

Created a list item which had 2 hidden elements as it's first children and a block level element as it's third as follows:

<li>
    <div style="display:none">Div 1</div>
    <div style="display:none">Div 2</div>
    <div>Div 3</div>
</li>


Actual results:

The list item had an extra blank line before the non-hidden div was displayed


Expected results:

The list item should have had just 1 line containing the non-hidden div
Attached file examples
Did a bit more investigating, this happens on any element that has display:list-item, and the extra line only appears if there is white space between the two hidden elements and only if the hidden elements are the first two children of the list element. Attached are some examples.
Comment on attachment 563246 [details]
examples

><!DOCTYPE html>
><html>
><head>
><title>Examples</title>
></head>
>
><body>
>
><p>List item with white space between first 2 hidden elements (extra line break is added)</p>
>
><ul>
><li>
>  <div style="display:none;">test</div>
>  <div style="display:none;">test</div>
>  <div>test</div>
></li>
></ul>
>
><p>List item with no white space between hidden elements (no extra line break added)</p>
>
><ul>
><li>
>  <div style="display:none;">test</div><div style="display:none;">test</div>
>  <div>test</div>
></li>
></ul>
>
><p>div with display:list-item and white space between first 2 hidden elements (extra line break is added)</p>
>
><div style="display:list-item;border:1px solid #000000;">
>	<div style="display:none;">test</div>
>	<div style="display:none;">test</div>
>	<div>test</div>
></div>
>
><p>div with display:list-item and no white space between first 2 hidden elements (no extra line break added)</p>
>
><div style="display:list-item;border:1px solid #000000;">
>	<div style="display:none;">test</div><div style="display:none;">test</div>
>	<div>test</div>
></div>
>
></body>
></html>
>
Attachment #563246 - Attachment mime type: text/plain → text/html
Confirmed in Fx7, works with Fx3.6
Component: General → Layout
Keywords: regression
QA Contact: general → layout
regression window'cached m-c horly),

http://hg.mozilla.org/mozilla-central/rev/c0dbdafa583c
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101104 Firefox/4.0b8pre ID:20101104134944
Fails:
http://hg.mozilla.org/mozilla-central/rev/52a6a18eeb61
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101104 Firefox/4.0b8pre ID:20101104165457
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=c0dbdafa583c&tochange=52a6a18eeb61
Triggered by:
Bug 389321 - Caret invisible or at wrong place with empty contenteditable nodes
Blocks: 389321
Status: UNCONFIRMED → NEW
Ever confirmed: true
This is bad!  I'll investigate.
Assignee: nobody → ehsan
this is the same problem as bug 713856, but the test case is interesting, so I'll add one for it.
Attached patch TestcaseSplinter Review
Attachment #584985 - Flags: review?(roc)
Target Milestone: --- → mozilla12
https://hg.mozilla.org/mozilla-central/rev/de0a0865d0e9
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: