Escaped leading whitespace ignored in font names

RESOLVED FIXED in mozilla33

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
10 years ago
10 months ago

People

(Reporter: Eli Friedman, Assigned: jtd)

Tracking

Trunk
mozilla33
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

10 years ago
<!DOCTYPE html>
<style>
.a {font-family: \a\9\20Arial}
</style>
<div class="a">b</div>

The letter should be rendered in Arial, not the default font.  See Bug 384679 comment 1.

Comment 1

10 years ago
The rules of escaped characters hold --> http://www.w3.org/TR/CSS21/syndata.html

\20A is the escaped sequence, rather than \20 .

so you have 
\a ==> line feed ==> chop that leading space character in the font identifier
\9 ==> tab  ==> chop it too
\20A ==> hexadecimal digit 20A. We don't chop that.

and I think you are left with a font family called "522rial", which you don't likely have.

 
Comment 1 is correct.  ->invalid
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → INVALID
Indeed, 'font-family: \20Arial' will parse as Ȋrial where Ȋ is U+020A. But 'font-family: \20 Arial' does produce an identifier whose parsed value starts with a space that should not be removed. See bug 384679
Flags: needinfo?(dbaron)
indeed
Status: RESOLVED → REOPENED
Depends on: 280443
Flags: needinfo?(dbaron)
Resolution: INVALID → ---
Summary: Escaped leading whitespace not ignored in font names → Escaped leading whitespace ignored in font names
Did bug 280443 fix this?
(Assignee)

Comment 6

3 years ago
Created attachment 8447826 [details] [diff] [review]
patch, add reftest for escaped font family names

This appears to be fixed by bug 280443.
Attachment #8447826 - Flags: review?(simon.sapin)
(Assignee)

Comment 7

3 years ago
Created attachment 8447869 [details] [diff] [review]
patch, add reftest for escaped font family names

Adding reftest for the escaped trailing space case too.
Attachment #8447826 - Attachment is obsolete: true
Attachment #8447826 - Flags: review?(simon.sapin)
Attachment #8447869 - Flags: review?(simon.sapin)
Comment on attachment 8447869 [details] [diff] [review]
patch, add reftest for escaped font family names

Review of attachment 8447869 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.
Attachment #8447869 - Flags: review?(simon.sapin) → review+
Keywords: checkin-needed
Can we please run this test through Try to make sure there aren't any surprises lurking? :)
Keywords: checkin-needed
(Assignee)

Comment 10

3 years ago
Tryserver run:
https://tbpl.mozilla.org/?tree=Try&rev=4ae96a1766ca
(Assignee)

Comment 11

3 years ago
Pushed to inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8e851f64e99f
https://hg.mozilla.org/mozilla-central/rev/8e851f64e99f
Assignee: nobody → jdaggett
Status: REOPENED → RESOLVED
Last Resolved: 10 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33

Updated

10 months ago
See Also: → bug 1309425
You need to log in before you can comment on or make changes to this bug.