Bug 19085 - font-family: initial sets font-family differently than font: initial
Summary: font-family: initial sets font-family differently than font: initial
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction, InRadar
Depends on:
Blocks:
 
Reported: 2008-05-15 12:59 PDT by David Kilzer (:ddkilzer)
Modified: 2008-05-15 14:09 PDT (History)
2 users (show)

See Also:


Attachments
Test case (1.01 KB, text/html)
2008-05-15 13:00 PDT, David Kilzer (:ddkilzer)
no flags Details
Patch v1 (4.68 KB, patch)
2008-05-15 13:23 PDT, David Kilzer (:ddkilzer)
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2008-05-15 12:59:52 PDT
* SUMMARY
When using "font-family: initial" to style text, the font-family computed style differs from both using "font: initial" to style text and completely unstyled text.

* STEPS TO REPRODUCE
1. Launch Safari/WebKit.
2. Open attached test case.

* EXPECTED RESULTS
font-family: initial should have a computed font-family property value of "Times" (assuming the default Safari settings).

* ACTUAL RESULTS
font-family: initial has a computed font-family property value of "''" (that's two single quotes).

* REGRESSION
This is not a regression.  Safari 2.0.4 with original WebKit on Mac OS X 10.4.11 return the null value.
Comment 1 David Kilzer (:ddkilzer) 2008-05-15 13:00:17 PDT
Created attachment 21173 [details]
Test case
Comment 2 David Kilzer (:ddkilzer) 2008-05-15 13:05:19 PDT
<rdar://problem/5939391>
Comment 3 David Kilzer (:ddkilzer) 2008-05-15 13:23:52 PDT
Created attachment 21175 [details]
Patch v1

Proposed patch and test case.

Instead of checking !initialDesc.firstFamily().familyIsEmpty() (which is always true for a new FontDescription()), the line that sets the family could just be removed.  I figured this was slightly safer in case the FontDescription default constructor changed in the future.
Comment 4 David Kilzer (:ddkilzer) 2008-05-15 13:28:13 PDT
(In reply to comment #3)
> Instead of checking !initialDesc.firstFamily().familyIsEmpty() (which is always
> true for a new FontDescription()), the line that sets the family could just be
> removed.  I figured this was slightly safer in case the FontDescription default
> constructor changed in the future.

I should say initialDesc.firstFamily().familyIsEmpty() is always true (meaning the first family is always empty for a new FontDescription()).

Comment 5 Dave Hyatt 2008-05-15 13:59:31 PDT
Comment on attachment 21175 [details]
Patch v1

r=me
Comment 6 David Kilzer (:ddkilzer) 2008-05-15 14:09:51 PDT
Committed revision 33496.