Closed
Bug 40038
Opened 24 years ago
Closed 24 years ago
[BLOCK-H]strict mode: center around table centers contents instead of table
Categories
(Core :: Layout: Tables, defect, P1)
Tracking
()
VERIFIED
FIXED
M18
People
(Reporter: ron, Assigned: dbaron)
References
()
Details
(Keywords: html4, testcase, Whiteboard: nsbeta3+)
Attachments
(4 files)
259 bytes,
text/html
|
Details | |
240 bytes,
text/html
|
Details | |
10.06 KB,
patch
|
Details | Diff | Splinter Review | |
1.50 KB,
patch
|
Details | Diff | Splinter Review |
The CENTER element should only center the TABLE on the page. Current version also centers the contents of the TABLE, in violation of HTML 4 standards, which state: "CENTER only centers the table as a whole, not the contents of each table cell"
Yep, this isn't right. At first I thought this was a dupe of bug 36232 or bug 36156. Those bugs are fixed, though, but this example still shows the incorrect behavior.
Severity: major → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
Updated•24 years ago
|
Keywords: testcase
Summary: CENTER element centers TABLE contents, not just TABLE → <center> around table centers table contents instead of table itself (strict dtd)
Comment 2•24 years ago
|
||
Comment 3•24 years ago
|
||
Comment 4•24 years ago
|
||
Using the attachment 8938 [details], this may be of interest. In file: layout/html/table/src/nsTableCellFrame.cpp The function nsTableCellFrame::MapHAlignAttribute is completely commented out by a #if 0 block. It says the code depends on bug 1802 and bug 915. The code does this: 1) If there is already an alignment set on the cell, it does nothing. 2) If there are column or row alignments set, it inherits them for CSS2 purposes. 3) Otherwise, it sets the alignment to a centered for TH (table header) and left for TD (table data) You can uncomment the block, and it will compile, but no change is evident because by the time the function is called, the alignment is already set in error to: NS_STYLE_TEXT_ALIGN_MOZ_CENTER, so the function returns after 1) above. I looked around a bit to see if I could figure out where the cell's alignment was previously set, but couldn't find it. While working on this, you might want to see if it is ok to uncomment that block.
Comment 5•24 years ago
|
||
It works this way intentionally. dbaron's comments at the end of bug 7112 indicate that this bug may not be valid in standard mode. What part of the html 4 spec talks about <center> around <table>? The correct way to center the table is to have auto left and right margins.
Assignee | ||
Comment 6•24 years ago
|
||
This is probably needed for backwards compatibility in quirks mode. I think HTML 3.2 says something about it...
Assignee | ||
Comment 7•24 years ago
|
||
I think what needs to happen here is: * CENTER and DIV ALIGN="center" should always map to -moz-center (etc...) * TABLE elements should always respond to -moz-center as block-centering * in Quirks mode, TABLES should also respond to the text-align property But I thought that through in 30 seconds, so there's probably something wrong with it. I'll think about it some more... I officially retract my comments at the end of bug 7112. I think the deprecated HTML elements should work as they always have, even in standard mode. I'm going to mark some bugs as dups of this one. They have nice testcases too (see http://bugzilla.mozilla.org/showattachment.cgi?attach_id=9500 ).
Summary: <center> around table centers table contents instead of table itself (strict dtd) → strict mode: center around table centers contents instead of table
Comment 10•24 years ago
|
||
Buster, the block is probably giving the table auto margins in quirks mode and will need to do the same thing in standard mode.
Assignee: karnaze → buster
Comment 11•24 years ago
|
||
I think this is the same bug that's causing several sites I administer to be rendered incorrectly in M16. They render fine in Netscape, IE, M13,M14, and M15 but M16 render everything on the page as if it were centered. Here's another example for you: http://www.ncc.com/index.html
Comment 12•24 years ago
|
||
*** Bug 42334 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 13•24 years ago
|
||
*** Bug 42801 has been marked as a duplicate of this bug. ***
Comment 14•24 years ago
|
||
I think I have another example of this bug: http://www.sas.upenn.edu/~jbaron The table is centered, as it should be, but the elements in the table are also centered. This did not happen in Milestone 16, but it is happening in what seems to be M17 20000708
Assignee | ||
Updated•24 years ago
|
Assignee | ||
Updated•24 years ago
|
Summary: strict mode: center around table centers contents instead of table → [BLOCK-H]strict mode: center around table centers contents instead of table
Comment 15•24 years ago
|
||
Correctness, html4, backwards compatibility. PDT team please approve.
Keywords: correctness,
html4
Assignee | ||
Comment 16•24 years ago
|
||
Taking this bug since I'm working on it. I have the tables centered. All (!) I have to do is figure out how to reset the alignment inside tables only when the alignment outside of the tables is MOZ_CENTER or MOZ_RIGHT.
Assignee: buster → dbaron
Status: ASSIGNED → NEW
Assignee | ||
Comment 17•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Target Milestone: M17 → M18
Assignee | ||
Comment 18•24 years ago
|
||
*** Bug 46300 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 19•24 years ago
|
||
Assignee | ||
Comment 20•24 years ago
|
||
Never mind... it was all there.
Comment 21•24 years ago
|
||
Approving for beta3: have a patch and CENTER should work correctly.
Whiteboard: nsbeta3+
Assignee | ||
Comment 22•24 years ago
|
||
Fix checked in, 2000-07-27 16:37 PDT.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 23•24 years ago
|
||
This is actually not completely fixed for XHTML. Should it be?: http://lxr.mozilla.org/seamonkey/source/layout/html/tests/block/bugs/40038-1.xml
Comment 24•24 years ago
|
||
Using 8/25 build with original testcase, verified fixed.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•