If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

text-indent not included in MES computation




Layout: Tables
16 years ago
15 years ago


(Reporter: Josh Howard, Assigned: Bernd)


Dependency tree / graph

Firefox Tracking Flags

(Not tracked)




(2 attachments, 4 obsolete attachments)



16 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0rc1) Gecko/20020425
BuildID:    000000000

When viewing this page, I see that the "hostname" area wraps outside of the
table boundary and in to the next section. Also, just in general, the tables
seem ill-sized. When viewing this same page under Netscape 4.x, all text fits in
properly, so that there's no particular missized and each table is one character
high. This is using the same fonts I use for proportional and fixed as I would
on Netscape.

Reproducible: Always
Steps to Reproduce:
1. Simply view the page.

Actual Results:  Poor quality.

Expected Results:  The hostnames to fit within the table they're supposed to.

The page does verify with respect to w3.org's HTML and CSS specs, as the links
on the page claim. This page also looks as expected under a number of other
browsers, including Netscape 4.x, Opera 6, IE 5.
This is because of the following markup:

<p style="text-indent: 3em;">

The problem is that the <table> ends up being a child of the <p> (we have to do
this for backwards compatibility, because otherwise a huge number of sites
break).  However, text-indent is inherited.  So the table and all its cells
inherit the text-indent, leading to the rendering you see.

I _think_ that the table is a block for purposes of inheriting text-indent, but
not completely sure.... 

In any case, either closing your <p> before the table or setting text-indent to
0 on the table explicitly will fix the rendering....
Assignee: sgehani → karnaze
Component: XP Apps → HTMLTables
Ever confirmed: true
OS: FreeBSD → All
QA Contact: paw → amar
Hardware: PC → All

Comment 2

16 years ago
Closing up the paragraph did in fact make it look right... I do have to question
Mozilla's handling of that particular bit of layout, however. I wouldn't expect
to see text out of cells in such a dramatic fashion, and as far as I know, that
was perfectly legal HTML that should have been rendered differently than it was.
Is one supposed to see text coming out of the cell as it was? Even if it was
Created attachment 81355 [details]
The original testcase

> I wouldn't expect to see text out of cells in such a dramatic fashion

Well... You have a cell of fixed width.  You have a word with no spaces.  You
demand that the word be indented by 3em.  If 3em + length of word is greater
than your fixed width, the only options available are to overflow the cell or
to ignore the fixed width....  Tables usually err on the side of ignoring
widths; not sure why they did not in this case.

In any case, I suspect the correct thing to do is to not inherit the
text-indent into the table to start with.
Ian, your thoughts?
Keywords: qawanted
QA Contact: amar → ian

Comment 5

16 years ago
Created attachment 81402 [details]
reduced testcase

Comment 6

16 years ago
   block 00B75B74 r=1 a=9180,UC c=8940,UC cnt=904 
     text 00B75D60 r=0 a=8940,UC c=UC,UC cnt=905 
     text 00B75D60 d=0,0 
     tblO 00B75F58 r=0 a=8940,UC c=0,0 cnt=906 
      tbl 00B76154 r=0 a=8940,UC c=1395,UC cnt=907 
       rowG 00B72F88 r=0 a=UC,UC c=UC,UC cnt=908 
        row 00B76460 r=0 a=UC,UC c=UC,UC cnt=909 
         cell 00B76634 r=0 a=UC,UC c=UC,UC cnt=910 
          block 00B766F8 r=0 a=UC,UC c=UC,UC cnt=911 
           text 00B76838 r=0 a=UC,UC c=UC,UC cnt=912 
           text 00B76838 d=810,285 me=750 
          block 00B766F8 d=1884,300 me=750 
VALUE 1884 is not a whole pixel 
         cell 00B76634 d=1950,360 me=810 
        row 00B76460 d=UC,360 
       rowG 00B72F88 d=UC,360 
       colG 00B76964 r=0 a=UC,UC c=UC,UC cnt=913 
        col 00B76A8C r=0 a=0,0 c=1395,UC cnt=914 
        col 00B76A8C d=0,0 
       colG 00B76964 d=0,0 
       rowG 00B72F88 r=2 a=1395,UC c=1395,UC cnt=915 
        row 00B76460 r=2 a=1395,UC c=1395,UC cnt=916 
         cell 00B76634 r=2 a=1335,UC c=1275,UC cnt=917 
          block 00B766F8 r=2 a=1275,UC c=1275,UC cnt=918 
           text 00B76838 r=2 a=141,UC c=UC,UC cnt=919 
VALUE 141 is not a whole pixel 
           text 00B76838 d=750,285 
          block 00B766F8 d=1884,300 
