Closed Bug 875287 Opened 11 years ago Closed 11 years ago

Whitespace tokens in font-family parsing

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: SimonSapin, Assigned: SimonSapin)

Details

Attachments

(1 file, 2 obsolete files)

From CSS 2.1, http://www.w3.org/TR/CSS21/fonts.html#font-family-prop

# Font family names must either be given quoted as strings,
# or unquoted as a sequence of one or more identifiers. […]
#
# If a sequence of identifiers is given as a font family name,
# the computed value is the name converted to a string by joining
# all the identifiers in the sequence by single spaces.

Identifiers tokens can be separated by comments, whitout whitespace.
For example, 'font-family: Fontin/**/Sans' should parse the same as 'font-family: Fontin Sans',
but doesn’t with a recent mozilla-central build.

I have a patch to fix this, but I’m adding some tests before submitting.
The patch only affects ParseOneFamily in nsCSSParser.cpp 
and should apply independently of bug 280443.
Attached patch Proposed fix, with a reftest (obsolete) — Splinter Review
Attachment #753618 - Flags: review?(dbaron)
Comment on attachment 753618 [details] [diff] [review]
Proposed fix, with a reftest

Seems like a good test to contribute to the CSS 2.1 or css3-fonts test suite.

Also, perhaps rename the test to font-family-whitespace-1 or something like that?  (I dislike bug numbers in test filenames.)  That's easy to fix by search-replacing the patch.

r=dbaron
Attachment #753618 - Flags: review?(dbaron) → review+
Attachment #753618 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/f2488e956bc6
Assignee: nobody → simon.sapin
Flags: in-testsuite+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/f2488e956bc6
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: