Avoid looking up empty font name in FontFaceCache

When document.fonts.load() is called with font specification such as
'1px ""' (containing two quotes) as the argument, CSS font property
parsing parses this successfully as the empty string. FontFaceCache
was not prepared to handle that correctly.

Fix FontFaceCache to guard against that. Add test to actually
ensure that this font specification's load promise resolves
successfully.

In parallel, raised
https://github.com/w3c/csswg-drafts/issues/4510
in CSS WG to discuss whether it would make sense to reject such
a font specification at the parsing stage already.

Bug: 1023206
Change-Id: If46aef0c7fcd2e06bc657480b9189857438d8cc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1914392
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715261}
diff --git a/css/css-font-loading/empty-family-load.html b/css/css-font-loading/empty-family-load.html
new file mode 100644
index 0000000..a2aa374
--- /dev/null
+++ b/css/css-font-loading/empty-family-load.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<link rel="author" title="Dominik Röttsches" href="drott@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-font-loading/#font-face-load">
+<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/4510">
+<meta name="assert" content="Ensure that an empty font family name loads and resolves to array." />
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+promise_test(function(t) {
+  var testFontFace = new FontFace('a', 'url(a)');
+  document.fonts.add(testFontFace);
+  return document.fonts.load("1px \"\"").then(function(result) {
+    assert_true(Array.isArray(result),
+                "Resolved promise's value must be an array.") });
+})
+</script>
+</html>