The default bug view has changed. See this FAQ.

Whitespace tokens in font-family parsing

RESOLVED FIXED in mozilla24

Status

()

Core
CSS Parsing and Computation
--
minor
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: SimonSapin, Assigned: SimonSapin)

Tracking

Trunk
mozilla24
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

4 years ago
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.
(Assignee)

Comment 1

4 years ago
Created attachment 753618 [details] [diff] [review]
Proposed fix, with a reftest
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+
(Assignee)

Comment 3

4 years ago
Created attachment 753751 [details] [diff] [review]
Same patch, with filenames changed per dbaron’s comment
Attachment #753618 - Attachment is obsolete: true
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
(Assignee)

Comment 4

4 years ago
Created attachment 755206 [details] [diff] [review]
Same patch with a better commit message, including r=dbaron
Attachment #753751 - Attachment is obsolete: true
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
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.