Closed
Bug 7112
Opened 25 years ago
Closed 25 years ago
{compat} ALIGN attribute needs special treatment
Categories
(Core :: Layout, defect, P3)
Tracking
()
VERIFIED
FIXED
M14
People
(Reporter: rekle, Assigned: karnaze)
References
()
Details
(Keywords: css-moz, testcase)
Attachments
(5 files)
Go to a My Yahoo page and look at the "Bookmarks" section. There is a box
there that says "Add Bookmark" right under the blue box that says "Bookmarks".
This "Add Bookmark" Text should be centered under the blue "Bookmarks" box, but
is instead left aligned.
Chris -- can you please make a test case for this and attach it? Thanks.
Comment 2•25 years ago
|
||
Comment 3•25 years ago
|
||
Attached are two files that may demonstrate the problem. I isolated it down as
far as I could.
The problem may lie with the <td align=middle> tag in the second row of the
outer table.
The first document, '7112_bookmark.html' shows a snippet of the actual page.
Three areas that may effect this problem are:
(1) the <td width="1%"> tag in the first row of the outer table
(2) the <td colspan=2 align=middle> tag in the second row of the outer table
The second example, '7112_bookmark_2.html, is a revision of the original
document somewhat. I changed the width percentage from 1 to 100 and removed the
colspan attribute from the <TD> tag in the second row of the outer table.
Both examples demonstrate the centering problem, but I can't pinpoint it
exactly.
Comment 4•25 years ago
|
||
Comment 5•25 years ago
|
||
Assignee: chrisd → rickg
Updated•25 years ago
|
QA Contact: petersen → chrisd
Chris -- I've dumped the content model (in both of ChrisD's examples) and it
looks correct. I think this may be yours.
Comment 7•25 years ago
|
||
This alignment stuff is really messy because align means two different things in
HTML - on text and on tables - and the CSS text-align property only has the
meaning for text. This is a complicated quirks mode thing that I think Kipp was
working on a while back - I'll try and dig up some relevant bug numbers.
I have another attachment that's a simpler demonstration - 2 test cases with
explanations. I'll try and get back to you on exactly how I think this stuff
ought to be handled. It's messy.
Comment 8•25 years ago
|
||
Comment 9•25 years ago
|
||
Kipp and I discussed this on March 4, and the end result was that I think the
following should be done (I'm not sure why it isn't working here - see perhaps
bug 6122):
* I assume you're mapping align=middle and align=center on anything to CSS
text-align: center, except perhaps on table elements in quirks mode (see below)
* In standard mode, let CSS inheritance apply, so these can never center a table
- the text inside will be centered
* In quirks mode, if a table ends up with text-align: center (except possibly
from placing text-align: center on the table itself, which is why you may want
to handle things differently when it's on a table), then instead of following
the CSS rules, center the table, and reset text align to the writing direction
(ltr -> left, rtl -> right).
I'm sure there was another bug on this because I remember writing test cases to
see what different browsers did. I'll look for it.
Comment 10•25 years ago
|
||
Comment 11•25 years ago
|
||
This test case was actually also from a discussion with kipp. On March 22, I
wrote (referring to what is now attachment 395 [details]):
---
both IE5 and NN4.5 align tables 1, 3, and 4 centered and 2 left. The
centering of 4 is contary to the CSS spec.
According to HTML 4.0, 1 should be centered and 3 should *probably* be
left.
According to HTML 3.2, 1 should be centered and 3 should be centered.
Whatever you do, make sure 2 stays left!
---
Kipp may have some insight into this, since he worked on it a bit (although the
problem here seems to be that it doesn't work on *nested* tables, or something
like that).
Note that right now Mozilla is centering tables 1 and 3, while 2 and 4 are on
the left.
Comment 12•25 years ago
|
||
*** Bug 6150 has been marked as a duplicate of this bug. ***
Comment 13•25 years ago
|
||
*** Bug 8388 has been marked as a duplicate of this bug. ***
Updated•25 years ago
|
Summary: Text not being centered properly → ALIGN attribute needs special treatment
Comment 14•25 years ago
|
||
*** Bug 8046 has been marked as a duplicate of this bug. ***
Comment 15•25 years ago
|
||
From 8046: IN QUIRKS MODE, the ALIGN attribute on DIV and TD should also
control the alignment of HR elements they contain.
eg:
<DIV ALIGN=RIGHT>
<HR SIZE=5>
</DIV>
That is, HR should act like <TABLE> as far as being treated by ALIGN is
concerned. I think.
Comment 16•25 years ago
|
||
*** Bug 8094 has been marked as a duplicate of this bug. ***
Comment 17•25 years ago
|
||
*** Bug 7361 has been marked as a duplicate of this bug. ***
Comment 18•25 years ago
|
||
*** Bug 6721 has been marked as a duplicate of this bug. ***
Updated•25 years ago
|
Summary: ALIGN attribute needs special treatment → {compat} ALIGN attribute needs special treatment
Comment 19•25 years ago
|
||
[TESTCASE]: The 'problem' is illustrated in the following two test cases:
http://www.bath.ac.uk/%7Epy8ieh/internet/projects/mozilla/tablealign.quirks.html
http://www.bath.ac.uk/%7Epy8ieh/internet/projects/mozilla/tablealign.strict.html
The first has no doctype, and so should trigger NavQuirks mode, the second has
an HTML4 Strict doctype, and so should trigger the standards compliant mode.
Otherwise, they contain the same text.
Comment 20•25 years ago
|
||
*** Bug 7044 has been marked as a duplicate of this bug. ***
Comment 21•25 years ago
|
||
*** Bug 2956 has been marked as a duplicate of this bug. ***
Comment 22•25 years ago
|
||
The bug that kipp worked on on this problem was bug 3238.
Comment 23•25 years ago
|
||
I just found a message where kipp described his solution to bug 3238. My
summary:
1) In Compat mode, ALIGN="center" and ALIGN="right" map to -moz-center and
-moz-right rather than center and right (of the text-align property).
2) If a TABLE has -moz-center or -moz-right, then the table moves instead (I
guess the margins are set to auto appropriately, and text-align is set to left.)
This raises a few issues:
1) Did HTML ever have align="justify"?
2) This doesn't handle the compat issues for text-align at all.
3) What else is wrong with it right now. Is this still happening?
I don't have time to investigate right now...
Updated•25 years ago
|
Whiteboard: [TESTCASE]
Comment 24•25 years ago
|
||
Marked [TESTCASE].
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M10
Comment 25•25 years ago
|
||
*** Bug 10203 has been marked as a duplicate of this bug. ***
Comment 26•25 years ago
|
||
*** Bug 9299 has been marked as a duplicate of this bug. ***
Comment 27•25 years ago
|
||
*** Bug 10619 has been marked as a duplicate of this bug. ***
Comment 28•25 years ago
|
||
Not sure if y'all were aware of the exact spec according to w3c, but...:
http://www.w3.org/TR/REC-html40/sgml/dtd.html#cellhalign
...unfortunately, many sites use the invalid attribute "middle" for horizontal
alignment, eg. www.thirdnipple.com.
Comment 29•25 years ago
|
||
*** Bug 12103 has been marked as a duplicate of this bug. ***
Comment 30•25 years ago
|
||
*** Bug 5196 has been marked as a duplicate of this bug. ***
Comment 31•25 years ago
|
||
*** Bug 12935 has been marked as a duplicate of this bug. ***
Comment 32•25 years ago
|
||
Spoke to karnaze during bug triage today. Moving to M11. Not an M10 blocker.
Assignee | ||
Comment 33•25 years ago
|
||
Moving to M13.
Assignee | ||
Updated•25 years ago
|
Target Milestone: M13 → M14
Assignee | ||
Comment 34•25 years ago
|
||
mass move to m14.
Updated•25 years ago
|
Summary: {compat} ALIGN attribute needs special treatment → {compat} ALIGN attribute needs special treatment {css-moz}
Comment 35•25 years ago
|
||
Tentatively marking css-moz as the (proposed? implemented?) fix uses CSS
extensions.
Comment 36•25 years ago
|
||
Bulk moving [testcase] code to new testcase keyword. Sorry for the spam!
Keywords: testcase
Updated•25 years ago
|
Summary: {compat} ALIGN attribute needs special treatment {css-moz} → {compat} ALIGN attribute needs special treatment
Whiteboard: [TESTCASE]
Assignee | ||
Comment 37•25 years ago
|
||
The table portion of this bug is fixed except that <table style="text-align">
operates according to the standard in quirks mode (if this is an issue, I can
make it work that way, but it seems wrong to do it). ChrisD, can you open a new
bug for the <div> example in the 6/18/99 comments. This bug has gotten too long
and the original problem is fixed.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 38•25 years ago
|
||
*** Bug 27893 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 39•25 years ago
|
||
*** Bug 27893 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 40•25 years ago
|
||
*** Bug 32050 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 41•25 years ago
|
||
Maybe ALIGN=center on the table should work the same way in quirks and strict
modes, even though it is deprecated in HTML 4. Reopening the bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•25 years ago
|
Status: REOPENED → ASSIGNED
Comment 42•25 years ago
|
||
ALIGN="*" directly on a table should not map to the text-align property at all,
but should map to the margin properties (RIGHT->margin-left: auto,
LEFT->margin-right: auto, or CENTER->both auto).
Assignee | ||
Comment 43•25 years ago
|
||
ALIGN=center no longer get converted to text-align:center in strict mode.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 44•25 years ago
|
||
*** Bug 29627 has been marked as a duplicate of this bug. ***
Comment 45•25 years ago
|
||
I reported a problem with <TABLE ALIGN=center>...</TABLE> centreing table
cell contents (the HTML 4.01 spec says it should centre the table, not the
cell contents), but had my bug report (<a
href="http://bugzilla.mozilla.org/show_bug.cgi?id=29627">"#29627</a>) marked
as a duplicate of this bug. Fair enough, I thought, but this bug (7112) is marked as
resolved and fixed and yet the <TABLE ALIGN=center>...</TABLE> issue is *not*
fixed by any means (it renders 1,000 pages on our site wrongly because of
this). Hence, I'm proposing to re-open this bug (or maybe my original 29627
bug should not be marked as a duplicate and should be re-opened ?) in a few
days if someone doesn't argue otherwise.
Example URL showing the problem:
<a
href="http://www.liverpoolfc.net/1999/news/feb/28_05.html">http://www.liverpoolfc.net/1999/news/feb/28_05.html</a>
Could someone comment on this - as far as I'm concerned this is actually a
beta show-stopper (you are going directly against the HTML 4.01 spec and this
means you are not 100% HTML 4.01 compliant !).
Comment 46•25 years ago
|
||
I think what you mention is not a bug. The page you mention uses an XHTML
DOCTYPE, and therefore triggers strict mode. The structure is:
<center>
<table align="center">
...
</table>
</center>
The centering is caused by the center element. In quirks mode, the table resets
the text-align property. However, in standard mode, the center applies to
within the table. The specs don't define an HTML->CSS mapping for the center
element (which is equivalent to a div with align="center"), but I see no reason
that it should be different for different elements in standard mode. However,
you might be able to convince me otherwise...
Comment 47•25 years ago
|
||
*** Bug 19960 has been marked as a duplicate of this bug. ***
Comment 48•24 years ago
|
||
Verified
Windows (NT): 2000-07-13-09-M17
Linux : 2000-07-13-08-M17
Tested with 2 testcases as provided in attachment of 06/24/99 for quirk and
strict testcases.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•