HighDots Forums  

firefox 3.5 broke css :first-letter

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss firefox 3.5 broke css :first-letter in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-28-2009 , 02:11 PM






Xah Lee wrote:
Quote:
Xah Lee wrote:

«looks like fx 3.5 broke this css:
div.nav:first-letter {font-size:3ex;color:#b22222}
The first letter is not colored or bigger.»

Johannes Koch wrote:
Harlan Messinger schrieb:
"Jonathan N. Little" wrote

Is it "GREEK CAPITAL LETTER SIGMA" or "N-ARY SUMMATION"?
Seems Firefox 3.5 only apply the css to letters and not
other chars?


All other browser of current version seems to do the summation sign.
Which behavior is correct?
The behavior exhibited by Firefox 3.5. (After all, that's why it's
called "first-letter", not "first-character" or "first-symbol". The
specification even calls for special treatment, consistent with
traditional treatment in the print world, for first letters that are
preceded by punctuation, and so forth. See

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

The spec above doesn't seems to be absolutely clear on whether non-
letter chars should not be applied when using first-letter.
It's very clear that not all characters are considered "letters" for
this purpose. The name of the pseudo-element is another really good clue
to this.

Quote:
I kinda think it's better if it applies to all unicode chars.
The practice that the feature is meant to support wouldn't work right if
it did. The purpose is to support the very specific case of an existing
style of printing where the first letter of each paragraph or section of
a text is written as a "raised cap" or "drop cap", whatever that
*letter* may be, and with such adjustments as applying the same special
format to preceding punctuation--without requiring extra markup (span or
whatever) to make this happen.

If your purpose is to make a particular symbol larger, then style that
symbol. It's no different a situation than the symbol you want to apply
a special style doesn't happen to be the first character in a block.

Reply With Quote
  #12  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-28-2009 , 02:33 PM






Harlan Messinger wrote:

Quote:
It's very clear that not all characters are considered "letters" for
this purpose.
That much is clear, but it is much more difficult to tell which characters
are considered as letters.

Quote:
The name of the pseudo-element is another really good
clue to this.
No, CSS names are so often clueless that none of them is a good clue to
anything. If you read any semantics from an alphabetic string occurring in a
selector, a property, or a property value, you do that on your own risk and
often go all wrong.

For example, the white-space property looks like affecting white space
handling, but in fact, by the specs and by implementations, it also affects
the rendering of a string that contains no whitespace characters.

You could deduce from the name that the letter-spacing property affects
spacing between letters. In fact, it affects the spacing between characters
in general, whether they are letters or not.

Or you might think that text-decoration is something decorative, but it
isn't.

There's no hint in the name :link that this pseudo-class only applies to
_unvisited_ links.

You might naively think that foo:before refers to a fictional element before
foo, but it's really something _inside_ foo, just appearing before any
content proper.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Reply With Quote
  #13  
Old   
Xah Lee
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-28-2009 , 02:38 PM



On Jul 28, 11:11 am, Harlan Messinger
<hmessinger.removet... (AT) comcast (DOT) net> wrote:
Quote:
Xah Lee wrote:
Xah Lee wrote:

«looks like fx 3.5 broke this css:
div.nav:first-letter {font-size:3ex;color:#b22222}
The first letter is not colored or bigger.»

Johannes Koch wrote:
Harlan Messinger schrieb:
"Jonathan N. Little" wrote

Is it "GREEK CAPITAL LETTER SIGMA" or "N-ARY SUMMATION"?
Seems Firefox 3.5 only apply the css to letters and not
other chars?

All other browser of current version seems to do the summation sign.
Which behavior is correct?
The behavior exhibited by Firefox 3.5. (After all, that's why it's
called "first-letter", not "first-character" or "first-symbol". The
specification even calls for special treatment, consistent with
traditional treatment in the print world, for first letters that are
preceded by punctuation, and so forth. See

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

The spec above doesn't seems to be absolutely clear on whether non-
letter chars should not be applied when using first-letter.

It's very clear that not all characters are considered "letters" for
this purpose. The name of the pseudo-element is another really good clue
to this.

I kinda think it's better if it applies to all unicode chars.

The practice that the feature is meant to support wouldn't work right if
it did. The purpose is to support the very specific case of an existing
style of printing where the first letter of each paragraph or section of
a text is written as a "raised cap" or "drop cap", whatever that
*letter* may be, and with such adjustments as applying the same special
format to preceding punctuation--without requiring extra markup (span or
whatever) to make this happen.

If your purpose is to make a particular symbol larger, then style that
symbol. It's no different a situation than the symbol you want to apply
a special style doesn't happen to be the first character in a block.
getting philosophical, i disagree with your view here.

Jukka K Korpela gives a good analysis of the problems of the w3c spec.

Newsgroups: comp.infosystems.www.authoring.stylesheets
Date: Tue, 28 Jul 2009 19:25:57 +0300
Subject: Re: firefox 3.5 broke css :first-letter
http://groups.google.com/group/comp.infosystems.www.authoring.stylesheets/msg/0127e580135738bb

To me, emulating the traditional publication behavior is quite vague
and problematic. For example, the spec says if the first letter is a
double quote, then that double quote should also be cap'd alone with
the letter after the double quote. Also, it says if the first char is
digits such as 3, it should be cap'd too.

These are problematic and inconsistant. If emulating tradition is
focused, then digit chars shouldn't appy. But, to me, including the
quotation char as part of the “first-letter” is also problematic,
because it breaks simplicity and consistency. In this regard, the
quotation char isn't first letter as implied in the name of the tag
“first-letter”.

It would be much simpler and consistant, and probably more applicable
to today's digital world, if first-letter is named first-char, and
behave as applying to just the first char. For those who needs to cap
the first punctuation char alone with the letter that follows, they
might as well do special css for those cases, or, w3c really should
have tags like second-letter, last-letter (for last punctuation,
usually closing quotation char.).

i put some summary and my opinion on this issue here:

• What's a Letter in CSS's first-letter Pseudo-element?
http://xahlee.org/js/css_first_letter.html

test page here:

• test
http://xahlee.org/js/css_first_letter_test.html

Xah
∑ http://xahlee.org/


Reply With Quote
  #14  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-28-2009 , 03:46 PM



Xah Lee wrote:
Quote:
On Jul 28, 11:11 am, Harlan Messinger
hmessinger.removet... (AT) comcast (DOT) net> wrote:
Xah Lee wrote:
I kinda think it's better if it applies to all unicode chars.
The practice that the feature is meant to support wouldn't work right if
it did. The purpose is to support the very specific case of an existing
style of printing where the first letter of each paragraph or section of
a text is written as a "raised cap" or "drop cap", whatever that
*letter* may be, and with such adjustments as applying the same special
format to preceding punctuation--without requiring extra markup (span or
whatever) to make this happen.

If your purpose is to make a particular symbol larger, then style that
symbol. It's no different a situation than the symbol you want to apply
a special style doesn't happen to be the first character in a block.

getting philosophical, i disagree with your view here.
OK, but I don't see what there is to disagree with. You are choosing to
place a specially styled sigma at the beginning of these headings. You
aren't making it big *because* it's the first character in these
headings. Those are different things.

Reply With Quote
  #15  
Old   
Ben C
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-28-2009 , 05:05 PM



On 2009-07-28, Jukka K. Korpela <jkorpela (AT) cs (DOT) tut.fi> wrote:
Quote:
Harlan Messinger wrote:

It's very clear that not all characters are considered "letters" for
this purpose.

That much is clear, but it is much more difficult to tell which characters
are considered as letters.

The name of the pseudo-element is another really good
clue to this.

No, CSS names are so often clueless that none of them is a good clue to
anything. If you read any semantics from an alphabetic string occurring in a
selector, a property, or a property value, you do that on your own risk and
often go all wrong.

For example, the white-space property looks like affecting white space
handling, but in fact, by the specs and by implementations, it also affects
the rendering of a string that contains no whitespace characters.
In what way? Are you thinking of line-breaking other than at whitespace?

Quote:
You could deduce from the name that the letter-spacing property affects
spacing between letters. In fact, it affects the spacing between characters
in general, whether they are letters or not.

Or you might think that text-decoration is something decorative, but it
isn't.

There's no hint in the name :link that this pseudo-class only applies to
_unvisited_ links.

You might naively think that foo:before refers to a fictional element before
foo, but it's really something _inside_ foo, just appearing before any
content proper.
You might think that position: absolute positioned a box absolutely, but
instead that's what position: fixed does.

Or you might think that position: relative positioned a box relative to
its container, but that's what position: absolute does.

Reply With Quote
  #16  
Old   
Jon Fairbairn
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-29-2009 , 05:30 AM



"Jukka K. Korpela" <jkorpela (AT) cs (DOT) tut.fi> writes:

Quote:
The additional difficulties include these:

1) The CSS "specs" say that :first-letter also includes any
leading punctuation character, which is somewhat odd - if a
line begins with a quotation mark and a letter, then these
two are included into the pseudo-element :first-letter.
That's typographically justifiable. The problem is that (as with
so much of the specification HTML+CSS) they are trying to
specify how things behave based on a (necessarily incomplete)
knowledge of typography. It would be far better to specify
something that was technically well defined and sufficiently
general to let the web author define the behaviour that [s]he
wants.

Quote:
3) For further confusion, they say:
"Some languages may have specific rules about how to treat
certain letter combinations. In Dutch, for example, if the
letter combination "ij" appears at the beginning of a word,
both letters should be considered within the :first-letter
pseudo-element."
That's really wild. It makes things language-dependent and
even language version dependent; e.g., it's an open question
whether "ch" in Spanish is one letter in some sense.
If I remember correctly, it (along with ll) was, but now isn't
in some official sense, though I've no idea what the
typographical conventions were/are.

Quote:
(And what about English "th"?)
No. We don't regard that as one letter (in "The" with a drop
cap, it would always be just the "T".) It's a bit of a shame we
stopped using þ and ð ;-)

Quote:
And it leaves things wide open - are browsers really supposed
to know the rules of all written languages in such matters?
What _are_ the rules, really?
That's it exactly.

Quote:
Let's end this with one more foolishness:

"If the letters that would form the first-letter are not in
the same element, such as "'T" in <p>'<em>T..., the UA may
create a first-letter pseudo-element from one of the
elements, both elements, or simply not create a
pseudo-element."

Is that just idle babbling, or is it supposed to be part of a specification?
I've never been sure where the transitions between one and the
other are in the w3 specs. When Phil Wadler made a formal
definition of something for them (to do with XML, IIRC), they
made the English description normative, not the formal spec,
thus favouring legalistic argumentation over mathematical
precision.

--
Jón Fairbairn Jon.Fairbairn (AT) cl (DOT) cam.ac.uk

Reply With Quote
  #17  
Old   
Andreas Prilop
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-29-2009 , 10:34 AM



On Tue, 28 Jul 2009, Ben C wrote:

Quote:
For example, the white-space property looks like affecting white space
handling, but in fact, by the specs and by implementations, it also affects
the rendering of a string that contains no whitespace characters.

In what way? Are you thinking of line-breaking other than at whitespace?
Breaking at *any* character:
<news:Ov2Kl.6154$b04.2683 (AT) uutiset (DOT) elisa.fi>
http://groups.google.co.uk/group/comp.infosystems.www.authoring.html/msg/fde00a3c454fdecc

--
In memoriam Alan J. Flavell
http://groups.google.co.uk/groups/search?q=author:Alan.J.Flavell

Reply With Quote
  #18  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-29-2009 , 03:50 PM



Jon Fairbairn wrote:

Quote:
1) The CSS "specs" say that :first-letter also includes any
leading punctuation character, which is somewhat odd - if a
line begins with a quotation mark and a letter, then these
two are included into the pseudo-element :first-letter.

That's typographically justifiable.
Typograhically, yes. My words "somewhat odd" were meant to point out that it
is CSS-wise odd to define a pseudo-element so that both its name and its
short description suggest that its content is the first _letter_, then
divert to something else. And the statement about digits being taken as
letters doesn't make much sense either way - I don't think I've ever seen a
digit styled (as drop-cap or otherwise special) at the start of a text block
in print media (or elsewhere). It's not normal to start a paragraph with a
digit, and it would be much more abnormal to style that digit the way first
letters are often styled.

Quote:
The problem is that (as with
so much of the specification HTML+CSS) they are trying to
specify how things behave based on a (necessarily incomplete)
knowledge of typography.
Indeed. It's really worse than DWIM (Do What I Mean) - it's DWSM (Do What
Someone Means). It would be understandable in preliminary discussions when
designing a style sheet language (we have those typographic ideas, how about
incorporating them, somehow?) but it's horrible in something presented as a
specification.

Quote:
It would be far better to specify
something that was technically well defined and sufficiently
general to let the web author define the behaviour that [s]he
wants.
Right. And the :first-letter pseudo-element, no matter what the original
motives were, is part of CSS and will be used for various other purposes as
well. For example, if you have an alphabetic list where you wish to
highlight the "A" of the first word beginning with "A" etc., then it's very
natural to use :first-letter instead of extra markup.

Quote:
That's really wild. It makes things language-dependent and
even language version dependent; e.g., it's an open question
whether "ch" in Spanish is one letter in some sense.

If I remember correctly, it (along with ll) was, but now isn't
in some official sense, though I've no idea what the
typographical conventions were/are.
Typography tends to be conservative, and so do people - it typically takes
two generations (60 years) to have an orthography reform really carried out.
(You need schoolteachers that have learned the new system as natural.) So
it's conceivable that they could treat "ch" as a single letter in
typography, even though it's officially two letters, even in alphabetic
ordering.

My example of "th" in English was not a particularly good one, and neither
would "sh" be. But "sh" in Finnish, when used as a substitute for the
recommended s with caron (still often difficult to produce for various
reasons), would be a different matter - a digraph used as substitute for a
single character for technical reasons really has some of the nature of a
single character. We could ask similar questions about the use of "ae",
"oe", "ue", and "oe" as substitutes for different characters (like "ä", "æ",
etc.) in some languages. This is really not something that should be left to
browser vendors to decide - but that's what CSS "specs" do.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Reply With Quote
  #19  
Old   
Joshua Cranmer
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-29-2009 , 05:38 PM



Jon Fairbairn wrote:
Quote:
That's typographically justifiable. The problem is that (as with
so much of the specification HTML+CSS) they are trying to
specify how things behave based on a (necessarily incomplete)
knowledge of typography.
I remember the discussion about first-letter in the CSS mailing list
specifically sending people scurrying to find what their typography
books said. In particular, the argument was actually over digits in
:first-letter.

Quote:
I've never been sure where the transitions between one and the
other are in the w3 specs. When Phil Wadler made a formal
definition of something for them (to do with XML, IIRC), they
made the English description normative, not the formal spec,
thus favouring legalistic argumentation over mathematical
precision.
Theoretically, informative sections should be marked as such in the
specs. The reason for making the prose normative instead of the formal
grammar is that not everything can be specified with formal grammar. It
is also rather difficult to cover all possible cases with mathematical
precision--this came up with implementing display: run-in recently.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Reply With Quote
  #20  
Old   
Jon Fairbairn
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-30-2009 , 04:03 AM



Joshua Cranmer <Pidgeot18 (AT) verizon (DOT) invalid> writes:

Quote:
Jon Fairbairn wrote:
I've never been sure where the transitions between one and the
other are in the w3 specs. When Phil Wadler made a formal
definition of something for them (to do with XML, IIRC), they
made the English description normative, not the formal spec,
thus favouring legalistic argumentation over mathematical
precision.

Theoretically, informative sections should be marked as such
in the specs. The reason for making the prose normative
instead of the formal grammar is that not everything can be
specified with formal grammar.
I don't accept that. Certain things can't be specified with
formal grammar, but everything relevant (as far as grammar
is concerned) can be. There's no way to write a web browser
that reads something that can't be specified with formal
grammar. Or to put it another way, you /can/ specify
anything computable using formal grammar, and web browsers
can't do anything that's not computable. I'm not saying that
grammar per se is the best way of specifying things -- it's
usually better to separate lexical syntax, syntax and
semantics, but all of these can be specified formally.

Quote:
It is also rather difficult to cover all possible cases with
mathematical precision
Difficult is not the same as impossible. If it's difficult
to do mathematically, any prose description is most likely
incomplete, misleading or wrong. Covering all cases is
something that mathematics does very well.

Quote:
--this came up with implementing display: run-in recently.
Given that the absence of mathematical precision runs
throughout the "specs", I'm not terribly surprised that
there's difficulty with particular parts of it. You can't
erect a monolith on quicksand.


--
Jón Fairbairn Jon.Fairbairn (AT) cl (DOT) cam.ac.uk

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.