Closed Bug 51968 Opened 25 years ago Closed 22 years ago

align=center should override text-indent

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED INVALID
Future

People

(Reporter: h.b.furuseth, Assigned: ian)

References

Details

(Keywords: css1, testcase, Whiteboard: [Hixie-P5] WG (py8ieh: check spec))

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/4.75 [en] (X11; U; SunOS 5.7 sun4u) BuildID: 2000090809 <p align="center" style="text-indent:5em"> does not center 1st line; it is pushed 5em to the left. That's not serious for a 1-line paragraph, but looks bad with multiline paragraphs with short text per line. Reproducible: Always Steps to Reproduce: 1. Visit the upcoming attachment. It contains: <style><!-- p { text-indent:5em; } --></style> <p>Paragraphs<br>have text-indent=5em:</p> <p align="center">P ALIGN=CENTER<br>1<br>2</p><br> <center><p>P inside CENTER<br>1<br>2</p></center><br> <p><center>CENTER inside P<br>1<br>2</center></p><br> Actual Results: 1st line is not centered with <p align=center>xxx or <center><p>xxx. It _is_ centered with <p><center>xxx. Expected Results: If the user said <p align=center>, he almost certainly meant the whole paragraph to be centered. I'm not quite as sure of <center><p>.
Problem may have been fixed. Please check report with latest nightly build from mozilla.org
Sorry, not fixed in build ID 2000100209 (sun-solaris). BTW, my "<CENTER> inside <P>" text is silly, I forgot that <CENTER> terminates <P>. It shows how I think the other paragraphs _should_ look, though.
P3 bugs will not make NS6 RTM. Milestone->future.
Assignee: clayton → buster
Target Milestone: --- → Future
What's the correct behavior here, according to CSS? I suspect we may be right already, but if we are, should the spec be changed?
That seems to be true for a lot of res/quirk.css as well.
so this bug should either be fixed (if we are broken), Resolved Invalid (not a bug in mozilla) or Won't Fix (a bug in mozilla but we like it that way). Either way, there is no reason for this bug to be Unconfirmed. Setting bug status to New
Status: UNCONFIRMED → NEW
Ever confirmed: true
*** Bug 64028 has been marked as a duplicate of this bug. ***
Problem can be reproduced on Netscape6.01A,Sparc Solaris2.8. It works with Mozilla build 2001040904 on PC win2000.
I guess it's not clear to me what this bug is. Are you saying that the first line is 5em from the left edge, or that it's 2.5em to the right of being centered? I think the latter is correct (rather than perfectly centered). Please test on current Mozilla build on Solaris rather than Netscape 6.01, although I doubt this is platform specific...
It's 2.5em to the right of being centered. This is build ID 2001041722 on Sun-Solaris. I agree 2.5em is better than 5em, however that still looks silly. I've NEVER noticed a case of center where the author intended 1st line to be indented as well. The problem is that text-indent and alignment both specify the same thing: how to format the paragraph. In particular when the author centers a few paragraphs and forgets that text-indent exists, while the user's default style sheet has p { text-indent:something; margin-<top/bottom>: 0; } I have that, and I've tried to add tricks like p[align="center"] { text-indent:inherit; } but I can't get it to work properly. So I think text-indent should not be applied to centered text, however it might make sense to add it to both left and right margin of the first line. That way 1st line is not pushed to the left of normally text-indented lines, but it still stays centered. (What the CSS spec says I don't know. If it says Mozilla is correct then I suspect the problem didn't occur to the people who wrote it.) I admit this scheme would do the Wrong Thing if several centered paragraphs follow each other and need to be possible to tell apart, but (a) I've never seen that, and (b) I'm not convinced that the reader would "see" the "indented centered" line as a paragraph start anyway, unless he was aware of this quirk and knew what to look for.
You want: p[align="center"] { text-indent: 0; }
Keywords: css1, testcase
Whiteboard: [Hixie-P5] WG (py8ieh: check spec)
No, "0" vs. "inherit" isn't the problem. First, it isn't enough. p[align="center"] { text-indent: 0; } doesn't override <p style="text-align:center">, and p[text-align="center"] { ... } doesn't either. (Is that a bug?) Nor does it catch text-indent in <center><p>...</p></center>, so I must add center p { text-indent: 0; } as well. And of course *[align="center"] p { text-indent: 0; } to catch e.g. <table align=center>. And maybe I'd better add p[align="left"] { text-indent: <whatever>; } in case something explicitly left-justifies paragraph inside a centered dingbat (e.g. in a table with centered elements)... Second, I don't think _I_ should have to add it. Unless you mean "I" as in "user who can modify the source". Like I said, I've never noticed a case where the current behaviour is what the author or user desired. I don't think anyone who puts p{text-indent:..} in his style sheet, should have to add a bunch of hacks like the above.
Build reassigning Buster's bugs to Marc.
Assignee: buster → attinasi
Verifying behavior using FizzillaCFM/2002070913. 'text-indent' is still applied paragraphs that also have 'text-align: center'. Setting All/All.
OS: Solaris → All
Hardware: Sun → All
To Ian; we're currently rendering per the CSS spec, as far as one can.... Perhaps the spec should specify that when text-align:center text-indent is not applied? Or otherwise specify the rendering in a sane fashion? In any case, please let me know what changes, if any, are needed in Mozilla's behavior.
Assignee: attinasi → ian
This was discussed in a CSSWG telecon recently. I doubt that the spec will be changed away from what it says today. This bug is therefore invalid. Although I agree that the suggestion makes sense, compliance and interoperability is more important an the long run.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: