Last Comment Bug 317572 - (Style) font-family is not rendered if using quotes
: (Style) font-family is not rendered if using quotes
Status: RESOLVED INVALID
:
Product: Firefox
Classification: Client Software
Component: General (show other bugs)
: unspecified
: x86 Windows 2000
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-23 07:38 PST by FredCK
Modified: 2016-11-14 22:37 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
A simple testcase that shows the problem. (302 bytes, text/html)
2005-11-23 07:40 PST, FredCK
no flags Details

Description User image FredCK 2005-11-23 07:38:48 PST
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon; .NET CLR 1.1.4322)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4

When formatting using the "font-family" property, if you put the font family name inside quotes, it will not get rendered as expected. Actually the font formatting will be ignored.

Reproducible: Always

Steps to Reproduce:
Just set a style using "font-family:'fantasy'",for example.

Actual Results:  
The specified font formatting will be ignored.
Comment 1 User image FredCK 2005-11-23 07:40:23 PST
Created attachment 204037 [details]
A simple testcase that shows the problem.
Comment 2 User image Uri Bernstein (Google) 2005-11-23 07:54:05 PST
This is the correct behavior.
Per the CSS 2.1 spec: (http://www.w3.org/TR/CSS21/fonts.html#font-family-prop)

Font family names that happen to be the same as a keyword value (e.g. 'initial', 'inherit', 'default', 'serif', 'sans-serif', 'monospace', 'fantasy', and 'cursive') must be quoted to prevent confusion with the keywords with the same names. UAs must not consider these keywords as matching the '<family-name>' type.

So when you quote 'fantasy' the system looks for a font actually called "fantasy". If you want to use it as keyword, it must not be quoted.

=> INVALID
Comment 3 User image FredCK 2005-11-23 08:10:55 PST
Ok, thanks for the precision. I took a look in the specification before reporting the bug, but read it quickly.

I confirm that the actual behavior reflects exactly the W3C specifications. I just thought that, as all other browsers transparently correct this bad style definition and render it as expected (it doesn't always means "correctly"), then why should not Firefox do that?
Comment 4 User image Uri Bernstein (Google) 2005-11-23 08:15:47 PST
(In reply to comment #3)
> I confirm that the actual behavior reflects exactly the W3C specifications. I
> just thought that, as all other browsers transparently correct this bad style
> definition and render it as expected (it doesn't always means "correctly"),
> then why should not Firefox do that?

1. Not all browsers "transparently correct" this: specifically, I tested Safari, and it behaves just like Mozilla/Firefox (i.e., correctly).

2. If we do what you suggest, there will be no way for an author to specify using a font actually named "Fantasy" (or "Serif", etc.). Plus it would be a clear violation of the standard - something we are trying not to do.
Comment 5 User image FredCK 2005-11-23 09:09:38 PST
It would be tricky if the specified font is not available in the computer (probably 99,99999999% of the cases for those generic families) that the generic is used. In this case, the web designer would be violating the specifications, not my powerful browser that corrects the mistake automatically...

In any case, Safari has the same behavior... Great! So we can just close our eyes to the problem.
Comment 6 User image Khan Saab 2016-10-15 07:14:06 PDT Comment hidden (spam)
Comment 7 User image neel patel 2016-11-14 22:37:55 PST Comment hidden (spam)

Note You need to log in before you can comment on or make changes to this bug.