CSSParser::parseFontFamily should allow the keyword "default" as part of a font name
https://bugs.webkit.org/show_bug.cgi?id=107231
Reviewed by Ryosuke Niwa.
Source/WebCore:
Make sure that using the keyword "default" as font family doesn't
invalidate the whole declaration. It is also OK to use a font that
has "default" as part of a composite name (i.e. "default foo").
This matches the behavior of Firefox and IE.
Test: fast/css/font-family-parse-keyword.html
* css/CSSParser.cpp:
(WebCore::CSSParser::parseFontFamily):
LayoutTests:
* fast/css/font-family-parse-keyword-expected.html: Added.
* fast/css/font-family-parse-keyword.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/css/font-family-parse-keyword-expected.html b/LayoutTests/fast/css/font-family-parse-keyword-expected.html
new file mode 100644
index 0000000..7cfa0ff
--- /dev/null
+++ b/LayoutTests/fast/css/font-family-parse-keyword-expected.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<style>
+@font-face {
+ font-family: webkit-ahem;
+ src: url(../../resources/Ahem.ttf) format(truetype);
+}
+</style>
+<body>
+ <p>
+ https://bugs.webkit.org/b/107231 - CSSParser::parseFontFamily should allow
+ the keyword "default" as part of a font name
+ </p>
+ <p>
+ The next 4 lines should use the default font (same as this line):<br>
+ Test 1<br>
+ Test 2<br>
+ Test 3<br>
+ Test 4
+ </p>
+ <p>
+ The next 6 lines should use the font Arial:<br>
+ <span style="font-family: arial">
+ Test 1<br>
+ Test 2<br>
+ Test 3<br>
+ Test 4<br>
+ Test 5<br>
+ Test 6
+ </span>
+ </p>
+ <p>
+ The next 9 lines should use the font Ahem (black boxes):<br>
+ <span style="font-family: webkit-ahem">
+ Test 1<br>
+ Test 2<br>
+ Test 3<br>
+ Test 4<br>
+ Test 5<br>
+ Test 6<br>
+ Test 7<br>
+ Test 8<br>
+ Test 9
+ </span>
+ </p>
+</body>
+</html>