Remove font-variant @font-face descriptor
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Nov 2019 03:56:06 +0000 (03:56 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Nov 2019 03:56:06 +0000 (03:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=203179

Reviewed by Simon Fraser.

Source/WebCore:

As per https://github.com/w3c/csswg-drafts/issues/2531

Deleted relevant tests.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::font):
(WebCore::CSSFontFace::setVariantLigatures): Deleted.
(WebCore::CSSFontFace::setVariantPosition): Deleted.
(WebCore::CSSFontFace::setVariantCaps): Deleted.
(WebCore::CSSFontFace::setVariantNumeric): Deleted.
(WebCore::CSSFontFace::setVariantAlternates): Deleted.
(WebCore::CSSFontFace::setVariantEastAsian): Deleted.
* css/CSSFontFace.h:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
(WebCore::CSSFontFaceSource::font):
* css/CSSFontFaceSource.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/FontFace.cpp:
(WebCore::FontFace::create):
(WebCore::FontFace::setVariant): Deleted.
(WebCore::FontFace::variant const): Deleted.
* css/FontFace.h:
* css/FontFace.idl:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::createFont):
(WebCore::CachedFont::platformDataFromCustomData):
* loader/cache/CachedFont.h:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::createFont):
(WebCore::CachedSVGFont::platformDataFromCustomData):
* loader/cache/CachedSVGFont.h:
* platform/graphics/FontCache.cpp:
(WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
(WebCore::FontPlatformDataCacheKey::operator== const):
(WebCore::FontPlatformDataCacheKeyHash::hash):
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::fontForFamily):
* platform/graphics/FontCache.h:
(WebCore::FontCache::fontForFamily):
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::createFontPlatformDataForTesting):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/cocoa/FontCacheCoreText.h:
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::fontRanges const):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/mac/FontCustomPlatformData.h:

LayoutTests:

Delete tests for the removed feature.

* css3/font-variant-font-face-all-expected.html: Deleted.
* css3/font-variant-font-face-all.html: Deleted.
* css3/font-variant-font-face-override-expected.html:
* css3/font-variant-font-face-override.html:
* fast/text/font-face-empty-string-expected.txt:
* fast/text/font-face-empty-string.html:
* fast/text/font-face-javascript-expected.txt:
* fast/text/font-face-javascript.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252760 268f45cc-cd09-0410-ab3c-d52691b4dbfc

40 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/font-variant-font-face-all-expected.html [deleted file]
LayoutTests/css3/font-variant-font-face-all.html [deleted file]
LayoutTests/css3/font-variant-font-face-override-expected.html
LayoutTests/css3/font-variant-font-face-override.html
LayoutTests/fast/text/font-face-empty-string-expected.txt
LayoutTests/fast/text/font-face-empty-string.html
LayoutTests/fast/text/font-face-javascript-expected.txt
LayoutTests/fast/text/font-face-javascript.html
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
LayoutTests/platform/wpe/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSFontFace.h
Source/WebCore/css/CSSFontFaceSource.cpp
Source/WebCore/css/CSSFontFaceSource.h
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/FontFace.cpp
Source/WebCore/css/FontFace.h
Source/WebCore/css/FontFace.idl
Source/WebCore/loader/cache/CachedFont.cpp
Source/WebCore/loader/cache/CachedFont.h
Source/WebCore/loader/cache/CachedSVGFont.cpp
Source/WebCore/loader/cache/CachedSVGFont.h
Source/WebCore/platform/graphics/FontCache.cpp
Source/WebCore/platform/graphics/FontCache.h
Source/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h
Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp
Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h
Source/WebCore/platform/graphics/win/FontCacheWin.cpp
Source/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
Source/WebCore/platform/graphics/win/FontCustomPlatformData.h
Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp

index c3aa7d8..ae7395f 100644 (file)
@@ -1,3 +1,21 @@
+2019-11-21  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Remove font-variant @font-face descriptor
+        https://bugs.webkit.org/show_bug.cgi?id=203179
+
+        Reviewed by Simon Fraser.
+
+        Delete tests for the removed feature.
+
+        * css3/font-variant-font-face-all-expected.html: Deleted.
+        * css3/font-variant-font-face-all.html: Deleted.
+        * css3/font-variant-font-face-override-expected.html:
+        * css3/font-variant-font-face-override.html:
+        * fast/text/font-face-empty-string-expected.txt:
+        * fast/text/font-face-empty-string.html:
+        * fast/text/font-face-javascript-expected.txt:
+        * fast/text/font-face-javascript.html:
+
 2019-11-21  Yusuke Suzuki  <ysuzuki@apple.com>
 
         Unreviewed, rolling in again, regression is not caused by it
diff --git a/LayoutTests/css3/font-variant-font-face-all-expected.html b/LayoutTests/css3/font-variant-font-face-all-expected.html
deleted file mode 100644 (file)
index 7441493..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-@font-face {
-    font-family: "FontFeaturesTestOTF";
-    src: url("resources/FontWithFeatures.otf") format("opentype");
-}
-@font-face {
-    font-family: "FontFeaturesTestTTF";
-    src: url("resources/FontWithFeatures.ttf") format("truetype");
-}
-.fontWithFeaturesTTF {
-    font-family: "FontWithFeaturesTTF";
-}
-</style>
-</head>
-<body>
-<p>This test is a dump-render-tree test which makes sure that the following properties are appropriately applied:</p>
-<ul>
-<li>-webkit-font-variant-ligatures</li>
-<li>-webkit-font-variant-position</li>
-<li>-webkit-font-variant-caps</li>
-<li>-webkit-font-variant-numeric</li>
-<li>-webkit-font-variant-alternates</li>
-<li>-webkit-font-variant-east-asian</li>
-</ul>
-The test passes if there is a particular sequence of checks and x characters below. Note that some x characters are expected.
-<div id="insertionpoint"><span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">BB</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">BB</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">BB</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">BB</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-</div>
-<div id="insertionPoint2"><span style="font-family: FontFeaturesTestTTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">BB</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">BB</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">BB</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">BB</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-<span style="font-family: FontFeaturesTestOTF;">AA</span>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/css3/font-variant-font-face-all.html b/LayoutTests/css3/font-variant-font-face-all.html
deleted file mode 100644 (file)
index 745fd26..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-</head>
-<body>
-<p>This test is a dump-render-tree test which makes sure that the following properties are appropriately applied:</p>
-<ul>
-<li>-webkit-font-variant-ligatures</li>
-<li>-webkit-font-variant-position</li>
-<li>-webkit-font-variant-caps</li>
-<li>-webkit-font-variant-numeric</li>
-<li>-webkit-font-variant-alternates</li>
-<li>-webkit-font-variant-east-asian</li>
-</ul>
-The test passes if there is a particular sequence of checks and x characters below. Note that some x characters are expected.
-<div id="insertionPoint"></div>
-<div id="insertionPoint2"></div>
-<script>
-var insertionPoint = document.getElementById("insertionPoint");
-var insertionPoint2 = document.getElementById("insertionPoint2");
-
-var styleNode = document.createElement("style");
-document.head.appendChild(styleNode);
-
-function addElement(pointToInsert, fontFamily, extension, format, property, value, text) {
-    styleNode.sheet.insertRule("@font-face { font-family: " + fontFamily + "_" + property + "_" + value + "; src: url('resources/FontWithFeatures." + extension + "') format('" + format + "'); " + property + ": " + value + "; }", 0);
-    var element = document.createElement("span");
-    element.textContent = text + text;
-    element.style.fontFamily = fontFamily + "_" + property + "_" + value;
-    pointToInsert.appendChild(element);
-    pointToInsert.appendChild(document.createTextNode(" "));
-}
-
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "common-ligatures", "C");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-common-ligatures", "C");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "discretionary-ligatures", "E");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-discretionary-ligatures", "E");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "historical-ligatures", "F");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-historical-ligatures", "F");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "contextual", "G");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-contextual", "G");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-position", "sub", "H");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-position", "super", "I");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "small-caps", "J");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "all-small-caps", "J");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "petite-caps", "L");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "all-petite-caps", "L");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "unicase", "N");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "titling-caps", "O");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "lining-nums", "P");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "oldstyle-nums", "Q");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "proportional-nums", "R");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "tabular-nums", "S");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "diagonal-fractions", "T");
-//addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "stacked-fractions", "U");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "ordinal", "V");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "slashed-zero", "W");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-alternates", "historical-forms", "X");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis78", "Y");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis83", "Z");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis90", "a");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis04", "b");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "simplified", "c");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "traditional", "d");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "full-width", "e");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "proportional-width", "f");
-addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "ruby", "g");
-
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "common-ligatures", "C");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-common-ligatures", "C");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "discretionary-ligatures", "G");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-discretionary-ligatures", "G");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "historical-ligatures", "I");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-historical-ligatures", "I");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "contextual", "L");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-contextual", "L");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-position", "sub", "O");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-position", "super", "P");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "small-caps", "S");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "all-small-caps", "S");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "petite-caps", "T");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "all-petite-caps", "T");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "unicase", "Y");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "titling-caps", "a");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "lining-nums", "c");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "oldstyle-nums", "d");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "proportional-nums", "f");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "tabular-nums", "g");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "diagonal-fractions", "i");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "stacked-fractions", "j");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "ordinal", "Q");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "slashed-zero", "k");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-alternates", "historical-forms", "K");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis78", "m");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis83", "n");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis90", "o");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis04", "p");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "simplified", "q");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "traditional", "r");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "full-width", "t");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "proportional-width", "u");
-addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "ruby", "v");
-</script>
-</body>
-</html>
index a9414ba..ade6fce 100644 (file)
 This test makes sure that local font feature styles can override the font feature styles declared in @font-face blocks.
 <div style="font: 40px FontFeaturesTestOTF;">AA</div>
 <div style="font: 40px FontFeaturesTestOTF;">BB</div>
