Last Comment Bug 5119 - [quirk.css]DD not in DL should have text-indent, not margin
: [quirk.css]DD not in DL should have text-indent, not margin
Status: RESOLVED FIXED
[bae:20011011]
: regression, testcase
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
: P5 trivial (vote)
: Future
Assigned To: Nobody; OK to take it and work on it
:
: Jet Villegas (:jet)
Mentors:
http://www.tronster.com/music.html
: 93980 115355 166558 (view as bug list)
Depends on:
Blocks: 56362 6625 104166
  Show dependency treegraph
 
Reported: 1999-04-15 04:56 PDT by tronster321
Modified: 2012-08-22 03:19 PDT (History)
14 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Examples of the coding style, with and without the DL element. (1.13 KB, text/html)
1999-06-29 02:16 PDT, Nicholas Cull
no flags Details
patch (940 bytes, patch)
2000-09-01 12:35 PDT, David Baron :dbaron: ⌚️UTC-10
no flags Details | Diff | Splinter Review
new "examples" (1.18 KB, text/html)
2000-11-05 16:30 PST, fantasai
no flags Details
modified quirk.css (4.19 KB, text/css)
2000-11-15 19:41 PST, fantasai
no flags Details
Expanded testcase (4.16 KB, text/html)
2000-11-16 14:20 PST, fantasai
no flags Details
quirk.css rules (460 bytes, text/plain)
2001-02-20 13:59 PST, fantasai
no flags Details
quirk.css rules, validated (458 bytes, text/plain)
2001-03-17 07:12 PST, fantasai
no flags Details

Description tronster321 1999-04-15 04:56:46 PDT
For the above URL, in Netscape 4.x and IE 4 the DD tag will give the
appearance of a paragraph with the first line tabbed.  In the 1/9/99 developers
release, when viewing the page, the DD tags make the first word in each
paragraph appear tabbed but then two newlines are "added" before the next line
of text is displayed on the screen.

End Of Line.
Comment 1 troy 1999-04-15 08:24:59 PDT
Rick, I think this is a DUP. It's a problem with content not nesting inside the
DD tag like it should
Comment 2 rickg 1999-04-26 00:14:59 PDT
Kipp: This is one yours. The DD tags aren't the problem. First, the <DD> is not
wrapped in a <DL>, so we don't get the "indent". I think you need to address
that. Second, if we *do* wrap the <DD> in a <DL>, then we get extra unwanted
vertical whitespace. Note that I do have another <DD> bugfix that may or may not
be checked in by the time you see this, but it's unrelated.

Here's a simple test case:

<HTML>
<BODY>
  <table width=600 border=1>
    <tr>
      <td>
        <dl>
          <dd>This</dd> page contains an archive of songs created by me, Todd
Hartley (aka Tronster).<br>
          <dd>To </dd> download the songs, click on the link to the file type
you support under the "format" column.
        </dl>
      </td>
    </tr>
  </table>
</BODY>
</HTML>
Comment 3 David Baron :dbaron: ⌚️UTC-10 1999-06-07 09:05:59 PDT
This could probably be done in a way similar to LIs not in ULs.  See bug 1049.
Comment 4 Nicholas Cull 1999-06-29 02:16:59 PDT
Created attachment 591 [details]
Examples of the coding style, with and without the DL element.
Comment 5 kipp 1999-09-16 20:45:59 PDT
Navigators behavior of ignoring (entirely!) is a serious bug. The only real way
to handle this is in the parser - rick/harish: maybe the thing to do is when
processing a /DD tag in quirks mode is to discard it and then let your fixup
logic repair the resulting (occasional) damage.

There is really nothing I can do here in layout land.
Comment 6 rickg 1999-12-21 13:37:59 PST
Fixed by improvements to elementtable.
Comment 7 Chris Petersen 2000-01-31 16:21:54 PST
This problem is still occurs in the latest build. The text after the </dd> should 
not break and start a new line. After talking with Rick, I will change component 
to Layout.
Comment 8 rickg 2000-02-06 22:24:40 PST
The content model is now correct; and layout is goofy. Reassigning to block-boy.
Comment 9 buster 2000-06-05 11:28:36 PDT
This is a pretty major layout error.  Makes <DD> unusable.
Comment 10 Blake Ross 2000-06-05 19:03:35 PDT
adding testcase kw
Comment 11 ekrock's old account (dead) 2000-06-12 13:55:48 PDT
Nom. nsbeta2, recc. nsbeta2+ [some lenient date-], falling through to nsbeta3 
hard stop if not fixed during nsbeta2. b.c. with html32 DD element. Per 
comments, our support for DD is currently broken. Must fix before rtm.
Comment 12 Peter Trudelle 2000-06-13 13:48:35 PDT
nsbeta2+ until 6/15
Comment 13 buster 2000-06-16 15:10:01 PDT
I looked at this a little bit.  It will be very hard to fix. The problem is the 
behavior is contextual in a way that cannot be expressed in CSS.  So html.css 
needs to describe the basic behavior, and the frame constructor code will have 
to do some wampum juju to cover the other cases.  Suggest nsbeta3.
Comment 14 Jim Roskind 2000-06-17 12:44:36 PDT
Cleaning up status whiteboard by marking beta2 minus (6/15 has passed)

This is also what buster (on sabbatical above) just suggested.
Comment 15 David Baron :dbaron: ⌚️UTC-10 2000-07-03 16:54:25 PDT
I think this *can* be fixed purely in CSS, although it's a bit complicated and 
should be in quirks.css only.  I'm assigning it to myself to work out the 
correct fix.
Comment 16 David Baron :dbaron: ⌚️UTC-10 2000-07-21 11:48:20 PDT
I think this would be fixed by adding the following rules to quirks.css:

dd {
  text-indent: <some value>;
  margin-left: 0;
}

dl > dd {
  text-indent: 0;
  margin-left: 40px;
}
Comment 17 David Baron :dbaron: ⌚️UTC-10 2000-07-21 11:56:54 PDT
I think the following is the correct patch.  Do you think it's worth having the
2d and 4th added rules?

Index: quirk.css
===================================================================
RCS file: /cvsroot/mozilla/layout/html/document/src/quirk.css,v
retrieving revision 1.2
diff -u -d -r1.2 quirk.css
--- quirk.css	2000/06/11 22:48:05	1.2
+++ quirk.css	2000/07/21 18:54:16
@@ -58,6 +58,26 @@
   list-style-position: inherit;
 }
 
+/* Quirk: DD not in DL has text-indent instead of margin (bug 5119) */
+
+dd {
+  text-indent: 40px;
+  margin: 0;
+}
+
+dd > * {
+  text-indent: 0;
+}
+
+dl > dd {
+  text-indent: inherit;
+  margin: 40px;
+}
+
+dl > dd > * {
+  text-indent: inherit;
+}
+
 /* Ensure that we get proper padding if the very first node
    beneath an <li> is another <ul>. This is an ugly way to
    fix the problem, because it extends the <li> up into
Comment 18 David Baron :dbaron: ⌚️UTC-10 2000-07-21 11:58:48 PDT
Note that there are currently no other UA-level declarations of text-indent, but
if there were, the 2d and 4th rules would mess them up.
Comment 19 David Baron :dbaron: ⌚️UTC-10 2000-08-31 07:17:10 PDT
Ian - assigning this to you since it's quirk.css.  Patch that should fix it is
in the bug.
Comment 20 Hixie (not reading bugmail) 2000-08-31 14:38:16 PDT
Thanks David.

Seems like a bit of a violent fix, but since it is quirks-only, fine. Did you
test the fix with different font sizes to work out if the indent was 40 pixels
or in ems in legacy browsers?
Comment 21 David Baron :dbaron: ⌚️UTC-10 2000-08-31 14:46:57 PDT
No, I didn't test, but apparently everything else is 40px.  Do a quick test if
you want...
Comment 22 David Baron :dbaron: ⌚️UTC-10 2000-09-01 12:35:11 PDT
Created attachment 13884 [details] [diff] [review]
patch
Comment 23 buster 2000-09-01 23:35:07 PDT
r=buster.  thanks for handling this one.
Comment 24 Hixie (not reading bugmail) 2000-09-01 23:50:09 PDT
Will do this as part of the big ua.css changes next week.
Comment 25 Hixie (not reading bugmail) 2000-09-14 06:04:05 PDT
I assume that the "margin: 40px" bit should read "margin-left: 40px".

That is what I have put in my quirk.css file.
Comment 26 Phil Peterson 2000-09-19 17:00:11 PDT
PDT thinks this is a P2 at best, pretty close to P3 since it's a longstanding
bug in all our clients.
Comment 27 Blake Ross 2000-09-21 20:10:01 PDT
Ian: fixed with *.css checkin, right?
Comment 28 Hixie (not reading bugmail) 2000-09-21 22:19:04 PDT
FIXED by updating quirk.css.
Comment 29 Chris Petersen 2000-09-29 16:49:57 PDT
Ian,

Not sure from looking at the test cases provided, how to verify this ?
Comment 30 Hixie (not reading bugmail) 2000-10-05 15:20:13 PDT
Compare the two test cases with legacy browsers. They should be the same in
theory.
Comment 31 Chris Petersen 2000-10-24 13:58:26 PDT
Netscape 4.7 and Netscape 6 both rendered the test files different as described 
in the original summary.

Netscape 6:
 First word is indented the remaining paragraph is rendered below.

Netscape 4.7:
 Entire paragraph is indented.
Comment 32 Chris Petersen 2000-10-24 13:59:17 PDT
Reopening
Comment 33 fantasai 2000-11-05 16:07:39 PST
The "valid" par of the testcase (with enclosing <dl>) is invalid; the <dd> is 
closed before the end of its content. Since this bug isn't about handling 
prematurely closed <dd>s, I'm attaching a new testcase with that part fixed.

Here's a fix for the bug itself:
In "quirk.css":

/* Quirk: DD not in DL has text-indent instead of margin (b=5119) */

-dd {
-  text-indent: 40px;
-  margin: 0;
-}
-
-dd > * {
-  text-indent: 0;
-}
-
-dl > dd {
-  text-indent: inherit;
-  margin-left: 40px;
-}
-dl > dd > * {
-  text-indent: inherit;
-}

+dd {
+  display: inline;
+  margin-left: 40px;
+}
+dl > dd {
+  display: block;
+  margin-left: 40px;
+}

Tested in Mozilla nightly build id: 2000100308
Comment 34 fantasai 2000-11-05 16:30:09 PST
Created attachment 18765 [details]
new "examples"
Comment 35 Hixie (not reading bugmail) 2000-11-15 18:22:02 PST
That won't work, what if you have:

   <dd> one </dd>
   this is some text.
   <dd> two </dd>
   this is some text.

i.e., remove the <br>s from the testcase.
Comment 36 fantasai 2000-11-15 19:34:52 PST
Yes, I realized that later..

There's a give and take here; you can't support every broken coding. From what
I see, you either have to give up handling
  - </dd> in the middle of the visual "block" (use David Baron's "fix")
  - <dd> without a preceding line break of some kind (use the "fix" above)
  - empty <dd>s (I've got a really messy CSS hack to do this)

I'll attach a modified quirk.css demonstrating the last one.

Probably the last one gives the "safest" output. IE5 can't handle empty <dd>s 
either.

It depends on whether or not you're willing to swallow that code. =)
(I ought to attach an expanded testcase...)
Comment 37 fantasai 2000-11-15 19:41:58 PST
Created attachment 19300 [details]
modified quirk.css
Comment 38 fantasai 2000-11-16 14:20:19 PST
Created attachment 19352 [details]
Expanded testcase
Comment 39 fantasai 2000-11-16 14:28:07 PST
Ran the testcase through Mozilla build 2000100308 with modified quirk.css; 
results identical to Nav4.x

I forgot to close the <h2> on the second set in the testcase. Sorry~
Comment 40 gerardok 2000-12-28 12:17:39 PST
This bug was marked to be fixed in a previous milestone but it didn't get fixed 
properly. Nominated for beta1.
Comment 41 Oliver Klee 2001-02-20 10:16:34 PST
Milestone 0.8 has been released. We should either resolve this bug or update its
milestone.
Comment 42 Marc Attinasi 2001-02-20 10:47:18 PST
fantasai, do we want to take this modified quirk.css patch? BTW: very creative ;)
Comment 43 fantasai 2001-02-20 13:59:13 PST
Created attachment 25727 [details]
quirk.css rules
Comment 44 Hixie (not reading bugmail) 2001-02-20 14:08:01 PST
For the record: This had better stay very firmly inside quirk.css. ;-)
Comment 45 fantasai 2001-02-20 14:21:58 PST
> fantasai, do we want to take this modified quirk.css patch? 

Nope, you'd want the rules I just attached. (I forgot to set 'font: inherit' for 
proper <dd>s)

> BTW: very creative ;)

Thanks!
Comment 46 Marc Attinasi 2001-02-20 15:35:52 PST
Ian, can you review the patch? If you like it, I'll take it to the tree...
Comment 47 Hixie (not reading bugmail) 2001-02-22 18:05:04 PST
Well, Moz with this patch and IE display all the testcases differently, so I
guess it doesn't pass review... But it's better than what we have now, and it's
a quirk so I'm not particularly worried either way, so r=hixie.
Comment 48 Marc Attinasi 2001-03-02 12:11:08 PST
Taking bug to checkin the patch - thanks Fantasai!
Comment 49 Marc Attinasi 2001-03-02 12:15:05 PST
Have Patch, will checkin.
Comment 50 David Baron :dbaron: ⌚️UTC-10 2001-03-02 12:52:04 PST
I'm curious -- why all the dt:before hackery rather than just the same
margin-left on the inline dd as the block?
Comment 51 fantasai 2001-03-02 16:32:18 PST
>thanks Fantasai!

My pleasure.

> I'm curious -- why all the dt:before hackery rather than just the same
> margin-left on the inline dd as the block?

Because the ::before psuedo-element creates a box *inside* the <dd>;
you'd get margin space before the line break instead of after it.
I tried that at first--didn't work. ^^
Comment 52 Mike Shaver (:shaver -- probably not reading bugmail closely) 2001-03-12 09:58:16 PST
sr=shaver.  Can it get in the tree?
Comment 53 Marc Attinasi 2001-03-12 10:05:25 PST
YEs - in fact, I meant to check it in over the weekedn but I was distracted by a
regression... It will go in very, very soon.
Comment 54 Marc Attinasi 2001-03-12 16:17:00 PST
Fantasai's change was checked in. Thanks! (quirk.css ver. 1.14)
Comment 55 David Baron :dbaron: ⌚️UTC-10 2001-03-16 20:27:04 PST
'none' isn't a valid value for the 'content' property.  'content: none' should
be changed to 'content: ""'.
Comment 56 fantasai 2001-03-17 07:12:28 PST
Created attachment 27995 [details]
quirk.css rules, validated
Comment 57 Hixie (not reading bugmail) 2001-06-22 07:45:02 PDT
well, we're not identical to IE, but whatever... :-) VERIFIED
Comment 58 Mats Palmgren (:mats) 2001-08-06 19:47:43 PDT
Indentation of DD outside of DL no longer works.
Comment 59 Mats Palmgren (:mats) 2001-08-06 20:52:05 PDT
Forgot to mention the Build ID: 2001-08-06-03 on Windows 98 SE. I have poked
around in quirk.css and found that it is this rule that is not working as it
used to:

