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

RESOLVED FIXED in mozilla12

Status

()

Core
Layout
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Pete Newnham, Assigned: Ehsan)

Tracking

({regression})

unspecified
mozilla12
x86_64
Windows 7
regression
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
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
(Reporter)

Comment 1

6 years ago
Created attachment 563246 [details]
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.
(Reporter)

Comment 2

6 years ago
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

Comment 3

6 years ago
Confirmed in Fx7, works with Fx3.6
Component: General → Layout
Keywords: regression
QA Contact: general → layout

Comment 4

6 years ago
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.
Created attachment 584985 [details] [diff] [review]
Testcase
Attachment #584985 - Flags: review?(roc)
Attachment #584985 - Flags: review?(roc) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/de0a0865d0e9
Flags: in-testsuite+
Target Milestone: --- → mozilla12
https://hg.mozilla.org/mozilla-central/rev/de0a0865d0e9
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.