-<div style="font: 40px FontFeaturesTestOTF;">AA</div>
-<div style="font: 40px FontFeaturesTestOTF;">BB</div>
-<div style="font: 40px FontFeaturesTestTTF;">AA</div>
-<div style="font: 40px FontFeaturesTestTTF;">BB</div>
 <div style="font: 40px FontFeaturesTestTTF;">AA</div>
 <div style="font: 40px FontFeaturesTestTTF;">BB</div>
 </body>
-</html>
\ No newline at end of file
+</html>
index fce2b02..934dff3 100644 (file)
@@ -8,31 +8,17 @@
     font-feature-settings: "titl" 1;
 }
 @font-face {
-    font-family: "FontFeaturesTestOTF2";
-    src: url("resources/FontWithFeatures.otf") format("opentype");
-    font-variant-caps: titling-caps;
-}
-@font-face {
     font-family: "FontFeaturesTestTTF";
     src: url("resources/FontWithFeatures.ttf") format("truetype");
     font-feature-settings: "titl" 1;
 }
-@font-face {
-    font-family: "FontFeaturesTestTTF2";
-    src: url("resources/FontWithFeatures.ttf") format("truetype");
-    font-variant-caps: titling-caps;
-}
 </style>
 </head>
 <body>
 This test makes sure that local font feature styles can override the font feature styles declared in @font-face blocks.
 <div style="font: 40px FontFeaturesTestOTF;">OO</div>
 <div style="font: 40px FontFeaturesTestOTF; font-feature-settings: 'titl' 0;">OO</div>
-<div style="font: 40px FontFeaturesTestOTF2;">OO</div>
-<div style="font: 40px FontFeaturesTestOTF2; font-feature-settings: 'titl' 0;">OO</div>
 <div style="font: 40px FontFeaturesTestTTF;">aa</div>
 <div style="font: 40px FontFeaturesTestTTF; font-feature-settings: 'titl' 0;">aa</div>
-<div style="font: 40px FontFeaturesTestTTF2;">aa</div>
-<div style="font: 40px FontFeaturesTestTTF2; font-feature-settings: 'titl' 0;">aa</div>
 </body>
-</html>
\ No newline at end of file
+</html>
index 8f7cce3..7975d41 100644 (file)
@@ -12,9 +12,6 @@ PASS fontface.weight = '' threw exception SyntaxError: The string did not match
 PASS fontface = new FontFace('WebFont', 'url(\'asdf\')', {unicodeRange: ''}) did not throw exception.
 PASS fontface.unicodeRange is "U+0-10ffff"
 PASS fontface.unicodeRange = '' threw exception SyntaxError: The string did not match the expected pattern..
-PASS fontface = new FontFace('WebFont', 'url(\'asdf\')', {variant: ''}) did not throw exception.
-PASS fontface.variant is "normal"
-PASS fontface.variant = '' threw exception SyntaxError: The string did not match the expected pattern..
 PASS fontface = new FontFace('WebFont', 'url(\'asdf\')', {featureSettings: ''}) did not throw exception.
 PASS fontface.featureSettings is "normal"
 PASS fontface.featureSettings = '' threw exception SyntaxError: The string did not match the expected pattern..
index 0a90e1c..31ed662 100644 (file)
@@ -17,9 +17,6 @@ shouldThrow("fontface.weight = ''");
 shouldNotThrow("fontface = new FontFace('WebFont', 'url(\\\'asdf\\\')', {unicodeRange: ''})");
 shouldBeEqualToString("fontface.unicodeRange", "U+0-10ffff");
 shouldThrow("fontface.unicodeRange = ''");
-shouldNotThrow("fontface = new FontFace('WebFont', 'url(\\\'asdf\\\')', {variant: ''})");
-shouldBeEqualToString("fontface.variant", "normal");
-shouldThrow("fontface.variant = ''");
 shouldNotThrow("fontface = new FontFace('WebFont', 'url(\\\'asdf\\\')', {featureSettings: ''})");
 shouldBeEqualToString("fontface.featureSettings", "normal");
 shouldThrow("fontface.featureSettings = ''");
@@ -28,4 +25,4 @@ shouldThrow("fontface.family = ''");
 </script>
 <script src="../../resources/js-test-post.js"></script>
 </body>
-</html>
\ No newline at end of file
+</html>
index 71cda7a..bd5285d 100644 (file)
@@ -3,7 +3,6 @@ PASS new FontFace('family_name', 'url(\'asdf\')', {}).style is "normal"
 PASS new FontFace('family_name', 'url(\'asdf\')', {}).weight is "normal"
 PASS new FontFace('family_name', 'url(\'asdf\')', {}).stretch is "normal"
 PASS new FontFace('family_name', 'url(\'asdf\')', {}).unicodeRange is "U+0-10ffff"
-PASS new FontFace('family_name', 'url(\'asdf\')', {}).variant is "normal"
 PASS new FontFace('family_name', 'url(\'asdf\')', {}).featureSettings is "normal"
 PASS new FontFace('family_name', 'url(\'asdf\')', {'style': 'normal'}).style is "normal"
 PASS new FontFace('family_name', 'url(\'asdf\')', {'style': 'inherit'}).style threw exception SyntaxError: The string did not match the expected pattern..
@@ -19,22 +18,17 @@ PASS new FontFace('family_name', 'url(\'asdf\')', {'weight': 'inherit'}).weight
 PASS new FontFace('family_name', 'url(\'asdf\')', {'stretch': 'ultra-expanded'}).stretch is "ultra-expanded"
 PASS new FontFace('family_name', 'url(\'asdf\')', {'unicodeRange': 'U+26'}).unicodeRange is "U+26"
 PASS new FontFace('family_name', 'url(\'asdf\')', {'unicodeRange': 'U+0-7F'}).unicodeRange is "U+0-7f"
-PASS new FontFace('family_name', 'url(\'asdf\')', {'variant': 'variant_name'}).variant threw exception SyntaxError: The string did not match the expected pattern..
-PASS new FontFace('family_name', 'url(\'asdf\')', {'variant': 'small-caps'}).variant is "small-caps"
-PASS new FontFace('family_name', 'url(\'asdf\')', {'variant': 'small-caps common-ligatures'}).variant is "common-ligatures small-caps"
 PASS new FontFace('family_name', 'url(\'asdf\')', {'featureSettings': '\'titl\''}).featureSettings is "\"titl\""
 PASS everything.style is "italic"
 PASS everything.weight is "bold"
 PASS everything.stretch is "extra-expanded"
 PASS everything.unicodeRange is "U+26"
-PASS everything.variant is "small-caps"
 PASS everything.featureSettings is "\"titl\""
 PASS everything.family is "other_family_name"
 PASS everything.style is "normal"
 PASS everything.weight is "300"
 PASS everything.stretch is "condensed"
 PASS everything.unicodeRange is "U+0-7f"
-PASS everything.variant is "stacked-fractions"
 PASS everything.featureSettings is "\"smcp\""
 PASS new FontFace('family_name', 'url(\'asdf\')', {}) did not throw exception.
 PASS new FontFace('family_name', newArrayBuffer, {}) did not throw exception.
index e3446db..e8c555c 100644 (file)
@@ -10,7 +10,6 @@ shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {}).style"
 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {}).weight", "normal");
 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {}).stretch", "normal");
 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {}).unicodeRange", "U+0-10ffff");
-shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {}).variant", "normal");
 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {}).featureSettings", "normal");
 
 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'style': 'normal'}).style", "normal");
@@ -27,17 +26,13 @@ shouldThrow("new FontFace('family_name', 'url(\\'asdf\\')', {'weight': 'inherit'
 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'stretch': 'ultra-expanded'}).stretch", "ultra-expanded");
 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'unicodeRange': 'U+26'}).unicodeRange", "U+26");
 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'unicodeRange': 'U+0-7F'}).unicodeRange", "U+0-7f");
-shouldThrow("new FontFace('family_name', 'url(\\'asdf\\')', {'variant': 'variant_name'}).variant");
-shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'variant': 'small-caps'}).variant", "small-caps");
-shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'variant': 'small-caps common-ligatures'}).variant", "common-ligatures small-caps");
 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'featureSettings': '\\'titl\\''}).featureSettings", "\"titl\"");
 
-var everything = new FontFace('family_name', 'url(\'asdf\')', {'style': 'italic', 'weight': 'bold', 'stretch': 'extra-expanded', 'unicodeRange': 'U+26', 'variant': 'small-caps', 'featureSettings': '\'titl\''});
+var everything = new FontFace('family_name', 'url(\'asdf\')', {'style': 'italic', 'weight': 'bold', 'stretch': 'extra-expanded', 'unicodeRange': 'U+26', 'featureSettings': '\'titl\''});
 shouldBeEqualToString("everything.style", "italic");
 shouldBeEqualToString("everything.weight", "bold");
 shouldBeEqualToString("everything.stretch", "extra-expanded");
 shouldBeEqualToString("everything.unicodeRange", "U+26");
-shouldBeEqualToString("everything.variant", "small-caps");
 shouldBeEqualToString("everything.featureSettings", "\"titl\"");
 
 everything.family = "other_family_name";
@@ -50,8 +45,6 @@ everything.stretch = "condensed";
 shouldBeEqualToString("everything.stretch", "condensed");
 everything.unicodeRange = "U+0-7F";
 shouldBeEqualToString("everything.unicodeRange", "U+0-7f");
-everything.variant = "stacked-fractions";
-shouldBeEqualToString("everything.variant", "stacked-fractions");
 everything.featureSettings = "'smcp'";
 shouldBeEqualToString("everything.featureSettings", "\"smcp\"");
 
index 862fc5c..58aab7d 100644 (file)
@@ -846,7 +846,6 @@ webkit.org/b/152618 fast/text/international/system-language/declarative-language
 
 # This port doesn't support small-caps synthesis.
 webkit.org/b/152620 css3/font-variant-all.html [ ImageOnlyFailure ]
-webkit.org/b/152620 css3/font-variant-font-face-all.html [ ImageOnlyFailure ]
 webkit.org/b/152620 css3/font-variant-font-face-override.html [ ImageOnlyFailure ]
 webkit.org/b/152620 css3/font-variant-petite-caps-synthesis-coverage.html [ ImageOnlyFailure ]
 webkit.org/b/152620 css3/font-variant-petite-caps-synthesis.html [ ImageOnlyFailure ]
index 8561639..e34f9d0 100644 (file)
@@ -529,7 +529,6 @@ fast/css/draggable-region-parser.html [ Skip ]
 css3/font-feature-settings-rendering.html [ Skip ]
 
 webkit.org/b/149771 css3/font-feature-settings-font-face-rendering.html [ Skip ] # WontFix
-webkit.org/b/149771 css3/font-variant-font-face-all.html [ Skip ] # WontFix
 webkit.org/b/149771 css3/font-variant-font-face-override.html [ Skip ] # WontFix
 webkit.org/b/149774 css3/font-variant-petite-caps-synthesis-coverage.html [ Skip ] # WontFix
 webkit.org/b/149774 css3/font-variant-petite-caps-synthesis.html [ Skip ] # WontFix
index 99af270..9c133c5 100644 (file)
@@ -1172,7 +1172,6 @@ css3/font-variant-synthesis-jdaggett.html [ ImageOnlyFailure ]
 # Font feature settings is not implemented.
 css3/font-feature-settings-rendering.html [ Skip ]
 webkit.org/b/149771 css3/font-feature-settings-font-face-rendering.html [ Skip ]
-webkit.org/b/149771 css3/font-variant-font-face-all.html [ Skip ]
 webkit.org/b/149771 css3/font-variant-font-face-override.html [ Skip ]
 webkit.org/b/149774 css3/font-variant-petite-caps-synthesis-coverage.html [ Skip ]
 webkit.org/b/149774 css3/font-variant-petite-caps-synthesis.html [ Skip ]
index c532f96..5ffeb6c 100644 (file)
@@ -1585,7 +1585,6 @@ Bug(WPE) css3/font-feature-settings-font-face-rendering.html [ ImageOnlyFailure
 Bug(WPE) css3/font-feature-settings-rendering.html [ ImageOnlyFailure ]
 Bug(WPE) css3/font-synthesis-small-caps.html [ ImageOnlyFailure ]
 Bug(WPE) css3/font-variant-all.html [ ImageOnlyFailure ]
-Bug(WPE) css3/font-variant-font-face-all.html [ ImageOnlyFailure ]
 Bug(WPE) css3/font-variant-font-face-override.html [ ImageOnlyFailure ]
 Bug(WPE) css3/font-variant-petite-caps-synthesis-coverage.html [ ImageOnlyFailure ]
 Bug(WPE) css3/font-variant-petite-caps-synthesis.html [ ImageOnlyFailure ]
index 1afff4d..90992f0 100644 (file)
@@ -1,3 +1,65 @@
+2019-11-21  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Remove font-variant @font-face descriptor
+        https://bugs.webkit.org/show_bug.cgi?id=203179
+
+        Reviewed by Simon Fraser.
+
+        As per https://github.com/w3c/csswg-drafts/issues/2531
+
+        Deleted relevant tests.
+
+        * css/CSSFontFace.cpp:
+        (WebCore::CSSFontFace::font):
+        (WebCore::CSSFontFace::setVariantLigatures): Deleted.
+        (WebCore::CSSFontFace::setVariantPosition): Deleted.
+        (WebCore::CSSFontFace::setVariantCaps): Deleted.
+        (WebCore::CSSFontFace::setVariantNumeric): Deleted.
+        (WebCore::CSSFontFace::setVariantAlternates): Deleted.
+        (WebCore::CSSFontFace::setVariantEastAsian): Deleted.
+        * css/CSSFontFace.h:
+        * css/CSSFontFaceSource.cpp:
+        (WebCore::CSSFontFaceSource::load):
+        (WebCore::CSSFontFaceSource::font):
+        * css/CSSFontFaceSource.h:
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule):
+        * css/FontFace.cpp:
+        (WebCore::FontFace::create):
+        (WebCore::FontFace::setVariant): Deleted.
+        (WebCore::FontFace::variant const): Deleted.
+        * css/FontFace.h:
+        * css/FontFace.idl:
+        * loader/cache/CachedFont.cpp:
+        (WebCore::CachedFont::createFont):
+        (WebCore::CachedFont::platformDataFromCustomData):
+        * loader/cache/CachedFont.h:
+        * loader/cache/CachedSVGFont.cpp:
+        (WebCore::CachedSVGFont::createFont):
+        (WebCore::CachedSVGFont::platformDataFromCustomData):
+        * loader/cache/CachedSVGFont.h:
+        * platform/graphics/FontCache.cpp:
+        (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
+        (WebCore::FontPlatformDataCacheKey::operator== const):
+        (WebCore::FontPlatformDataCacheKeyHash::hash):
+        (WebCore::FontCache::getCachedFontPlatformData):
+        (WebCore::FontCache::fontForFamily):
+        * platform/graphics/FontCache.h:
+        (WebCore::FontCache::fontForFamily):
+        (WebCore::FontCache::getCachedFontPlatformData):
+        (WebCore::FontCache::createFontPlatformDataForTesting):
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::preparePlatformFont):
+        (WebCore::fontWithFamily):
+        (WebCore::FontCache::createFontPlatformData):
+        (WebCore::FontCache::systemFallbackForCharacters):
+        * platform/graphics/cocoa/FontCacheCoreText.h:
+        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
+        (WebCore::FontFamilySpecificationCoreText::fontRanges const):
+        * platform/graphics/mac/FontCustomPlatformData.cpp:
+        (WebCore::FontCustomPlatformData::fontPlatformData):
+        * platform/graphics/mac/FontCustomPlatformData.h:
+
 2019-11-21  Peng Liu  <peng.liu6@apple.com>
 
         Ignore the requests to enter/exit video fullscreen/picture-in-picture if the requesting mode is the same as the current mode
index 982973a..2d429bc 100644 (file)
@@ -40,7 +40,6 @@
 #include "FontCache.h"
 #include "FontDescription.h"
 #include "FontFace.h"
-#include "FontVariantBuilder.h"
 #include "Settings.h"
 #include "StyleBuilderConverter.h"
 #include "StyleProperties.h"
@@ -278,147 +277,6 @@ bool CSSFontFace::setUnicodeRange(CSSValue& unicodeRange)
     return true;
 }
 
-bool CSSFontFace::setVariantLigatures(CSSValue& variantLigatures)
-{
-    auto ligatures = extractFontVariantLigatures(variantLigatures);
-
-    if (m_variantSettings.commonLigatures == ligatures.commonLigatures
-        && m_variantSettings.discretionaryLigatures == ligatures.discretionaryLigatures
-        && m_variantSettings.historicalLigatures == ligatures.historicalLigatures
-        && m_variantSettings.contextualAlternates == ligatures.contextualAlternates)
-        return true;
-
-    m_variantSettings.commonLigatures = ligatures.commonLigatures;
-    m_variantSettings.discretionaryLigatures = ligatures.discretionaryLigatures;
-    m_variantSettings.historicalLigatures = ligatures.historicalLigatures;
-    m_variantSettings.contextualAlternates = ligatures.contextualAlternates;
-
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantLigatures, &variantLigatures);
-
-    iterateClients(m_clients, [&](Client& client) {
-        client.fontPropertyChanged(*this);
-    });
-
-    return true;
-}
-
-bool CSSFontFace::setVariantPosition(CSSValue& variantPosition)
-{
-    if (!is<CSSPrimitiveValue>(variantPosition))
-        return false;
-
-    FontVariantPosition position = downcast<CSSPrimitiveValue>(variantPosition);
-
-    if (m_variantSettings.position == position)
-        return true;
-
-    m_variantSettings.position = position;
-
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantPosition, &variantPosition);
-
-    iterateClients(m_clients, [&](Client& client) {
-        client.fontPropertyChanged(*this);
-    });
-
-    return true;
-}
-
-bool CSSFontFace::setVariantCaps(CSSValue& variantCaps)
-{
-    if (!is<CSSPrimitiveValue>(variantCaps))
-        return false;
-
-    FontVariantCaps caps = downcast<CSSPrimitiveValue>(variantCaps);
-
-    if (m_variantSettings.caps == caps)
-        return true;
-
-    m_variantSettings.caps = caps;
-
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantCaps, &variantCaps);
-
-    iterateClients(m_clients, [&](Client& client) {
-        client.fontPropertyChanged(*this);
-    });
-
-    return true;
-}
-
-bool CSSFontFace::setVariantNumeric(CSSValue& variantNumeric)
-{
-    auto numeric = extractFontVariantNumeric(variantNumeric);
-
-    if (m_variantSettings.numericFigure == numeric.figure
-        && m_variantSettings.numericSpacing == numeric.spacing
-        && m_variantSettings.numericFraction == numeric.fraction
-        && m_variantSettings.numericOrdinal == numeric.ordinal
-        && m_variantSettings.numericSlashedZero == numeric.slashedZero)
-        return true;
-
-    m_variantSettings.numericFigure = numeric.figure;
-    m_variantSettings.numericSpacing = numeric.spacing;
-    m_variantSettings.numericFraction = numeric.fraction;
-    m_variantSettings.numericOrdinal = numeric.ordinal;
-    m_variantSettings.numericSlashedZero = numeric.slashedZero;
-
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantNumeric, &variantNumeric);
-
-    iterateClients(m_clients, [&](Client& client) {
-        client.fontPropertyChanged(*this);
-    });
-
-    return true;
-}
-
-bool CSSFontFace::setVariantAlternates(CSSValue& variantAlternates)
-{
-    if (!is<CSSPrimitiveValue>(variantAlternates))
-        return false;
-
-    FontVariantAlternates alternates = downcast<CSSPrimitiveValue>(variantAlternates);
-
-    if (m_variantSettings.alternates == alternates)
-        return true;
-
-    m_variantSettings.alternates = alternates;
-
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantAlternates, &variantAlternates);
-
-    iterateClients(m_clients, [&](Client& client) {
-        client.fontPropertyChanged(*this);
-    });
-
-    return true;
-}
-
-bool CSSFontFace::setVariantEastAsian(CSSValue& variantEastAsian)
-{
-    auto eastAsian = extractFontVariantEastAsian(variantEastAsian);
-
-    if (m_variantSettings.eastAsianVariant == eastAsian.variant
-        && m_variantSettings.eastAsianWidth == eastAsian.width
-        && m_variantSettings.eastAsianRuby == eastAsian.ruby)
-        return true;
-
-    m_variantSettings.eastAsianVariant = eastAsian.variant;
-    m_variantSettings.eastAsianWidth = eastAsian.width;
-    m_variantSettings.eastAsianRuby = eastAsian.ruby;
-
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantEastAsian, &variantEastAsian);
-
-    iterateClients(m_clients, [&](Client& client) {
-        client.fontPropertyChanged(*this);
-    });
-
-    return true;
-}
-
 void CSSFontFace::setFeatureSettings(CSSValue& featureSettings)
 {
     // Can only call this with a primitive value of normal, or a value list containing font feature values.
@@ -813,7 +671,7 @@ RefPtr<Font> CSSFontFace::font(const FontDescription& fontDescription, bool synt
             return Font::create(FontCache::singleton().lastResortFallbackFont(fontDescription)->platformData(), Font::Origin::Local, Font::Interstitial::Yes, visibility);
         }
         case CSSFontFaceSource::Status::Success:
-            if (RefPtr<Font> result = source->font(fontDescription, syntheticBold, syntheticItalic, m_featureSettings, m_variantSettings, m_fontSelectionCapabilities))
+            if (RefPtr<Font> result = source->font(fontDescription, syntheticBold, syntheticItalic, m_featureSettings, m_fontSelectionCapabilities))
                 return result;
             break;
         case CSSFontFaceSource::Status::Failure:
index 7714300..85997ad 100644 (file)
@@ -69,12 +69,6 @@ public:
     void setWeight(CSSValue&);
     void setStretch(CSSValue&);
     bool setUnicodeRange(CSSValue&);
-    bool setVariantLigatures(CSSValue&);
-    bool setVariantPosition(CSSValue&);
-    bool setVariantCaps(CSSValue&);
-    bool setVariantNumeric(CSSValue&);
-    bool setVariantAlternates(CSSValue&);
-    bool setVariantEastAsian(CSSValue&);
     void setFeatureSettings(CSSValue&);
     void setLoadingBehavior(CSSValue&);
 
@@ -87,9 +81,7 @@ public:
     FontSelectionCapabilities fontSelectionCapabilities() const { return m_fontSelectionCapabilities.computeFontSelectionCapabilities(); }
     const Vector<UnicodeRange>& ranges() const { return m_ranges; }
     const FontFeatureSettings& featureSettings() const { return m_featureSettings; }
-    const FontVariantSettings& variantSettings() const { return m_variantSettings; }
     FontLoadingBehavior loadingBehavior() const { return m_loadingBehavior; }
-    void setVariantSettings(const FontVariantSettings& variantSettings) { m_variantSettings = variantSettings; }
     void setWeight(FontSelectionRange weight) { m_fontSelectionCapabilities.weight = weight; }
     void setStretch(FontSelectionRange stretch) { m_fontSelectionCapabilities.width = stretch; }
     void setStyle(FontSelectionRange italic) { m_fontSelectionCapabilities.slope = italic; }
@@ -185,7 +177,6 @@ private:
     Vector<UnicodeRange> m_ranges;
 
     FontFeatureSettings m_featureSettings;
-    FontVariantSettings m_variantSettings;
     FontLoadingBehavior m_loadingBehavior { FontLoadingBehavior::Auto };
 
     Vector<std::unique_ptr<CSSFontFaceSource>, 0, CrashOnOverflow, 0> m_sources;
index 8802606..f427ffb 100644 (file)
@@ -179,7 +179,7 @@ void CSSFontFaceSource::load(CSSFontSelector* fontSelector)
             fontDescription.setOneFamily(m_familyNameOrURI);
             fontDescription.setComputedSize(1);
             fontDescription.setShouldAllowUserInstalledFonts(m_face.allowUserInstalledFonts());
-            success = FontCache::singleton().fontForFamily(fontDescription, m_familyNameOrURI, nullptr, nullptr, FontSelectionSpecifiedCapabilities(), true);
+            success = FontCache::singleton().fontForFamily(fontDescription, m_familyNameOrURI, nullptr, FontSelectionSpecifiedCapabilities(), true);
             if (RuntimeEnabledFeatures::sharedFeatures().webAPIStatisticsEnabled()) {
                 if (auto* document = fontSelector->document())
                     ResourceLoadObserver::shared().logFontLoad(*document, m_familyNameOrURI.string(), success);
@@ -189,7 +189,7 @@ void CSSFontFaceSource::load(CSSFontSelector* fontSelector)
     }
 }
 
-RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
+RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
 {
     ASSERT(status() == Status::Success);
 
@@ -203,12 +203,12 @@ RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, boo
         if (m_immediateSource) {
             if (!m_immediateFontCustomPlatformData)
                 return nullptr;
-            return Font::create(CachedFont::platformDataFromCustomData(*m_immediateFontCustomPlatformData, fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities), Font::Origin::Remote);
+            return Font::create(CachedFont::platformDataFromCustomData(*m_immediateFontCustomPlatformData, fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceCapabilities), Font::Origin::Remote);
         }
 
         // We're local. Just return a Font from the normal cache.
         // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter.
-        return FontCache::singleton().fontForFamily(fontDescription, m_familyNameOrURI, &fontFaceFeatures, &fontFaceVariantSettings, fontFaceCapabilities, true);
+        return FontCache::singleton().fontForFamily(fontDescription, m_familyNameOrURI, &fontFaceFeatures, fontFaceCapabilities, true);
     }
 
     if (m_font) {
@@ -216,7 +216,7 @@ RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, boo
         ASSERT_UNUSED(success, success);
 
         ASSERT(status() == Status::Success);
-        auto result = m_font->createFont(fontDescription, m_familyNameOrURI, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities);
+        auto result = m_font->createFont(fontDescription, m_familyNameOrURI, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceCapabilities);
         ASSERT(result);
         return result;
     }
@@ -229,7 +229,7 @@ RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, boo
         return nullptr;
     if (!m_inDocumentCustomPlatformData)
         return nullptr;
-    return Font::create(m_inDocumentCustomPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities), Font::Origin::Remote);
+    return Font::create(m_inDocumentCustomPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceCapabilities), Font::Origin::Remote);
 #endif
 
     ASSERT_NOT_REACHED();
index 291b248..e4a2ed9 100644 (file)
@@ -70,7 +70,7 @@ public:
     void opportunisticallyStartFontDataURLLoading(CSSFontSelector&);
 
     void load(CSSFontSelector*);
-    RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities);
+    RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities);
 
     bool requiresExternalResource() const { return m_font; }
 