:not(dl) > dd:before {
  display: inline;
  white-space: pre;
  font-size: 1px;
  line-height: 0;
  content: "\A  ";
  margin-right: 40px;
}

It seems that "font-size: 1px" is the cause of the problem - if I change it to
"font-size: 2px" (or higher, or remove it) it works again.
Comment 60 Mats Palmgren (:mats) 2001-08-06 20:55:08 PDT
*** Bug 93980 has been marked as a duplicate of this bug. ***
Comment 61 fantasai 2001-09-09 13:27:23 PDT
Are you still seeing this problem? It seems to work on 2001082803 (Win2K).
Comment 62 Mats Palmgren (:mats) 2001-09-14 17:07:59 PDT
I still see this problem, 2001-09-14-03 on Windows 98 SE.
My comment on 2001-08-06 20:52 is still valid.
Comment 63 rubydoo123 2001-09-21 11:50:02 PDT
Why is this a valid bug? In the example that Rick gave (From rickg@netscape.com 
1999-04-26 00:14), he has pcdata within the DL -- that is illegal. The only 
content allowed within the DL container element is a DD or a DT. 

Why are we spinning our wheels for invalid html?
Comment 64 rubydoo123 2001-10-11 17:17:35 PDT
since this deals with invalid markup, I am going to mark this bug as invalid, if 
there are issues about that, please let me know.
Comment 65 David Baron :dbaron: ⌚️UTC-10 2001-10-11 17:27:59 PDT
Reopening.  This is a bug in our implementation of a quirk.  If you don't care
about invalid markup, then you should instead file a bug that we remove the
quirk entirely, but if we have it it ought to be right.
Comment 66 rubydoo123 2001-10-12 10:42:51 PDT
The only requirement is that the text be rendered, which it is. Is the bottom 
line issue here that we do not render it like IE? If that is the case, then this 
is P5/Futured for Marc or can be reassigned to someone else who has the cycles 
to pick it up.
Comment 67 Christopher Hoess (gone) 2001-10-17 18:47:42 PDT
How is this bug affected by the resolution of bug 102370?
Comment 68 Christopher Aillon (sabbatical, not receiving bugmail) 2001-12-14 17:53:38 PST
*** Bug 115355 has been marked as a duplicate of this bug. ***
Comment 69 rubydoo123 2002-03-08 11:58:51 PST
removing myself from the cc list
Comment 70 Daniel Wang 2003-03-26 19:19:42 PST
*** Bug 166558 has been marked as a duplicate of this bug. ***
Comment 71 Mats Palmgren (:mats) 2003-07-07 10:46:32 PDT
FWIW, the current quirk does not work for dir=RTL pages.
(It does seem to work for LTR again though).
Comment 72 David Baron :dbaron: ⌚️UTC-10 2003-08-02 13:34:27 PDT
->style
Comment 73 Anne (:annevk) 2004-03-06 02:53:53 PST
FIXED/WFM?
Comment 74 Anne (:annevk) 2004-09-20 08:30:18 PDT
Again, what is the status on this bug?
Comment 75 :Ms2ger (⌚ UTC+1/+2) 2010-06-13 09:56:04 PDT
INVALID per HTML5. <http://www.whatwg.org/html/#margins-and-padding>
Comment 76 David Baron :dbaron: ⌚️UTC-10 2010-06-13 11:32:39 PDT
FIXED is a better resolution, since this bug was in fact fixed (comment 54 / comment 57), and then reopened for some other problem (comment 58 / comment 59).

But if you're citing HTML5, why aren't you filing a bug that we should remove the quirk entirely?  Would that match other browsers, or not?

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