Last Comment Bug 690164 - white space between hidden elements causes line break in list item elements
: white space between hidden elements causes line break in list item elements
Status: RESOLVED FIXED
: regression
Product: Core
Classification: Components
Component: Layout (show other bugs)
: unspecified
: x86_64 Windows 7
: -- normal (vote)
: mozilla12
Assigned To: :Ehsan Akhgari
:
:
Mentors:
Depends on:
Blocks: 389321
  Show dependency treegraph
 
Reported: 2011-09-28 16:57 PDT by Pete Newnham
Modified: 2011-12-31 19:35 PST (History)
6 users (show)
ehsan: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
examples (1.08 KB, text/html)
2011-09-28 17:05 PDT, Pete Newnham
no flags Details
Testcase (1.59 KB, patch)
2011-12-30 10:25 PST, :Ehsan Akhgari
roc: review+
Details | Diff | Splinter Review

Description Pete Newnham 2011-09-28 16:57:02 PDT
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
Comment 1 Pete Newnham 2011-09-28 17:05:36 PDT
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.
Comment 2 Pete Newnham 2011-09-28 17:06:40 PDT
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>
>
Comment 3 j.j. 2011-09-28 18:16:22 PDT
Confirmed in Fx7, works with Fx3.6
Comment 4 Alice0775 White 2011-09-28 19:34:58 PDT
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
Comment 5 :Ehsan Akhgari 2011-09-28 21:01:03 PDT
This is bad!  I'll investigate.
Comment 6 :Ehsan Akhgari 2011-12-30 10:21:07 PST
this is the same problem as bug 713856, but the test case is interesting, so I'll add one for it.
Comment 7 :Ehsan Akhgari 2011-12-30 10:25:37 PST
Created attachment 584985 [details] [diff] [review]
Testcase
Comment 9 Phil Ringnalda (:philor) 2011-12-31 19:35:27 PST
https://hg.mozilla.org/mozilla-central/rev/de0a0865d0e9

Note You need to log in before you can comment on or make changes to this bug.