Closed Bug 366359 Opened 18 years ago Closed 10 years ago

line-height ignored when first-letter is floated

Categories

(Core :: Layout: Floats, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 290125

People

(Reporter: dan, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20061218 Minefield/3.0a1

If you try to float a first-letter of a paragraph, you cannot control the line-height settings of the first-letter.

Reproducible: Always

Steps to Reproduce:
1. Create a paragraph
2. Use the first-letter pseudo class to style the first letter so that it floats left and has a line-height value.
Actual Results:  
line-height value is ignored

Expected Results:  
line-height value should be recognized
Keywords: testcase
OS: Mac OS X → All
Hardware: Macintosh → All
Please note that in this testcase, I've placed 2em of line-height on the first-letter, which has a font-size of 50px. Therefore, the first-letter should appear about halfway down the paragraph (compare on other browsers). Mozilla ignores all line-height values when you float the first-letter.
I'm not sure if this is really a bug; floating :first-letter is supposed to be special.
line-height of a floating :first-letter is recognized by: IE5.5, IE6, IE7, Opera 9, and Safari 2.0.4.

Mozilla is the only browser that does not recognize the line-height of a floated first-letter element. Also, designers needs to be able to control how many lines are wrapping around a drop-cap.  With Mozilla, you are stuck with the default line-height setting.
So that it will work on the designer's system, with his operating system and installed fonts, but not anybody else's?

If we want authors to be able to pick a number of lines, they need to be able to pick a number of lines, not tweak a pile of parameters so that it works only in precisely controlled environments.
Regardless, having control of line-height on :first-letter is a legitimate parameter. As I said before, Mozilla is currently the ONLY mainstream browser on the market that does not offer this functionality.
I think this may be a duplicate of Bug 13610.  That bug was first reported back in 1999 and was never resolved. 
However, it's unclear if Bug 13610 needs to be rechecked or not.
Also, I think it's a dependency. Bug 13610 doesn't seem to cover the line-height issues.
Found the spec on this.

http://www.w3.org/TR/REC-CSS2/selector.html#first-letter

The W3C spec clearly illustrates that line-height is a valid property when first-letter is floated. Can we please confirm this bug?
Actually a good example of this bug live on the web is the article pages at the New Yorker's newly redesigned website:

http://www.newyorker.com/talk/2007/03/26/070326ta_talk_collins

The descenders are misaligned on Mozilla due to the line-height.

I'd confirm this bug if I could, but I don't have permission. Clearly line-height is part of the W3C specification for :first-letter. So, I'd say this is definitely a Mozilla bug. Yes, let's confirm this shall we?
If we implemented floating :first-letter correctly things would be properly aligned even without 'line-height'.
David, I'm really not sure I understand your response. Are you saying that you know it's a bug, but you won't Confirm it because you think the New Yorker could fix the problem without using line-height??

If it's a bug, please mark it as such. We'd greatly appreciate it.
Attached file Created reftest
testcase
Attachment #250885 - Attachment is obsolete: true
Attached file reftest reference page
I guess we'll have to agree to disagree on how one should implement a drop-cap.

In any case, please see the new reftest I've attached. According to the W3C spec for CSS2, line-height should be recognized when :first-letter is floated:

http://www.w3.org/TR/REC-CSS2/selector.html#first-letter
I think it's not a bug because we can fix the alignment without authors using 'line-height'.
I have no doubt that you can achieve this. But, that reasoning doesn't make it "not a bug". I don't mean to push you on this, but I'm just having trouble following your logic here:

- It's clear that Rule 5.12.2 of the W3C spec says that line-height is a valid property for :first-letter when it is floated.

- We know that Mozilla is the ONLY browser that doesn't follow this aspect of the CSS2 spec.

Even if your way is better, in theory, I just don't see why you would want to deviate from the CSS2 spec - escpecially when every other browser out there follows it.

Are you absolutely sure that deviating from the spec is the way to go?
http://www.w3.org/TR/CSS21/selector.html#first-letter says:

# In order to achieve traditional drop caps formatting, user agents may
# approximate font sizes, for example to align baselines. Also, the glyph
# outline may be taken into account when formatting. 

What we're doing is taking the glyph outline into account, which is considered a superior method of handling :first-letter (and why it's mentioned in the spec). 
Ah, I see now. That makes sense.

So, is there a bug or ticket open to implement this?
I believe what Dan Richman (seeing that he filed the bug with an OS X browsers) is hinting is that D. Barons's comment 20 actually doesn't work on Mac. The box generated by the ::first-letter is much bigger (taller) on Mac than it is on Windows or Linux.
I had originally filed bug 294733 about this.
(And I'm still seeing this on trunk.)

If I'm correct then this bug is a dupe of bug 294733
Now that bug 294733 is fixed, is there still an issue here?
First-letter now correctly behaves as described in comment 20 on all platforms on trunk. And authors can easily create dropcaps that are consistent across platforms and UA.
But if the question is: please support 'line-height for '::first-letter', that is still an open issue (although supporting 'line-height' in this case is in contradiction with the behaviour in comment 20).

Resolving as WFM ?
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007110515 Minefield/3.0a9pre

Seems like line-height is not ignored, but still rendered incorrect (in according to reftest)
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: