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
  #1  
Old   
Xah Lee
 
Posts: n/a

Default firefox 3.5 broke css :first-letter - 07-24-2009 , 04:13 PM






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.

(Example of this can be seen on my website.)

Xah
∑ http://xahlee.org/


Reply With Quote
  #2  
Old   
Johannes Koch
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-25-2009 , 06:33 AM






Harlan Messinger schrieb:

Quote:
Are you sure they didn't refine the definition of "letter"? A summation
symbol isn't a letter. What happens when you substitute an actual letter?
Is it "GREEK CAPITAL LETTER SIGMA" or "N-ARY SUMMATION"?

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Reply With Quote
  #3  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-25-2009 , 08:05 AM



Johannes Koch wrote:
Quote:
Harlan Messinger schrieb:

Are you sure they didn't refine the definition of "letter"? A
summation symbol isn't a letter. What happens when you substitute an
actual letter?

Is it "GREEK CAPITAL LETTER SIGMA" or "N-ARY SUMMATION"?

Exactly! The Greek capital does, but the summation symbol does not.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="content-language" content="en-us">

<title>template</title>

<style type="text/css">
div.nav:first-letter {font-size:3ex;color:#b22222}
</style>

</head>
<body>
<div class="nav">Σ First letter as a Greek capital should be
larger and red</div>
</body>
</html>


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

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

Default Re: firefox 3.5 broke css :first-letter - 07-25-2009 , 08:57 AM



Johannes Koch wrote:
Quote:
Harlan Messinger schrieb:

Are you sure they didn't refine the definition of "letter"? A
summation symbol isn't a letter. What happens when you substitute an
actual letter?

Is it "GREEK CAPITAL LETTER SIGMA" or "N-ARY SUMMATION"?
It's "N-ARY SUMMATION". I checked (I copied the character into my
clipboard and pasted it into the expression

javascript:alert(escape("∑"))

in my browser's Address field and got character %u2211.

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

Default Re: firefox 3.5 broke css :first-letter - 07-28-2009 , 09:09 AM



On Jul 25, 5:05 am, "Jonathan N. Little" <lws4... (AT) centralva (DOT) net>
wrote:
Quote:
Johannes Koch wrote:
Harlan Messinger schrieb:

Are you sure they didn't refine the definition of "letter"? A
summation symbol isn't a letter. What happens when you substitute an
actual letter?

Is it "GREEK CAPITAL LETTER SIGMA" or "N-ARY SUMMATION"?

Exactly! The Greek capital does, but the summation symbol does not.

!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"
html
head
meta http-equiv="Content-Type" content="text/html;charset=utf-8"
meta http-equiv="content-language" content="en-us"

title>template</title

style type="text/css"
div.nav:first-letter {font-size:3ex;color:#b22222}
/style

/head
body
div class="nav">Σ First letter as a Greek capital should be
larger and red</div
/body
/html
Thanks all! (didn't see replies in google groups)

Yes it's n-ary summation.

Interesting. 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?

According to Wikipedia,
http://en.wikipedia.org/wiki/Acid3

Safari is the browser that passes acid3. Should i wait for Firefox to
change behavior or should i change my website?

Xah
∑ http://xahlee.org/


Reply With Quote
  #6  
Old   
Swifty
 
Posts: n/a

Default Re: firefox 3.5 broke css :first-letter - 07-28-2009 , 10:03 AM



Xah Lee wrote:
Quote:
Interesting. 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?
That will come down to your interpretation of the word "letter".

Is "A" a letter?
Is "8" a letter?
if "+" a letter?

I would say "yes" to only the first. The others are characters. Or symbols.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

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

Default Re: firefox 3.5 broke css :first-letter - 07-28-2009 , 11:41 AM



Xah Lee wrote:
Quote:
On Jul 25, 5:05 am, "Jonathan N. Little" <lws4... (AT) centralva (DOT) net
wrote:
Johannes Koch wrote:
Harlan Messinger schrieb:
Are you sure they didn't refine the definition of "letter"? A
summation symbol isn't a letter. What happens when you substitute an
actual letter?
Is it "GREEK CAPITAL LETTER SIGMA" or "N-ARY SUMMATION"?
Exactly! The Greek capital does, but the summation symbol does not.

!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"
html
head
meta http-equiv="Content-Type" content="text/html;charset=utf-8"
meta http-equiv="content-language" content="en-us"

title>template</title

style type="text/css"
div.nav:first-letter {font-size:3ex;color:#b22222}
/style

/head
body
div class="nav">Σ First letter as a Greek capital should be
larger and red</div
/body
/html

Thanks all! (didn't see replies in google groups)

Yes it's n-ary summation.

Interesting. 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

Quote:
According to Wikipedia,
http://en.wikipedia.org/wiki/Acid3

Safari is the browser that passes acid3. Should i wait for Firefox to
change behavior or should i change my website?
Why do you assume that Firefox's score has anything to do with
first-letter compliance *or* non-compliance? Why would you expect
Firefox to change its behavior if they just got through correcting it?

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

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



Swifty wrote:

Quote:
Xah Lee wrote:
Interesting. 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?

That will come down to your interpretation of the word "letter".
In part, yes. The CSS "specifications" are vague in this matter. In a sense,
the meaning of "letter" might be the easiest part. The "specs" (CSS 2.0
which is official but not recommended by anyone; CSS 2.1 which is often
cited as de-facto standar but itself forbids that, nominally; and the excuse
for a draft sketch CSS 3.0 Selectors, all saying essentially the same in
this matter) refer to Unicode properties in the discussion of punctuation
characters. Thus, it would be very natural to interpret the word "letter" as
referring to the Unicode characters that have a General Category value
beginning with "L", for "Letter", thus including ideographs, syllable
characters, and far more characters than most of us ever heard of. The
summation sign is surely not a letter in that sense; its General Category is
"Symbol, Math".

Quote:
Is "A" a letter?
Is "8" a letter?
if "+" a letter?

I would say "yes" to only the first.
That is correct. And "8" is a digit. But what other letters and digits are
there?

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.

2) The CSS "specs" also say:
"The ':first-letter' also applies if the first letter is in fact a digit,
e.g., the "6" in "67 million dollars is a lot of money.""
That's weird, really, and it raises the question what constitutes a digit.
(Anything with General Category value beginning with "N", for "Number" -
which is a lot more than most of us would think.)

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. (And what about English "th"?) 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?

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?

Oh, wait... they also "specify":

"The :first-letter pseudo-element must select the first letter of the first
line of a block, if it is not preceded by any other content (such as images
or inline tables) on its line"

So if we have
#%&*Foo
at the start of a line, then :first-letter is the "F", right? Is this
supposed to be useful?

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

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

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



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.»

Quote:
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?

Quote:
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.

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

Here's a test template:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>ttt</title>
<style type="text/css">
div.nav {padding:.5ex;clear:both;font-family:serif} /* nav bar */
div.nav:first-letter {font-size:7ex;color:#b22222}
</style>
</head>
<body>

<div class="nav">☄ comet</div>
<div class="nav">∑ summation</div>
<div class="nav">♥ heart</div>
<div class="nav">★ star</div>
<div class="nav">ψ psi</div>
<div class="nav">x normal x</div>

</body>
</html>


Xah
∑ http://xahlee.org/


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

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



On Jul 28, 9:25*am, "Jukka K. Korpela" <jkorp... (AT) cs (DOT) tut.fi> wrote:
Quote:
Swifty wrote:
Xah Lee wrote:
Interesting. 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?

That will come down to your interpretation of the word "letter".

In part, yes. The CSS "specifications" are vague in this matter. In a sense,
the meaning of "letter" might be the easiest part. The "specs" (CSS 2.0
which is official but not recommended by anyone; CSS 2.1 which is often
cited as de-facto standar but itself forbids that, nominally; and the excuse
for a draft sketch CSS 3.0 Selectors, all saying essentially the same in
this matter) refer to Unicode properties in the discussion of punctuation
characters. Thus, it would be very natural to interpret the word "letter"as
referring to the Unicode characters that have a General Category value
beginning with "L", for "Letter", thus including ideographs, syllable
characters, and far more characters than most of us ever heard of. The
summation sign is surely not a letter in that sense; its General Categoryis
"Symbol, Math".

Is "A" a letter?
Is "8" a letter?
if "+" a letter?

I would say "yes" to only the first.

That is correct. And "8" is a digit. But what other letters and digits are
there?

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.

2) The CSS "specs" also say:
"The ':first-letter' also applies if the first letter is in fact a digit,
e.g., the "6" in "67 million dollars is a lot of money.""
That's weird, really, and it raises the question what constitutes a digit..
(Anything with General Category value beginning with "N", for "Number" -
which is a lot more than most of us would think.)

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. (And what about English "th"?) 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?

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?

Oh, wait... they also "specify":

"The :first-letter pseudo-element must select the first letter of the first
line of a block, if it is not preceded by any other content (such as images
or inline tables) on its line"

So if we have
#%&*Foo
at the start of a line, then :first-letter is the "F", right? Is this
supposed to be useful?

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

Xah

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.