mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 00:02:37 +00:00
Bug 875287 - font-family: Do not require whitespace between unquoted idents. r=dbaron
When 'font-family' is secified with unquoted identifiers rather than a quoted string, a single space should be inserted between identifier tokens, even if they are separated by a comment rather than a whitespace token.
This commit is contained in:
parent
c45c440206
commit
dd86ae8ef1
@ -0,0 +1,9 @@
|
||||
<!doctype html>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: Awesome font;
|
||||
src: url(../fonts/markA.ttf);
|
||||
}
|
||||
p { /* Default font */ }
|
||||
</style>
|
||||
<p>A
|
@ -0,0 +1,9 @@
|
||||
<!doctype html>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: Awesome font;
|
||||
src: url(../fonts/markA.ttf);
|
||||
}
|
||||
p { font-family: Awesome font }
|
||||
</style>
|
||||
<p>A
|
9
layout/reftests/font-face/font-familiy-whitespace-1.html
Normal file
9
layout/reftests/font-face/font-familiy-whitespace-1.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!doctype html>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: Awesome font;
|
||||
src: url(../fonts/markA.ttf);
|
||||
}
|
||||
p { font-family: Awesome/**/font }
|
||||
</style>
|
||||
<p>A
|
@ -141,6 +141,10 @@ fails-if(cocoaWidget) fails-if(winWidget) HTTP(..) != underline-offset-change-1-
|
||||
HTTP(..) != 534352-1-extra-cmap-sentinel.html 534352-1-extra-cmap-sentinel-ref.html
|
||||
HTTP(..) == bug533251.html bug533251-ref.html
|
||||
|
||||
# Bug 875287
|
||||
HTTP(..) == font-familiy-whitespace-1.html font-familiy-whitespace-1-ref.html
|
||||
HTTP(..) != font-familiy-whitespace-1.html font-familiy-whitespace-1-notref.html
|
||||
|
||||
skip-if(B2G) fails-if(Android) HTTP(..) == ivs-1.html ivs-1-ref.html # bug 773482
|
||||
|
||||
skip-if(B2G) HTTP(..) == missing-names.html missing-names-ref.html # bug 773482
|
||||
|
@ -9005,19 +9005,16 @@ CSSParserImpl::ParseOneFamily(nsAString& aFamily, bool& aOneKeyword)
|
||||
|
||||
if (eCSSToken_Ident == tk->mType) {
|
||||
aOneKeyword = false;
|
||||
// We had at least another keyword before.
|
||||
// "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."
|
||||
// -- CSS 2.1, section 15.3
|
||||
// Whitespace tokens do not actually matter,
|
||||
// identifier tokens can be separated by comments.
|
||||
aFamily.Append(PRUnichar(' '));
|
||||
aFamily.Append(tk->mIdent);
|
||||
} else if (eCSSToken_Whitespace == tk->mType) {
|
||||
// Lookahead one token and drop whitespace if we are ending the
|
||||
// font name.
|
||||
if (!GetToken(true))
|
||||
break;
|
||||
|
||||
UngetToken();
|
||||
if (eCSSToken_Ident == tk->mType)
|
||||
aFamily.Append(PRUnichar(' '));
|
||||
else
|
||||
break;
|
||||
} else {
|
||||
} else if (eCSSToken_Whitespace != tk->mType) {
|
||||
UngetToken();
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user