VALUE 1884 is not a whole pixel 
         cell 00B76634 d=1950,360 
        row 00B76460 d=1395,360 
       rowG 00B72F88 d=1395,360 
       colG 00B76964 r=2 a=1395,UC c=1395,UC cnt=920 
        col 00B76A8C r=0 a=0,0 c=1395,UC cnt=921 
        col 00B76A8C d=0,0 
       colG 00B76964 d=0,0 
      tbl 00B76154 d=1425,450 
     tblO 00B75F58 d=1425,450 
     text 00B76AE4 r=0 a=8940,UC c=UC,UC cnt=922 
     text 00B76AE4 d=0,0 
    block 00B75B74 d=8940,450 

As it is obvious from the attached reflow log the block reports a wrong
maxElementsize. It shows the maxElementsize only for the text without the
text-indent. Tables are the main consumer of maxElementsize computations and
here the victim of the wrong line layout code. But I am afraid to add the bug to
Marc's 780 already existing ones. In quirks mode we should cut inheritance as NN
does it it, and as consequence IE implemented the same behaviour.

Comment 7

16 years ago
Created attachment 81405 [details] [diff] [review]
patch for quirks
Created attachment 81410 [details]
testcase that shows what the block is doing

So... is maxElementsize supposed to include overflowing content?  :)

The reason I added qawanted is that I'm not convinced inheritint text-indent
into a table is correct even in strict mode....
Attachment #81355 - Attachment is obsolete: true
Attachment #81402 - Attachment is obsolete: true

Comment 9

16 years ago
Boris, the question is already wrong :-), 
there is no  overflowing content? in the automatic table layout algorithm. See
http://www.w3.org/TR/REC-CSS2/tables.html#auto-table-layout . I have soem
doubt's that you will get a response from hixie, see the comment at
http://www.hixie.ch/tests/adhoc/css/box/table/ . Beside the inheritance the
layout problem is at
where textindent should influence the maxelementsize of the first element of a line.

Comment 10

16 years ago
So it sounds like we have one known bug, which is that MES is not including the
text-indent. I'll take this bug, and assume that it means just that.

Another potential bug (dbaron would probably be the best person to say if it's a
real bug or not) is whether `text-indent' ought to be inherited into table cells.
Assignee: karnaze → waterson
Summary: Tables look poorly, text wraps outside of table boundaries. → text-indent not included in MES computation

Comment 11

16 years ago
It'd really be nice to fix bug 45694 (so we get text-indent handled properly)
before trying to fix this.
Depends on: 45694
Priority: -- → P3
Target Milestone: --- → Future
I would have no objection to |table { text-indent: 0; }| in html.css.

Comment 13

16 years ago
A few notes:

 and http://www.w3.org/TR/REC-CSS2/visuren.html#q5

See also http://bugzilla.mozilla.org/show_bug.cgi?id=91468

MSIE breaks text-indent inheritance on <table>

Comment 14

16 years ago
So, this really seems to pretty much be a dup of 91468. Adding a dependency there.
Depends on: 91468


16 years ago
Keywords: qawanted
Like I told bz on IRC, yes, text-indent should be inherited into table-cells
since it is an inherited property. However, that is separate from whether or not
<td> cells should, in html.css, have text-indent: 0, a proposal with which I
wouldn't necessarily disagree.

Comment 16

16 years ago
I think we shouldn't have text-indent:0px at the table-cell but at the table
level  as David suggested. By this we allow a text-indent setting for all table
cells on the table and row level.
Sounds equally good.


16 years ago
Depends on: 130116
The 'text-indent' problem was fixed with the checkin of bug 130116 at 2002-05-14
05:55 PDT.  Leaving bug open in case you want to add a 'text-indent' declaration
for table to html.css.
*** Bug 148355 has been marked as a duplicate of this bug. ***

Comment 20

15 years ago
taking the bug
Assignee: waterson → bernd.mielke

Comment 21

15 years ago
Created attachment 106489 [details] [diff] [review]
Attachment #81405 - Attachment is obsolete: true
um, could we get slightly more context on that patch? Like, the selector?
Comment on attachment 106489 [details] [diff] [review]

Please diff with -u6 at the least; more if the patch is not reviewable at -u6.
Attachment #106489 - Flags: review-

Comment 24

15 years ago
Created attachment 107234 [details] [diff] [review]

The patch with diff -u15. I also removed the conflicting border styles for the
outer-table frames.
Attachment #106489 - Attachment is obsolete: true


15 years ago
Attachment #107234 - Flags: superreview?(bzbarsky)
Attachment #107234 - Flags: review?(ian)
Comment on attachment 107234 [details] [diff] [review]

/me nods approvingly
Attachment #107234 - Flags: review?(ian) → review+
Attachment #107234 - Flags: superreview?(bzbarsky) → superreview+

Comment 26

15 years ago
fix checked in
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.