index b495083..06ebf8b 100644 (file)
@@ -162,12 +162,6 @@ void CSSFontSelector::addFontFaceRule(StyleRuleFontFace& fontFaceRule, bool isIn
     RefPtr<CSSValue> src = style.getPropertyCSSValue(CSSPropertySrc);
     RefPtr<CSSValue> unicodeRange = style.getPropertyCSSValue(CSSPropertyUnicodeRange);
     RefPtr<CSSValue> featureSettings = style.getPropertyCSSValue(CSSPropertyFontFeatureSettings);
-    RefPtr<CSSValue> variantLigatures = style.getPropertyCSSValue(CSSPropertyFontVariantLigatures);
-    RefPtr<CSSValue> variantPosition = style.getPropertyCSSValue(CSSPropertyFontVariantPosition);
-    RefPtr<CSSValue> variantCaps = style.getPropertyCSSValue(CSSPropertyFontVariantCaps);
-    RefPtr<CSSValue> variantNumeric = style.getPropertyCSSValue(CSSPropertyFontVariantNumeric);
-    RefPtr<CSSValue> variantAlternates = style.getPropertyCSSValue(CSSPropertyFontVariantAlternates);
-    RefPtr<CSSValue> variantEastAsian = style.getPropertyCSSValue(CSSPropertyFontVariantEastAsian);
     RefPtr<CSSValue> loadingBehavior = style.getPropertyCSSValue(CSSPropertyFontDisplay);
     if (!is<CSSValueList>(fontFamily) || !is<CSSValueList>(src) || (unicodeRange && !is<CSSValueList>(*unicodeRange)))
         return;
@@ -195,18 +189,6 @@ void CSSFontSelector::addFontFaceRule(StyleRuleFontFace& fontFaceRule, bool isIn
         fontFace->setStretch(*fontStretch);
     if (rangeList && !fontFace->setUnicodeRange(*rangeList))
         return;
-    if (variantLigatures && !fontFace->setVariantLigatures(*variantLigatures))
-        return;
-    if (variantPosition && !fontFace->setVariantPosition(*variantPosition))
-        return;
-    if (variantCaps && !fontFace->setVariantCaps(*variantCaps))
-        return;
-    if (variantNumeric && !fontFace->setVariantNumeric(*variantNumeric))
-        return;
-    if (variantAlternates && !fontFace->setVariantAlternates(*variantAlternates))
-        return;
-    if (variantEastAsian && !fontFace->setVariantEastAsian(*variantEastAsian))
-        return;
     if (featureSettings)
         fontFace->setFeatureSettings(*featureSettings);
     if (loadingBehavior)
index a2e93e8..495c0cd 100644 (file)
@@ -37,7 +37,6 @@
 #include "CSSValuePool.h"
 #include "DOMPromiseProxy.h"
 #include "Document.h"
-#include "FontVariantBuilder.h"
 #include "JSFontFace.h"
 #include "Quirks.h"
 #include "StyleProperties.h"
@@ -101,9 +100,6 @@ ExceptionOr<Ref<FontFace>> FontFace::create(Document& document, const String& fa
     auto setUnicodeRangeResult = result->setUnicodeRange(descriptors.unicodeRange.isEmpty() ? "U+0-10FFFF"_s : descriptors.unicodeRange);
     if (setUnicodeRangeResult.hasException())
         return setUnicodeRangeResult.releaseException();
-    auto setVariantResult = result->setVariant(descriptors.variant.isEmpty() ? "normal"_s : descriptors.variant);
-    if (setVariantResult.hasException())
-        return setVariantResult.releaseException();
     auto setFeatureSettingsResult = result->setFeatureSettings(descriptors.featureSettings.isEmpty() ? "normal"_s : descriptors.featureSettings);
     if (setFeatureSettingsResult.hasException())
         return setFeatureSettingsResult.releaseException();
@@ -218,61 +214,6 @@ ExceptionOr<void> FontFace::setUnicodeRange(const String& unicodeRange)
     return { };
 }
 
-ExceptionOr<void> FontFace::setVariant(const String& variant)
-{
-    if (variant.isEmpty())
-        return Exception { SyntaxError };
-
-    auto style = MutableStyleProperties::create();
-    auto result = CSSParser::parseValue(style, CSSPropertyFontVariant, variant, true, HTMLStandardMode);
-    if (result == CSSParser::ParseResult::Error)
-        return Exception { SyntaxError };
-
-    // FIXME: Would be much better to stage the new settings and set them all at once
-    // instead of this dance where we make a backup and revert to it if something fails.
-    FontVariantSettings backup = m_backing->variantSettings();
-
-    auto normal = CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
-    bool success = true;
-
-    if (auto value = style->getPropertyCSSValue(CSSPropertyFontVariantLigatures))
-        success &= m_backing->setVariantLigatures(*value);
-    else
-        m_backing->setVariantLigatures(normal);
-
-    if (auto value = style->getPropertyCSSValue(CSSPropertyFontVariantPosition))
-        success &= m_backing->setVariantPosition(*value);
-    else
-        m_backing->setVariantPosition(normal);
-
-    if (auto value = style->getPropertyCSSValue(CSSPropertyFontVariantCaps))
-        success &= m_backing->setVariantCaps(*value);
-    else
-        m_backing->setVariantCaps(normal);
-
-    if (auto value = style->getPropertyCSSValue(CSSPropertyFontVariantNumeric))
-        success &= m_backing->setVariantNumeric(*value);
-    else
-        m_backing->setVariantNumeric(normal);
-
-    if (auto value = style->getPropertyCSSValue(CSSPropertyFontVariantAlternates))
-        success &= m_backing->setVariantAlternates(*value);
-    else
-        m_backing->setVariantAlternates(normal);
-
-    if (auto value = style->getPropertyCSSValue(CSSPropertyFontVariantEastAsian))
-        success &= m_backing->setVariantEastAsian(*value);
-    else
-        m_backing->setVariantEastAsian(normal);
-
-    if (!success) {
-        m_backing->setVariantSettings(backup);
-        return Exception { SyntaxError };
-    }
-
-    return { };
-}
-
 ExceptionOr<void> FontFace::setFeatureSettings(const String& featureSettings)
 {
     if (featureSettings.isEmpty())
@@ -402,12 +343,6 @@ String FontFace::unicodeRange() const
     return values->cssText();
 }
 
-String FontFace::variant() const
-{
-    m_backing->updateStyleIfNeeded();
-    return computeFontVariant(m_backing->variantSettings())->cssText();
-}
-
 String FontFace::featureSettings() const
 {
     m_backing->updateStyleIfNeeded();
index dc7b1ac..cbeda5c 100644 (file)
@@ -48,7 +48,6 @@ public:
         String weight;
         String stretch;
         String unicodeRange;
-        String variant;
         String featureSettings;
         String display;
     };
@@ -63,7 +62,6 @@ public:
     ExceptionOr<void> setWeight(const String&);
     ExceptionOr<void> setStretch(const String&);
     ExceptionOr<void> setUnicodeRange(const String&);
-    ExceptionOr<void> setVariant(const String&);
     ExceptionOr<void> setFeatureSettings(const String&);
     ExceptionOr<void> setDisplay(const String&);
 
@@ -72,7 +70,6 @@ public:
     String weight() const;
     String stretch() const;
     String unicodeRange() const;
-    String variant() const;
     String featureSettings() const;
     String display() const;
 
index 2002d33..2cbc07e 100644 (file)
@@ -37,7 +37,6 @@ dictionary FontFaceDescriptors {
     DOMString weight = "normal";
     DOMString stretch = "normal";
     DOMString unicodeRange = "U+0-10FFFF";
-    DOMString variant = "normal";
     DOMString featureSettings = "normal";
     DOMString display = "auto";
 };
@@ -52,7 +51,6 @@ dictionary FontFaceDescriptors {
     attribute DOMString weight;
     attribute DOMString stretch;
     attribute DOMString unicodeRange;
-    attribute DOMString variant;
     attribute DOMString featureSettings;
     attribute DOMString display;
 
index 0851508..3f4699c 100644 (file)
@@ -124,20 +124,20 @@ std::unique_ptr<FontCustomPlatformData> CachedFont::createCustomFontData(SharedB
     return createFontCustomPlatformData(bytes, itemInCollection);
 }
 
-RefPtr<Font> CachedFont::createFont(const FontDescription& fontDescription, const AtomString&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
+RefPtr<Font> CachedFont::createFont(const FontDescription& fontDescription, const AtomString&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
 {
-    return Font::create(platformDataFromCustomData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities), Font::Origin::Remote);
+    return Font::create(platformDataFromCustomData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceCapabilities), Font::Origin::Remote);
 }
 
-FontPlatformData CachedFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
+FontPlatformData CachedFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
 {
     ASSERT(m_fontCustomPlatformData);
-    return platformDataFromCustomData(*m_fontCustomPlatformData, fontDescription, bold, italic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities);
+    return platformDataFromCustomData(*m_fontCustomPlatformData, fontDescription, bold, italic, fontFaceFeatures, fontFaceCapabilities);
 }
 
-FontPlatformData CachedFont::platformDataFromCustomData(FontCustomPlatformData& fontCustomPlatformData, const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
+FontPlatformData CachedFont::platformDataFromCustomData(FontCustomPlatformData& fontCustomPlatformData, const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
 {
-    return fontCustomPlatformData.fontPlatformData(fontDescription, bold, italic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities);
+    return fontCustomPlatformData.fontPlatformData(fontDescription, bold, italic, fontFaceFeatures, fontFaceCapabilities);
 }
 
 void CachedFont::allClientsRemoved()
index 580e9be..14572e1 100644 (file)
@@ -53,12 +53,12 @@ public:
 
     virtual bool ensureCustomFontData(const AtomString& remoteURI);
     static std::unique_ptr<FontCustomPlatformData> createCustomFontData(SharedBuffer&, const String& itemInCollection, bool& wrapping);
-    static FontPlatformData platformDataFromCustomData(FontCustomPlatformData&, const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities);
+    static FontPlatformData platformDataFromCustomData(FontCustomPlatformData&, const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities);
 
-    virtual RefPtr<Font> createFont(const FontDescription&, const AtomString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities);
+    virtual RefPtr<Font> createFont(const FontDescription&, const AtomString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities);
 
 protected:
-    FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities);
+    FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities);
 
     bool ensureCustomFontData(SharedBuffer* data);
 
index ed288c1..012d2f3 100644 (file)
@@ -48,17 +48,17 @@ CachedSVGFont::CachedSVGFont(CachedResourceRequest&& request, const PAL::Session
 {
 }
 
-RefPtr<Font> CachedSVGFont::createFont(const FontDescription& fontDescription, const AtomString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
+RefPtr<Font> CachedSVGFont::createFont(const FontDescription& fontDescription, const AtomString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
 {
     ASSERT(firstFontFace(remoteURI));
-    return CachedFont::createFont(fontDescription, remoteURI, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities);
+    return CachedFont::createFont(fontDescription, remoteURI, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceCapabilities);
 }
 
-FontPlatformData CachedSVGFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
+FontPlatformData CachedSVGFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
 {
     if (m_externalSVGDocument)
         return FontPlatformData(fontDescription.computedPixelSize(), bold, italic);
-    return CachedFont::platformDataFromCustomData(fontDescription, bold, italic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities);
+    return CachedFont::platformDataFromCustomData(fontDescription, bold, italic, fontFaceFeatures, fontFaceCapabilities);
 }
 
 bool CachedSVGFont::ensureCustomFontData(const AtomString& remoteURI)
index 42cf134..afddd6d 100644 (file)
@@ -39,10 +39,10 @@ public:
 
     bool ensureCustomFontData(const AtomString& remoteURI) override;
 
-    RefPtr<Font> createFont(const FontDescription&, const AtomString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities) override;
+    RefPtr<Font> createFont(const FontDescription&, const AtomString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities) override;
 
 private:
-    FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities);
+    FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities);
 
     SVGFontElement* getSVGFontById(const String&) const;
 
index 82f0b61..7fcaa44 100644 (file)
@@ -73,11 +73,10 @@ struct FontPlatformDataCacheKey {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     FontPlatformDataCacheKey() { }
-    FontPlatformDataCacheKey(const AtomString& family, const FontDescription& description, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
+    FontPlatformDataCacheKey(const AtomString& family, const FontDescription& description, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
         : m_fontDescriptionKey(description)
         , m_family(family)
         , m_fontFaceFeatures(fontFaceFeatures ? *fontFaceFeatures : FontFeatureSettings())
-        , m_fontFaceVariantSettings(fontFaceVariantSettings ? *fontFaceVariantSettings : FontVariantSettings())
         , m_fontFaceCapabilities(fontFaceCapabilities)
     { }
 
@@ -91,7 +90,6 @@ public:
     {
         if (m_fontDescriptionKey != other.m_fontDescriptionKey
             || m_fontFaceFeatures != other.m_fontFaceFeatures
-            || m_fontFaceVariantSettings != other.m_fontFaceVariantSettings
             || m_fontFaceCapabilities != other.m_fontFaceCapabilities)
             return false;
         if (m_family.impl() == other.m_family.impl())
@@ -104,7 +102,6 @@ public:
     FontDescriptionKey m_fontDescriptionKey;
     AtomString m_family;
     FontFeatureSettings m_fontFaceFeatures;
-    FontVariantSettings m_fontFaceVariantSettings;
     FontSelectionSpecifiedCapabilities m_fontFaceCapabilities;
 };
 
@@ -115,7 +112,6 @@ struct FontPlatformDataCacheKeyHash {
         hasher.add(FontCascadeDescription::familyNameHash(fontKey.m_family));
         hasher.add(fontKey.m_fontDescriptionKey.computeHash());
         hasher.add(fontKey.m_fontFaceFeatures.hash());
-        hasher.add(fontKey.m_fontFaceVariantSettings.uniqueValue());
         if (auto weight = fontKey.m_fontFaceCapabilities.weight)
             hasher.add(weight->uniqueValue());
         else
@@ -200,7 +196,7 @@ const AtomString& FontCache::alternateFamilyName(const AtomString& familyName)
 }
 
 FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription, const AtomString& passedFamilyName,
-    const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool checkingAlternateName)
+    const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool checkingAlternateName)
 {
 #if PLATFORM(IOS_FAMILY)
     auto locker = holdLock(fontLock);
@@ -222,19 +218,19 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo
         initialized = true;
     }
 
-    FontPlatformDataCacheKey key(familyName, fontDescription, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities);
+    FontPlatformDataCacheKey key(familyName, fontDescription, fontFaceFeatures, fontFaceCapabilities);
 
     auto addResult = fontPlatformDataCache().add(key, nullptr);
     FontPlatformDataCache::iterator it = addResult.iterator;
     if (addResult.isNewEntry) {
-        it->value = createFontPlatformData(fontDescription, familyName, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities);
+        it->value = createFontPlatformData(fontDescription, familyName, fontFaceFeatures, fontFaceCapabilities);
 
         if (!it->value && !checkingAlternateName) {
             // We were unable to find a font.  We have a small set of fonts that we alias to other names,
             // e.g., Arial/Helvetica, Courier/Courier New, etc.  Try looking up the font under the aliased name.
             const AtomString& alternateName = alternateFamilyName(familyName);
             if (!alternateName.isNull()) {
-                FontPlatformData* fontPlatformDataForAlternateName = getCachedFontPlatformData(fontDescription, alternateName, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, true);
+                FontPlatformData* fontPlatformDataForAlternateName = getCachedFontPlatformData(fontDescription, alternateName, fontFaceFeatures, fontFaceCapabilities, true);
                 // Lookup the key in the hash table again as the previous iterator may have
                 // been invalidated by the recursive call to getCachedFontPlatformData().
                 it = fontPlatformDataCache().find(key);
@@ -316,12 +312,12 @@ const unsigned cTargetInactiveFontData = 200;
 const unsigned cMaxUnderMemoryPressureInactiveFontData = 50;
 const unsigned cTargetUnderMemoryPressureInactiveFontData = 30;
 
-RefPtr<Font> FontCache::fontForFamily(const FontDescription& fontDescription, const AtomString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool checkingAlternateName)
+RefPtr<Font> FontCache::fontForFamily(const FontDescription& fontDescription, const AtomString& family, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool checkingAlternateName)
 {
     if (!m_purgeTimer.isActive())
         m_purgeTimer.startOneShot(0_s);
 
-    if (auto* platformData = getCachedFontPlatformData(fontDescription, family, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, checkingAlternateName))
+    if (auto* platformData = getCachedFontPlatformData(fontDescription, family, fontFaceFeatures, fontFaceCapabilities, checkingAlternateName))
         return fontForPlatformData(*platformData);
 
     return nullptr;
index b054a8c..fe973fc 100644 (file)
@@ -212,7 +212,7 @@ public:
     // It comes into play when you create an @font-face which shares a family name as a preinstalled font.
     Vector<FontSelectionCapabilities> getFontSelectionCapabilitiesInFamily(const AtomString&, AllowUserInstalledFonts);
 
-    WEBCORE_EXPORT RefPtr<Font> fontForFamily(const FontDescription&, const AtomString&, const FontFeatureSettings* fontFaceFeatures = nullptr, const FontVariantSettings* fontFaceVariantSettings = nullptr, FontSelectionSpecifiedCapabilities fontFaceCapabilities = { }, bool checkingAlternateName = false);
+    WEBCORE_EXPORT RefPtr<Font> fontForFamily(const FontDescription&, const AtomString&, const FontFeatureSettings* fontFaceFeatures = nullptr, FontSelectionSpecifiedCapabilities fontFaceCapabilities = { }, bool checkingAlternateName = false);
     WEBCORE_EXPORT Ref<Font> lastResortFallbackFont(const FontDescription&);
     WEBCORE_EXPORT Ref<Font> fontForPlatformData(const FontPlatformData&);
     RefPtr<Font> similarFont(const FontDescription&, const AtomString& family);
@@ -262,13 +262,13 @@ private:
     WEBCORE_EXPORT void purgeInactiveFontDataIfNeeded();
 
     // FIXME: This method should eventually be removed.
-    FontPlatformData* getCachedFontPlatformData(const FontDescription&, const AtomString& family, const FontFeatureSettings* fontFaceFeatures = nullptr, const FontVariantSettings* fontFaceVariantSettings = nullptr, FontSelectionSpecifiedCapabilities fontFaceCapabilities = { }, bool checkingAlternateName = false);
+    FontPlatformData* getCachedFontPlatformData(const FontDescription&, const AtomString& family, const FontFeatureSettings* fontFaceFeatures = nullptr, FontSelectionSpecifiedCapabilities fontFaceCapabilities = { }, bool checkingAlternateName = false);
 
     // These methods are implemented by each platform.
 #if PLATFORM(COCOA)
     FontPlatformData* getCustomFallbackFont(const UInt32, const FontDescription&);
 #endif
-    WEBCORE_EXPORT std::unique_ptr<FontPlatformData> createFontPlatformData(const FontDescription&, const AtomString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities);
+    WEBCORE_EXPORT std::unique_ptr<FontPlatformData> createFontPlatformData(const FontDescription&, const AtomString& family, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities);
     
     static const AtomString& alternateFamilyName(const AtomString&);
     static const AtomString& platformAlternateFamilyName(const AtomString&);
@@ -289,7 +289,7 @@ private:
 
 inline std::unique_ptr<FontPlatformData> FontCache::createFontPlatformDataForTesting(const FontDescription& fontDescription, const AtomString& family)
 {
-    return createFontPlatformData(fontDescription, family, nullptr, nullptr, { });
+    return createFontPlatformData(fontDescription, family, nullptr, { });
 }
 
 #if !PLATFORM(COCOA) && !USE(FREETYPE)
index 18f3405..91ace18 100644 (file)
@@ -46,7 +46,7 @@ struct FontCustomPlatformData {
 public:
     FontCustomPlatformData(FT_Face, SharedBuffer&);
     ~FontCustomPlatformData() = default;
-    FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities);
+    FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities);
     static bool supportsFormat(const String&);
 
 private:
index 5b18118..a0252c5 100644 (file)
@@ -530,7 +530,7 @@ struct FontType {
     bool aatShaping { false };
 };
 
-RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, const FontDescription& fontDescription, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations)
+RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, const FontDescription& fontDescription, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations)
 {
     if (!originalFont)
         return originalFont;
@@ -569,8 +569,7 @@ RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, const FontDescr
     bool variantSettingsIsNormal = variantSettings.isAllNormal();
     bool dontNeedToApplyOpticalSizing = fontOpticalSizing == FontOpticalSizing::Enabled && !forceOpticalSizingOn;
     bool fontFaceDoesntSpecifyFeatures = !fontFaceFeatures || fontFaceFeatures->isEmpty();
-    bool fontFaceDoesntSpecifyVariations = !fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal();
-    if (noFontFeatureSettings && noFontVariationSettings && textRenderingModeIsAuto && variantSettingsIsNormal && dontNeedToApplyOpticalSizing && fontFaceDoesntSpecifyFeatures && fontFaceDoesntSpecifyVariations) {
+    if (noFontFeatureSettings && noFontVariationSettings && textRenderingModeIsAuto && variantSettingsIsNormal && dontNeedToApplyOpticalSizing && fontFaceDoesntSpecifyFeatures) {
 #if HAVE(CTFONTCREATEFORCHARACTERSWITHLANGUAGEANDOPTION)
         return originalFont;
 #else
@@ -584,8 +583,7 @@ RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, const FontDescr
     // Step 1: CoreText handles default features (such as required ligatures).
 
     // Step 2: Consult with font-variant-* inside @font-face
-    if (fontFaceVariantSettings)
-        featuresToBeApplied = computeFeatureSettingsFromVariants(*fontFaceVariantSettings);
+    // This no longer happens any more: https://github.com/w3c/csswg-drafts/issues/2531
 
     // Step 3: Consult with font-feature-settings inside @font-face
     if (fontFaceFeatures) {
@@ -1294,7 +1292,7 @@ static RetainPtr<CTFontRef> fontWithFamilySpecialCase(const AtomString& family,
     return nullptr;
 }
 
-static RetainPtr<CTFontRef> fontWithFamily(const AtomString& family, const FontDescription& fontDescription, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, float size)
+static RetainPtr<CTFontRef> fontWithFamily(const AtomString& family, const FontDescription& fontDescription, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities, float size)
 {
     if (family.isEmpty())
         return nullptr;
@@ -1306,7 +1304,7 @@ static RetainPtr<CTFontRef> fontWithFamily(const AtomString& family, const FontD
         if (!fontLookup.result)
             fontLookup = platformFontLookupWithFamily(family, fontDescription.fontSelectionRequest(), size, fontDescription.shouldAllowUserInstalledFonts());
     }
-    return preparePlatformFont(fontLookup.result.get(), fontDescription, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, !fontLookup.createdFromPostScriptName);
+    return preparePlatformFont(fontLookup.result.get(), fontDescription, fontFaceFeatures, fontFaceCapabilities, !fontLookup.createdFromPostScriptName);
 }
 
 #if PLATFORM(MAC)
@@ -1341,11 +1339,11 @@ static void autoActivateFont(const String& name, CGFloat size)
 }
 #endif
 
-std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
+std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomString& family, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
 {
     float size = fontDescription.computedPixelSize();
 
-    auto font = fontWithFamily(family, fontDescription, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, size);
+    auto font = fontWithFamily(family, fontDescription, fontFaceFeatures, fontFaceCapabilities, size);
 
 #if PLATFORM(MAC)
     if (!font) {
@@ -1356,7 +1354,7 @@ std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDe
         // Ignore the result because we want to use our own algorithm to actually find the font.
         autoActivateFont(family.string(), size);
 
-        font = fontWithFamily(family, fontDescription, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, size);
+        font = fontWithFamily(family, fontDescription, fontFaceFeatures, fontFaceCapabilities, size);
     }
 #endif
 
@@ -1485,7 +1483,7 @@ RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& descr
         m_fontNamesRequiringSystemFallbackForPrewarming.add(fullName);
 
     auto result = lookupFallbackFont(platformData.font(), description.weight(), description.locale(), description.shouldAllowUserInstalledFonts(), characters, length);
-    result = preparePlatformFont(result.get(), description, nullptr, nullptr, { });
+    result = preparePlatformFont(result.get(), description, nullptr, { });
 
     if (!result)
         return lastResortFallbackFont(description);
index 8da558e..94c3273 100644 (file)
@@ -50,7 +50,7 @@ struct SynthesisPair {
     bool needsSyntheticOblique;
 };
 
-RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, const FontDescription&, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations = true);
+RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, const FontDescription&, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations = true);
 SynthesisPair computeNecessarySynthesis(CTFontRef, const FontDescription&, bool isPlatformFont = false);
 RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomString& family, const FontDescription&, float size, AllowUserInstalledFonts);
 RetainPtr<CTFontRef> platformFontWithFamily(const AtomString& family, FontSelectionRequest, TextRenderingMode, float size);
index 0de934a..c248529 100644 (file)
@@ -108,7 +108,7 @@ FontRanges FontFamilySpecificationCoreText::fontRanges(const FontDescription& fo
             fontForSynthesisComputation = physicalFont;
 #endif
 
-        font = preparePlatformFont(font.get(), fontDescription, nullptr, nullptr, { });
+        font = preparePlatformFont(font.get(), fontDescription, nullptr, { });
 
         auto [syntheticBold, syntheticOblique] = computeNecessarySynthesis(fontForSynthesisComputation.get(), fontDescription).boldObliquePair();
 
index f1ae94d..cae36ad 100644 (file)
@@ -500,7 +500,7 @@ static inline bool isCommonlyUsedGenericFamily(const String& familyNameString)
         || equalLettersIgnoringASCIICase(familyNameString, "cursive");
 }
 
-std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomString& family, const FontFeatureSettings*, const FontVariantSettings*, FontSelectionSpecifiedCapabilities)
+std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomString& family, const FontFeatureSettings*, FontSelectionSpecifiedCapabilities)
 {
     // The CSS font matching algorithm (http://www.w3.org/TR/css3-fonts/#font-matching-algorithm)
     // says that we must find an exact match for font family, slant (italic or oblique can be used)
index 58943d2..eafd96d 100644 (file)
@@ -75,7 +75,7 @@ static FcPattern* defaultFontconfigOptions()
     return pattern;
 }
 
-FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& description, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities)
+FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& description, bool bold, bool italic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities)
 {
     auto* freeTypeFace = static_cast<FT_Face>(cairo_font_face_get_user_data(m_fontFace.get(), &freeTypeFaceKey));
     ASSERT(freeTypeFace);
index 507938b..219a995 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
 
 FontCustomPlatformData::~FontCustomPlatformData() = default;
 
-FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
+FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities)
 {
     auto attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     addAttributesForWebFonts(attributes.get(), fontDescription.shouldAllowUserInstalledFonts());
@@ -46,7 +46,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription&
     FontOrientation orientation = fontDescription.orientation();
     FontWidthVariant widthVariant = fontDescription.widthVariant();
     RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(modifiedFontDescriptor.get(), size, nullptr));
-    font = preparePlatformFont(font.get(), fontDescription, &fontFaceFeatures, &fontFaceVariantSettings, fontFaceCapabilities);
+    font = preparePlatformFont(font.get(), fontDescription, &fontFaceFeatures, fontFaceCapabilities);
     ASSERT(font);
     return FontPlatformData(font.get(), size, bold, italic, orientation, widthVariant, fontDescription.textRenderingMode());
 }
index ab203fa..6078e25 100644 (file)
@@ -50,7 +50,7 @@ public:
 
     ~FontCustomPlatformData();
 
-    FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities);
+    FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities);
 
     static bool supportsFormat(const String&);
 
index bc95f95..0a0dc12 100644 (file)
@@ -617,7 +617,7 @@ Vector<FontSelectionCapabilities> FontCache::getFontSelectionCapabilitiesInFamil
     return result;
 }
 
-std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomString& family, const FontFeatureSettings*, const FontVariantSettings*, FontSelectionSpecifiedCapabilities)
+std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomString& family, const FontFeatureSettings*, FontSelectionSpecifiedCapabilities)
 {
     bool isLucidaGrande = equalLettersIgnoringASCIICase(family, "lucida grande");
 
index 228764c..140ec16 100644 (file)
@@ -46,7 +46,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
         RemoveFontMemResourceEx(m_fontReference);
 }
 
-FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities)
+FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities)
 {
     int size = fontDescription.computedPixelSize();
     FontRenderingMode renderingMode = fontDescription.renderingMode();
index eab806e..1b2ff2b 100644 (file)
@@ -52,7 +52,7 @@ public:
 
     ~FontCustomPlatformData();
 
-    FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities);
+    FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities);
 
     static bool supportsFormat(const String&);
 
index eeeafeb..da9c186 100644 (file)
@@ -38,7 +38,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
         RemoveFontMemResourceEx(m_fontReference);
 }
 
-FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&, FontSelectionSpecifiedCapabilities)
+FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities)
 {
     int size = fontDescription.computedPixelSize();
     FontRenderingMode renderingMode = fontDescription.renderingMode();