Closed
Bug 273857
Opened 20 years ago
Closed 20 years ago
Text in table not centered, where table has width="95%" and is inside an align="center" div
Categories
(Core :: Layout: Tables, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: ali, Assigned: MatsPalmgren_bugz)
Details
(Keywords: testcase)
Attachments
(13 files, 2 obsolete files)
|
373 bytes,
text/html
|
Details | |
|
413 bytes,
text/html
|
Details | |
|
366 bytes,
text/html
|
Details | |
|
311 bytes,
text/html
|
Details | |
|
402 bytes,
text/html
|
Details | |
|
310 bytes,
text/html
|
Details | |
|
401 bytes,
text/html
|
Details | |
|
309 bytes,
text/html
|
Details | |
|
3.33 KB,
text/html
|
Details | |
|
3.27 KB,
text/html
|
Details | |
|
2.35 KB,
patch
|
bernd_mozilla
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
|
37.96 KB,
image/png
|
Details | |
|
37.69 KB,
image/png
|
Details |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a6) Gecko/20041208 Firefox/1.0+ Text inside a table is left aligned, not centered where <table width="95%"> and is inside a <div align="center">. IE6 and Opera 7.54 both agree and place the text in the center. When the align="center" is removed, Gecko/Opera/IE agree text should be left aligned. When the width="95%" is removed, they all agree text should be centered. Will attach testcase shortly.
Attachment #168322 -
Attachment is obsolete: true
http://lxr.mozilla.org/seamonkey/source/content/base/src/nsStyleContext.cpp#367 is responsible for this. patches, thoughts why have this, what IE does under different circumstances are wellcome // Correct tables. 368 const nsStyleDisplay* disp = GetStyleDisplay(); 369 if (disp->mDisplay == NS_STYLE_DISPLAY_TABLE) { 370 // -moz-center and -moz-right are used for HTML's alignment 371 // This is covering the <div align="right"><table>...</table></div> case. 372 // In this case, we don't want to inherit the text alignment into the table. 373 const nsStyleText* text = GetStyleText(); 374 375 if (text->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER || 376 text->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_RIGHT) 377 { 378 nsStyleText* uniqueText = (nsStyleText*)GetUniqueStyleData(eStyleStruct_Text); 379 uniqueText->mTextAlign = NS_STYLE_TEXT_ALIGN_DEFAULT; 380 } 381 }
| Assignee | ||
Comment 6•20 years ago
|
||
| Assignee | ||
Comment 7•20 years ago
|
||
See bug 40038 comment 7.
| Assignee | ||
Comment 8•20 years ago
|
||
Both IE6/win32 and Opera7/linux left-aligns in Quirks mode and centers in Standars mode. I think this is what was intended originally in bug 40038. This patch makes us do the same. (FWIW, NS4 left-aligns).
| Assignee | ||
Comment 9•20 years ago
|
||
... and for the DIV/DIV case, IE6, Opera and Mozilla agrees on center aligned text in both Quirks and Standards mode so that looks OK.
Assignee: nobody → mats.palmgren
OS: Windows XP → All
| Assignee | ||
Updated•20 years ago
|
Attachment #168362 -
Flags: superreview?(dbaron)
Attachment #168362 -
Flags: review?(bernd_mozilla)
align="left" and align="right" should continue to affect tables even in standards mode
Comment on attachment 168362 [details] [diff] [review] Patch rev. 1 A little more context in the diff would have been nice. This is not what was intended originally, but now that WinIE6 does this in standards mode we may as well follow.
Attachment #168362 -
Flags: superreview?(dbaron) → superreview+
| Assignee | ||
Comment 12•20 years ago
|
||
| Assignee | ||
Comment 13•20 years ago
|
||
| Assignee | ||
Comment 14•20 years ago
|
||
| Assignee | ||
Comment 15•20 years ago
|
||
| Assignee | ||
Comment 16•20 years ago
|
||
With the patch all three browsers are compatible except for one case; Opera centers the text for "align=left, Standards mode", where IE6/Mozilla left aligns it.
Comment 17•20 years ago
|
||
Comment 18•20 years ago
|
||
Comment 19•20 years ago
|
||
I dont believe that the patch is correct, if one places a break point at http://lxr.mozilla.org/seamonkey/source/layout/style/nsStyleContext.cpp#378 and loads attachment 168465 [details], we never hit the break point. This is understandable if one looks at http://lxr.mozilla.org/seamonkey/source/layout/style/quirk.css#97. So this patch is equivivalent to a removal. Why do we not remove the fixup? Or is there a scenario when we need this in quirks mode?
| Assignee | ||
Comment 20•20 years ago
|
||
Yes, you're right, I think we should remove this block and let quirk.css take care of the quirk. This will also enable authors to override the quirk by specifying 'text-align:inherit' (which the 1st patch doesn't allow).
Attachment #168362 -
Attachment is obsolete: true
Attachment #169077 -
Flags: superreview?(dbaron)
Attachment #169077 -
Flags: review?(bernd_mozilla)
| Assignee | ||
Updated•20 years ago
|
Attachment #168362 -
Flags: review?(bernd_mozilla)
Attachment #169077 -
Flags: review?(bernd_mozilla) → review+
Attachment #169077 -
Flags: superreview?(dbaron) → superreview+
| Assignee | ||
Comment 21•20 years ago
|
||
Checked in 2004-12-23 14:02 PDT -> FIXED
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 22•20 years ago
|
||
Thanks Mats, I verify that this patch also fixed the rendering on the page on which I was originally having the issue. :)
| Reporter | ||
Comment 23•20 years ago
|
||
Hmm, the Safari that ships with OSX 10.3.7 renders this differently from Gecko/IE/Opera. It left aligns the 'foo' in the testcases. Weird, that. Are we all sure that we've arrived at the right resolution here?
| Reporter | ||
Comment 24•20 years ago
|
||
This is a screenshot of the rendering of attachment 168464 [details] by:
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.5.5 (KHTML, like
Gecko) Safari/125.12
(Uploading at request of bernd).| Reporter | ||
Comment 25•20 years ago
|
||
This is a screenshot of the rendering of attachment 168465 [details] by:
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.5.5 (KHTML, like
Gecko) Safari/125.12
(Uploading at request of bernd).Bug 300374 suggests this patch was wrong. I agree. I don't think the change makes much sense, and I'm really not sure why I granted superreview except for seeing the claim that it matches WinIE6 in standards mode.
Sorry, bug 300734 (incorrect number in previous comment).
You need to log in
before you can comment on or make changes to this bug.
Description
•