Closed Bug 104898 Opened 23 years ago Closed 23 years ago

centered table is shifted by half of padding to left

Categories

(Core :: Layout: Tables, defect)

Other
Linux
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: utx, Assigned: bernd_mozilla)

References

()

Details

Attachments

(3 files)

2nd table of referred page is strange shifted by half of padding to left.
I don't see any reason for it.

Notes:
Maybe I've overseen something in CSS2 spec, but I don't know exactly, why 3rd
one is not centered.
Looking at results of many browsers, only second one gives centered result with
all tested ones with CSS support (except NS4, where none is centered).
I have played with visual format model ("display" in CSS). Model "inline"
doesn't have this problem, but displays incorrectly frame around text.
The one labeled as noncentered is not supposed to be centered -- the
'text-align' property affects the alignment of text within blocks, not the
margins of the blocks (see 'margin-left: auto', 'margin-right: auto').
This is not affected by '-moz-box-sizing'.

I'll attach a slightly simpler version of the testcase with the incorrect test
removed.
Hmmm, there are two possible ways to fix this bug: center not the inner table
frame but the outer and let the block code do all the magic or tweak again the
nasty code in nsTableOuterFrame.cpp. The first approach would be my preference,
but I don't know how to do it, because it would allow us to fix numerous other
table related bugs,  I think I can handle the second way by myself.

David if you could point me to the place where the first approach would be
implemented (some code snippet?) I would be glad to finish the bug and make the
necessary corrections in nsTableOuterFrame.cpp.

If you think we should go the second way, just reassign the bug to me.
   
Well, this is a tables bug anyway so you can take it if you want.  (Wouldn't it
be nice if we had inner/outer frame types...)
Assignee: dbaron → karnaze
Component: Style System → HTMLTables
QA Contact: ian → amar
Attached patch patchSplinter Review
Attached file testcase with caption
I runned the regression tests the only affected files have been:
 
file:///s|/mozilla/layout/html/tests/table/bugs/bug1164.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug19599.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug29326.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug30559.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug3105.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug39209.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug4284.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug7112-1.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug7112-2.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug8499.html

All these files have centered tables which shift by a pixel to the right. So the
changes in our testcases are difficult to notice, So I would like to mark the
regression testing as successful.
Assignee: karnaze → bernd.mielke
taking the bug
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment on attachment 53767 [details] [diff] [review]
patch

r=karnaze
Attachment #53767 - Flags: review+
Comment on attachment 53767 [details] [diff] [review]
patch

sr=attinasi
Attachment #53767 - Flags: superreview+
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: