Philippe Wittenbergh wrote:
> 
> On Oct 12, 2009, at 5:12 PM, Alan Gresley wrote:
> 
>> <http://css-class.com/test/bugs/ie/8/first-letter.htm>
>>
>> Firefox does follow the specs since the first-letter is floated, thus is
>> it display;block. In IE8 though it showing as display:inline. The
>> first-letter overlaps the following block by the same amount of space
>> that is above and below the first-letter.
> 
> That is not true. The first-letter _is_ floated in IE in the second 
> block (it pushes the inline content in the lime-green block aside). 
> Check what WebKit or Opera does.


Correct. I wasn't thinking right.


> The difference you see with Gecko (but not with e.g. WebKit) is caused 
> by the line-height. In the case of a floated :first-letter, Gecko 
> follows this part of the spec [1]:


Not correct. There is no change in the line-height in Gecko for 
:first-letter. Giving line-height of any size will always be the same. 
The height changes in Gecko for first-letter instead. Also Gecko treats 
floated :first-letter and spans differently.

<http://css-class.com/test/css/visformatting/first-letter-floated.htm>

<http://css-class.com/test/css/visformatting/span-floated.htm>


>> To allow UAs to render a typographically correct drop cap or initial 
>> cap, the UA may choose a line-height, width and height based on the 
>> shape of the letter, unlike for normal elements.
> 
> WebKit, Trident and Presto generate a line-box based on the computed 
> line-height, whereas Gecko completely ignores any line-height (that is 
> one of the reasons why my test case specifies a very narrow line-height 
> - the whole code is carefully calibrated for x-browser compat). A little 
> mouse told me that Presto (Opera) is working on implementing what Gecko 
> does…
> That is also why the selection box in your screenshot from my test case 
> is much taller in IE than it is in Gecko.
> 
> [1] http://www.w3.org/TR/CSS21/selector.html#first-letter
> 
> Philippe
> ---
> Philippe Wittenbergh
> http://l-c-n.com/


This is a unusual case, where a float does not act exactly as a float. I 
can see why Gecko does this since any short lines of text would 
displaced inline content below it and thus making first-letter useless 
in a fringe case.

<http://css-class.com/test/css/visformatting/first-letter-floated-abc.htm>


-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to