Closed Bug 585718 Opened 14 years ago Closed 14 years ago

nsCSSFontFaceStyleDecl::GetPropertyValue needs to handle -moz-font-feature-settings and -moz-font-language-override

Categories

(Core :: CSS Parsing and Computation, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: zwol, Assigned: jfkthame)

References

Details

Attachments

(1 file, 1 obsolete file)

nsCSSFontFaceStyleDecl::GetPropertyValue needs serialization code for the new -moz-font-feature-settings and -moz-font-language-override properties. nsCSSRules.cpp: In member function ‘nsresult nsCSSFontFaceStyleDecl::GetPropertyValue(nsCSSFontDesc, nsAString_internal&) const’: nsCSSRules.cpp:1613: warning: enumeration value ‘eCSSFontDesc_FontFeatureSettings’ not handled in switch nsCSSRules.cpp:1613: warning: enumeration value ‘eCSSFontDesc_FontLanguageOverride’ not handled in switch
Assignee: nobody → jfkthame
It looks like we can handle these exactly like the font-family descriptor here, I think. I've also added some basic tests to test_font_face_parser.html to verify that these descriptors are supported.
Attachment #465613 - Flags: review?
Attachment #465613 - Flags: review? → review?(dbaron)
Comment on attachment 465613 [details] [diff] [review] patch, v1 - add serialization support for new @font-face descriptors Close, but not quite; these two properties can also be eCSSUnit_Normal. That would trigger the assertion in this case. That said, I think the ideal thing to do here would be to have an array of properties somewhere that lines up with the enum values in nsCSSFontDesc (with eCSSProperty_UNKNOWN for src), and then use the code that's used here for _style, _weight, etc. for all descriptors except Src. That code is nice because it's reasonably general and should handle future changes, etc., without people noticing the issue here.
Attachment #465613 - Flags: review?(dbaron) → review-
(And you should add a test of 'normal' to your tests, too.)
I think both family and src need to be an exception, actually; family has a eCSSUnit_String vs. eCSSUnit_Families issue.
Or it's ok if you just add two more cases like the existing Style/Weight/Stretch cases.
Attachment #465613 - Attachment is obsolete: true
Attachment #467401 - Flags: review?(dbaron)
Comment on attachment 467401 [details] [diff] [review] patch, v2 - updated as per comment 5 r=dbaron
Attachment #467401 - Flags: review?(dbaron) → review+
Comment on attachment 467401 [details] [diff] [review] patch, v2 - updated as per comment 5 Requesting approval to land this on trunk. It's basically a missing piece of the CSS font feature support that already landed in bug 511339. There should be no risk to any other aspect of functionality.
Attachment #467401 - Flags: approval2.0?
Attachment #467401 - Flags: approval2.0? → approval2.0+
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: