Title: [218010] branches/safari-604.1.25-branch
Revision
218010
Author
matthew_han...@apple.com
Date
2017-06-09 12:00:07 -0700 (Fri, 09 Jun 2017)

Log Message

Cherry-pick r218009. rdar://problem/32677465

Modified Paths

Removed Paths

Diff

Modified: branches/safari-604.1.25-branch/LayoutTests/ChangeLog (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/ChangeLog	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/ChangeLog	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,3 +1,11 @@
+2017-06-09  Matthew Hanson  <matthew_han...@apple.com>
+
+        Cherry-pick r218009. rdar://problem/32677465
+
+    2017-06-09  Matthew Hanson  <matthew_han...@apple.com>
+
+            Revert r217955. rdar://problem/21125708
+
 2017-06-09  Claudio Saavedra  <csaave...@igalia.com>
 
         [WPE] Unskip passing userscripts tests

Deleted: branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback-emoji-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback-emoji-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback-emoji-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,11 +0,0 @@
-This test makes sure that the system font draws emoji correctly.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS systemFontTarget.offsetWidth is not 100
-PASS appleColorEmojiTarget.offsetWidth is 100
-PASS successfullyParsed is true
-
-TEST COMPLETE
-😊 😊

Deleted: branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback-emoji.html (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback-emoji.html	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback-emoji.html	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src=""
-</head>
-<body>
-<div style="font-size: 100px;">
-<span id="systemFontTarget" style="font-family: 'system-ui';">😊</span>
-<span id="appleColorEmojiTarget" style="font-family: 'AppleColorEmoji';">😊</span>
-</div>
-<script>
-description("This test makes sure that the system font draws emoji correctly.");
-var systemFontTarget = document.getElementById("systemFontTarget");
-var appleColorEmojiTarget = document.getElementById("appleColorEmojiTarget");
-shouldNotBe("systemFontTarget.offsetWidth", "100");
-shouldBe("appleColorEmojiTarget.offsetWidth", "100");
-</script>
-<script src=""
-</body>
-</html>

Deleted: branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback-expected.html (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback-expected.html	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback-expected.html	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-</head>
-<body>
-This test makes sure that "system-ui" is expanded to every item in the platform fallback list. The test passes if all the lines below are rendered in the same font and identical.
-<div style="font-size: 100px;">
-<div style="font-family: 'Thonburi';">&#xE01;&#xE02;&#xE03;&#xE04;&#xE05;&#xE06;&#xE07;</div>
-<div style="font-family: 'Thonburi';">&#xE01;&#xE02;&#xE03;&#xE04;&#xE05;&#xE06;&#xE07;</div>
-<div style="font-family: 'Thonburi';">&#xE01;&#xE02;&#xE03;&#xE04;&#xE05;&#xE06;&#xE07;</div>
-</div>
-</body>
-</html>

Deleted: branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback.html (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback.html	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/fast/text/system-font-fallback.html	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-</head>
-<body>
-This test makes sure that "system-ui" is expanded to every item in the platform fallback list. The test passes if all the lines below are rendered in the same font and identical.
-<div style="font-size: 100px;">
-<div style="font-family: 'system-ui'            ;">&#xE01;&#xE02;&#xE03;&#xE04;&#xE05;&#xE06;&#xE07;</div>
-<div style="font-family: 'system-ui', 'Thonburi';">&#xE01;&#xE02;&#xE03;&#xE04;&#xE05;&#xE06;&#xE07;</div>
-<div style="font-family: 'system-ui', 'Ayuthaya';">&#xE01;&#xE02;&#xE03;&#xE04;&#xE05;&#xE06;&#xE07;</div>
-</div>
-</body>
-</html>

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/TestExpectations (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/TestExpectations	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/TestExpectations	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1567,6 +1567,3 @@
 media/modern-media-controls/audio/audio-controls-styles.html [ Skip ]
 
 webkit.org/b/170907 [ Debug ] imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker.html [ Pass Failure Timeout ]
-
-# This test is only valid on platforms which have multiple emoji fonts.
-webkit.org/b/173043 [ ElCapitan ] fast/text/system-font-fallback-emoji.html [ Failure ]

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/css/rtl-ordering-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/css/rtl-ordering-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/css/rtl-ordering-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/css/rtl-ordering-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -20,17 +20,17 @@
         RenderText {#text} at (0,1) size 310x18
           text run at (0,1) width 310 LTR override: "The text on both buttons should like this: \x{5E8}\x{5D5}\x{5EA}\x{5E4}\x{5DB}"
       RenderBlock (anonymous) at (0,105) size 784x44
-        RenderButton {BUTTON} at (2,2) size 46x18 [bgcolor=#C0C0C0] [border: none (2px outset #C0C0C0) none (2px outset #C0C0C0)]
-          RenderBlock (anonymous) at (8,2) size 30x13
-            RenderText {#text} at (0,0) size 30x13
-              text run at (0,0) width 30 LTR override: "\x{5E8}\x{5D5}\x{5EA}\x{5E4}\x{5DB}"
-        RenderText {#text} at (49,1) size 5x18
-          text run at (49,1) width 5 LTR override: " "
-        RenderBR {BR} at (53,15) size 1x0
-        RenderButton {INPUT} at (2,24) size 46x18 [bgcolor=#C0C0C0]
-          RenderBlock (anonymous) at (8,2) size 30x13
-            RenderText at (0,0) size 30x13
-              text run at (0,0) width 30 RTL: "\x{5DB}\x{5E4}\x{5EA}\x{5D5}\x{5E8}"
+        RenderButton {BUTTON} at (2,2) size 47x18 [bgcolor=#C0C0C0] [border: none (2px outset #C0C0C0) none (2px outset #C0C0C0)]
+          RenderBlock (anonymous) at (8,2) size 31x13
+            RenderText {#text} at (0,0) size 31x13
+              text run at (0,0) width 31 LTR override: "\x{5E8}\x{5D5}\x{5EA}\x{5E4}\x{5DB}"
+        RenderText {#text} at (50,1) size 5x18
+          text run at (50,1) width 5 LTR override: " "
+        RenderBR {BR} at (54,15) size 1x0
+        RenderButton {INPUT} at (2,24) size 47x18 [bgcolor=#C0C0C0]
+          RenderBlock (anonymous) at (8,2) size 31x13
+            RenderText at (0,0) size 31x13
+              text run at (0,0) width 31 RTL: "\x{5DB}\x{5E4}\x{5EA}\x{5D5}\x{5E8}"
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {HR} at (0,157) size 784x2 [border: (1px inset #000000)]
       RenderBlock {P} at (0,175) size 784x18

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/listbox-bidi-align-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/listbox-bidi-align-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/listbox-bidi-align-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/listbox-bidi-align-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -28,47 +28,47 @@
       RenderBlock (anonymous) at (0,168) size 784x18
         RenderText {#text} at (0,0) size 447x18
           text run at (0,0) width 447: "All the items in the following select elements should be right-aligned."
-      RenderTable {TABLE} at (0,186) size 652x132
-        RenderTableSection {TBODY} at (0,0) size 652x132
-          RenderTableRow {TR} at (0,2) size 652x63
+      RenderTable {TABLE} at (0,186) size 650x132
+        RenderTableSection {TBODY} at (0,0) size 650x132
+          RenderTableRow {TR} at (0,2) size 650x63
             RenderTableCell {TD} at (2,2) size 165x63 [r=0 c=0 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 159x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (169,2) size 156x63 [r=0 c=1 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 150x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (327,2) size 165x63 [r=0 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (169,2) size 155x63 [r=0 c=1 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 149x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (326,2) size 165x63 [r=0 c=2 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 159x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (494,2) size 156x63 [r=0 c=3 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 150x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-          RenderTableRow {TR} at (0,67) size 652x63
+            RenderTableCell {TD} at (493,2) size 155x63 [r=0 c=3 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 149x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+          RenderTableRow {TR} at (0,67) size 650x63
             RenderTableCell {TD} at (2,67) size 165x63 [r=1 c=0 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 159x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (169,67) size 156x63 [r=1 c=1 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 150x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (169,67) size 155x63 [r=1 c=1 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 149x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
       RenderBlock (anonymous) at (0,318) size 784x18
         RenderText {#text} at (0,0) size 456x18
           text run at (0,0) width 456: "All the items in the following select elements should be center-aligned."
-      RenderTable {TABLE} at (0,336) size 690x67
-        RenderTableSection {TBODY} at (0,0) size 690x67
-          RenderTableRow {TR} at (0,2) size 690x63
+      RenderTable {TABLE} at (0,336) size 688x67
+        RenderTableSection {TBODY} at (0,0) size 688x67
+          RenderTableRow {TR} at (0,2) size 688x63
             RenderTableCell {TD} at (2,2) size 174x63 [r=0 c=0 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 168x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (178,2) size 166x63 [r=0 c=1 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 160x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (346,2) size 174x63 [r=0 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (178,2) size 165x63 [r=0 c=1 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 159x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (345,2) size 174x63 [r=0 c=2 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 168x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (522,2) size 166x63 [r=0 c=3 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 160x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (521,2) size 165x63 [r=0 c=3 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 159x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
       RenderBlock (anonymous) at (0,403) size 784x18
         RenderText {#text} at (0,0) size 296x18
           text run at (0,0) width 296: "The following tables check mixed alignments."
-      RenderTable {TABLE} at (0,421) size 732x67
-        RenderTableSection {TBODY} at (0,0) size 732x67
-          RenderTableRow {TR} at (0,2) size 732x63
+      RenderTable {TABLE} at (0,421) size 734x67
+        RenderTableSection {TBODY} at (0,0) size 734x67
+          RenderTableRow {TR} at (0,2) size 734x63
             RenderTableCell {TD} at (2,2) size 169x63 [r=0 c=0 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 163x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
             RenderTableCell {TD} at (173,2) size 169x63 [r=0 c=1 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 163x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (344,2) size 192x63 [r=0 c=2 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 186x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (538,2) size 192x63 [r=0 c=3 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 186x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (344,2) size 193x63 [r=0 c=2 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 187x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (539,2) size 193x63 [r=0 c=3 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 187x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/listbox-hit-test-zoomed-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/listbox-hit-test-zoomed-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/listbox-hit-test-zoomed-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/listbox-hit-test-zoomed-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -4,7 +4,7 @@
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (9,9) size 782x582
       RenderBlock (anonymous) at (0,0) size 781x162
-        RenderListBox {SELECT} at (2,0) size 127x162 [bgcolor=#FFFFFF] [border: (12px solid #000000)]
+        RenderListBox {SELECT} at (2,0) size 126x162 [bgcolor=#FFFFFF] [border: (12px solid #000000)]
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {DIV} at (0,162) size 781x66
         RenderText {#text} at (0,0) size 62x22

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/search-rtl-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/search-rtl-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/search-rtl-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/search-rtl-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -44,16 +44,16 @@
 layer at (32,47) size 140x13
   RenderBlock {DIV} at (0,0) size 140x13
     RenderText {#text} at (7,0) size 133x13
-      text run at (7,0) width 22 RTL: " \x{5D5}\x{5D6}\x{5D4}\x{5D5}"
-      text run at (28,0) width 20: "she"
-      text run at (47,0) width 44 RTL: " \x{5D5}\x{5D4}\x{5D9}\x{5D0} \x{5D6}\x{5D4} "
+      text run at (7,0) width 23 RTL: " \x{5D5}\x{5D6}\x{5D4}\x{5D5}"
+      text run at (29,0) width 20: "she"
+      text run at (48,0) width 43 RTL: " \x{5D5}\x{5D4}\x{5D9}\x{5D0} \x{5D6}\x{5D4} "
       text run at (90,0) width 14: "he"
       text run at (103,0) width 37 RTL: "\x{5D4}\x{5D5}\x{5D0} \x{5D6}\x{5D4} "
 layer at (32,70) size 210x13
   RenderBlock {DIV} at (0,0) size 210x13
-    RenderText {#text} at (76,0) size 134x13
-      text run at (76,0) width 23 RTL: " \x{5D5}\x{5D6}\x{5D4}\x{5D5}"
-      text run at (98,0) width 20: "she"
+    RenderText {#text} at (77,0) size 133x13
+      text run at (77,0) width 23 RTL: " \x{5D5}\x{5D6}\x{5D4}\x{5D5}"
+      text run at (99,0) width 19: "she"
       text run at (117,0) width 44 RTL: " \x{5D5}\x{5D4}\x{5D9}\x{5D0} \x{5D6}\x{5D4} "
       text run at (160,0) width 14: "he"
       text run at (173,0) width 37 RTL: "\x{5D4}\x{5D5}\x{5D0} \x{5D6}\x{5D4} "

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/searchfield-heights-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/searchfield-heights-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/searchfield-heights-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -20,11 +20,11 @@
           RenderBlock {DIV} at (147,0) size 20x19
       RenderText {#text} at (326,20) size 5x18
         text run at (326,20) width 5: " "
-      RenderTextControl {INPUT} at (332,18) size 204x22 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-        RenderFlexibleBox {DIV} at (3,0) size 197x22
+      RenderTextControl {INPUT} at (332,18) size 201x22 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+        RenderFlexibleBox {DIV} at (3,0) size 195x22
           RenderBlock {DIV} at (0,0) size 10x22
-          RenderBlock {DIV} at (10,3) size 165x16
-          RenderBlock {DIV} at (174,0) size 23x22
+          RenderBlock {DIV} at (10,3) size 163x16
+          RenderBlock {DIV} at (172,0) size 23x22
       RenderText {#text} at (0,0) size 0x0
 layer at (19,33) size 117x11
   RenderBlock {DIV} at (0,0) size 117x11
@@ -34,7 +34,7 @@
   RenderBlock {DIV} at (0,0) size 140x13
     RenderText {#text} at (0,0) size 28x13
       text run at (0,0) width 28: "small"
-layer at (354,29) size 165x16 backgroundClip at (354,29) size 164x16 clip at (354,29) size 164x16
-  RenderBlock {DIV} at (0,0) size 165x16
-    RenderText {#text} at (0,0) size 44x16
-      text run at (0,0) width 44: "regular"
+layer at (354,29) size 162x16
+  RenderBlock {DIV} at (0,0) size 163x16
+    RenderText {#text} at (0,0) size 43x16
+      text run at (0,0) width 43: "regular"

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/select-visual-hebrew-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/select-visual-hebrew-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/select-visual-hebrew-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/select-visual-hebrew-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -11,8 +11,8 @@
         RenderText {#text} at (0,1) size 398x18
           text run at (0,1) width 398 LTR override: "Text on the pop-up and in the list should look like this: \x{5E8}\x{5D5}\x{5EA}\x{5E4}\x{5DB}"
       RenderBlock (anonymous) at (0,87) size 784x22
-        RenderMenuList {SELECT} at (2,2) size 61x18 [bgcolor=#FFFFFF]
-          RenderBlock (anonymous) at (0,0) size 61x18
-            RenderText at (8,2) size 30x13
-              text run at (8,2) width 30 RTL: "\x{5DB}\x{5E4}\x{5EA}\x{5D5}\x{5E8}"
+        RenderMenuList {SELECT} at (2,2) size 62x18 [bgcolor=#FFFFFF]
+          RenderBlock (anonymous) at (0,0) size 62x18
+            RenderText at (8,2) size 31x13
+              text run at (8,2) width 31 RTL: "\x{5DB}\x{5E4}\x{5EA}\x{5D5}\x{5E8}"
         RenderText {#text} at (0,0) size 0x0

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/visual-hebrew-text-field-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/visual-hebrew-text-field-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/visual-hebrew-text-field-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/forms/visual-hebrew-text-field-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -24,5 +24,5 @@
         RenderText {#text} at (0,0) size 0x0
 layer at (13,118) size 140x13
   RenderBlock {DIV} at (3,3) size 140x13
-    RenderText {#text} at (0,0) size 30x13
-      text run at (0,0) width 30 RTL: "\x{5DB}\x{5E4}\x{5EA}\x{5D5}\x{5E8}"
+    RenderText {#text} at (0,0) size 31x13
+      text run at (0,0) width 31 RTL: "\x{5DB}\x{5E4}\x{5EA}\x{5D5}\x{5E8}"

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/drawBidiText-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/drawBidiText-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/drawBidiText-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/drawBidiText-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -6,5 +6,5 @@
       RenderBlock {P} at (0,0) size 784x18
         RenderText {#text} at (0,0) size 285x18
           text run at (0,0) width 285: "This tests GraphicsContext::drawBidiText()."
-      RenderListBox {SELECT} at (2,34) size 331x199 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+      RenderListBox {SELECT} at (2,34) size 333x199 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
       RenderListBox {SELECT} at (2,235) size 378x18 [bgcolor=#FFFFFF] [border: (1px inset #808080)]

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -10,12 +10,12 @@
       RenderBlock {DIV} at (0,34) size 784x242
         RenderMenuList {SELECT} at (0,0) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (8,2) size 158x16
+            RenderText at (8,2) size 160x16
               text run at (8,2) width 31: "First "
-              text run at (38,2) width 48 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-              text run at (85,2) width 17: "03"
-              text run at (101,2) width 37 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-              text run at (137,2) width 29: " fifth"
+              text run at (38,2) width 49 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+              text run at (86,2) width 17: "03"
+              text run at (102,2) width 37 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+              text run at (138,2) width 30: " fifth"
         RenderBlock {DIV} at (0,23) size 470x36
           RenderText {#text} at (10,10) size 163x16
             text run at (10,10) width 32: "First "
@@ -25,12 +25,12 @@
             text run at (141,10) width 32: " fifth"
         RenderMenuList {SELECT} at (0,61) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (8,2) size 158x16
+            RenderText at (8,2) size 160x16
               text run at (8,2) width 25: "fifth"
-              text run at (32,2) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-              text run at (83,2) width 17: "03"
-              text run at (99,2) width 41 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-              text run at (139,2) width 27: "First"
+              text run at (32,2) width 53 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+              text run at (84,2) width 17: "03"
+              text run at (100,2) width 41 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+              text run at (140,2) width 28: "First"
         RenderBlock {DIV} at (0,84) size 470x36
           RenderText {#text} at (10,10) size 163x16
             text run at (10,10) width 27: "fifth"
@@ -40,15 +40,15 @@
             text run at (144,10) width 29: "First"
         RenderMenuList {SELECT} at (0,122) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (8,2) size 158x16
-              text run at (8,2) width 158 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+            RenderText at (8,2) size 160x16
+              text run at (8,2) width 160 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderBlock {DIV} at (0,145) size 470x36
           RenderText {#text} at (10,10) size 163x16
             text run at (10,10) width 163 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderMenuList {SELECT} at (0,183) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (8,2) size 158x16
-              text run at (8,2) width 158 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+            RenderText at (8,2) size 160x16
+              text run at (8,2) width 160 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderBlock {DIV} at (0,206) size 470x36
           RenderText {#text} at (10,10) size 163x16
             text run at (10,10) width 163 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
@@ -55,9 +55,9 @@
       RenderBlock {DIV} at (0,278) size 784x242
         RenderMenuList {SELECT} at (0,0) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (334,2) size 158x16
-              text run at (334,2) width 31: "First "
-              text run at (364,2) width 48 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+            RenderText at (332,2) size 160x16
+              text run at (332,2) width 32: "First "
+              text run at (363,2) width 49 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
               text run at (411,2) width 17: "03"
               text run at (427,2) width 37 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
               text run at (463,2) width 29: " fifth"
@@ -70,9 +70,9 @@
             text run at (429,10) width 31: " fifth"
         RenderMenuList {SELECT} at (0,61) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (334,2) size 158x16
-              text run at (334,2) width 25: "fifth"
-              text run at (358,2) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+            RenderText at (332,2) size 160x16
+              text run at (332,2) width 26: "fifth"
+              text run at (357,2) width 53 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
               text run at (409,2) width 17: "03"
               text run at (425,2) width 41 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
               text run at (465,2) width 27: "First"
@@ -85,15 +85,15 @@
             text run at (432,10) width 28: "First"
         RenderMenuList {SELECT} at (0,122) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (334,2) size 158x16
-              text run at (334,2) width 158 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+            RenderText at (332,2) size 160x16
+              text run at (332,2) width 160 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderBlock {DIV} at (0,145) size 470x36
           RenderText {#text} at (297,10) size 163x16
             text run at (297,10) width 163 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderMenuList {SELECT} at (0,183) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (334,2) size 158x16
-              text run at (334,2) width 158 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+            RenderText at (332,2) size 160x16
+              text run at (332,2) width 160 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderBlock {DIV} at (0,206) size 470x36
           RenderText {#text} at (297,10) size 163x16
             text run at (297,10) width 163 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/updateNewFont-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/updateNewFont-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/updateNewFont-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac/fast/text/updateNewFont-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -3,5 +3,5 @@
 layer at (0,0) size 800x125
   RenderBlock {HTML} at (0,0) size 800x125
     RenderBody {BODY} at (8,8) size 784x109
-      RenderListBox {SELECT} at (0,0) size 35x109 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+      RenderListBox {SELECT} at (0,0) size 34x109 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
       RenderText {#text} at (0,0) size 0x0

Deleted: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/listbox-bidi-align-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/listbox-bidi-align-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/listbox-bidi-align-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/listbox-bidi-align-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -28,47 +28,47 @@
       RenderBlock (anonymous) at (0,168) size 784x18
         RenderText {#text} at (0,0) size 447x18
           text run at (0,0) width 447: "All the items in the following select elements should be right-aligned."
-      RenderTable {TABLE} at (0,186) size 656x132
-        RenderTableSection {TBODY} at (0,0) size 656x132
-          RenderTableRow {TR} at (0,2) size 656x63
+      RenderTable {TABLE} at (0,186) size 654x132
+        RenderTableSection {TBODY} at (0,0) size 654x132
+          RenderTableRow {TR} at (0,2) size 654x63
             RenderTableCell {TD} at (2,2) size 166x63 [r=0 c=0 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 160x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (170,2) size 157x63 [r=0 c=1 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 151x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (329,2) size 166x63 [r=0 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (170,2) size 156x63 [r=0 c=1 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 150x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (328,2) size 166x63 [r=0 c=2 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 160x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (497,2) size 157x63 [r=0 c=3 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 151x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-          RenderTableRow {TR} at (0,67) size 656x63
+            RenderTableCell {TD} at (496,2) size 156x63 [r=0 c=3 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 150x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+          RenderTableRow {TR} at (0,67) size 654x63
             RenderTableCell {TD} at (2,67) size 166x63 [r=1 c=0 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 160x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (170,67) size 157x63 [r=1 c=1 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 151x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (170,67) size 156x63 [r=1 c=1 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 150x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
       RenderBlock (anonymous) at (0,318) size 784x18
         RenderText {#text} at (0,0) size 456x18
           text run at (0,0) width 456: "All the items in the following select elements should be center-aligned."
-      RenderTable {TABLE} at (0,336) size 694x67
-        RenderTableSection {TBODY} at (0,0) size 694x67
-          RenderTableRow {TR} at (0,2) size 694x63
+      RenderTable {TABLE} at (0,336) size 692x67
+        RenderTableSection {TBODY} at (0,0) size 692x67
+          RenderTableRow {TR} at (0,2) size 692x63
             RenderTableCell {TD} at (2,2) size 175x63 [r=0 c=0 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 169x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (179,2) size 167x63 [r=0 c=1 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 161x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (348,2) size 175x63 [r=0 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (179,2) size 166x63 [r=0 c=1 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 160x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (347,2) size 175x63 [r=0 c=2 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 169x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (525,2) size 167x63 [r=0 c=3 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 161x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (524,2) size 166x63 [r=0 c=3 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 160x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
       RenderBlock (anonymous) at (0,403) size 784x18
         RenderText {#text} at (0,0) size 296x18
           text run at (0,0) width 296: "The following tables check mixed alignments."
-      RenderTable {TABLE} at (0,421) size 736x67
-        RenderTableSection {TBODY} at (0,0) size 736x67
-          RenderTableRow {TR} at (0,2) size 736x63
+      RenderTable {TABLE} at (0,421) size 740x67
+        RenderTableSection {TBODY} at (0,0) size 740x67
+          RenderTableRow {TR} at (0,2) size 740x63
             RenderTableCell {TD} at (2,2) size 170x63 [r=0 c=0 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 164x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
             RenderTableCell {TD} at (174,2) size 170x63 [r=0 c=1 rs=1 cs=1]
               RenderListBox {SELECT} at (3,3) size 164x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (346,2) size 193x63 [r=0 c=2 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 187x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
-            RenderTableCell {TD} at (541,2) size 193x63 [r=0 c=3 rs=1 cs=1]
-              RenderListBox {SELECT} at (3,3) size 187x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (346,2) size 195x63 [r=0 c=2 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 189x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+            RenderTableCell {TD} at (543,2) size 195x63 [r=0 c=3 rs=1 cs=1]
+              RenderListBox {SELECT} at (3,3) size 189x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]

Deleted: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/search-rtl-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/search-rtl-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/search-rtl-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/search-rtl-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -41,12 +41,12 @@
       RenderBlock {P} at (0,119) size 784x18
         RenderText {#text} at (0,0) size 37x18
           text run at (0,0) width 37: "PASS"
-layer at (32,47) size 130x13 scrollX 4 scrollWidth 134
+layer at (32,47) size 130x13 scrollX 3 scrollWidth 134
   RenderBlock {DIV} at (0,0) size 131x13
     RenderText {#text} at (-3,0) size 135x13
       text run at (-3,0) width 22 RTL: " \x{5D5}\x{5D6}\x{5D4}\x{5D5}"
-      text run at (18,0) width 19: "she"
-      text run at (36,0) width 45 RTL: " \x{5D5}\x{5D4}\x{5D9}\x{5D0} \x{5D6}\x{5D4} "
+      text run at (18,0) width 20: "she"
+      text run at (37,0) width 44 RTL: " \x{5D5}\x{5D4}\x{5D9}\x{5D0} \x{5D6}\x{5D4} "
       text run at (80,0) width 14: "he"
       text run at (93,0) width 38 RTL: "\x{5D4}\x{5D5}\x{5D0} \x{5D6}\x{5D4} "
 layer at (32,70) size 196x13

Deleted: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/searchfield-heights-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/searchfield-heights-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/searchfield-heights-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/searchfield-heights-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -20,11 +20,11 @@
           RenderBlock {DIV} at (138,0) size 20x19
       RenderText {#text} at (309,20) size 5x18
         text run at (309,20) width 5: " "
-      RenderTextControl {INPUT} at (315,18) size 193x22 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-        RenderFlexibleBox {DIV} at (3,0) size 186x22
+      RenderTextControl {INPUT} at (315,18) size 191x22 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+        RenderFlexibleBox {DIV} at (3,0) size 185x22
           RenderBlock {DIV} at (0,0) size 10x22
-          RenderBlock {DIV} at (10,3) size 154x16
-          RenderBlock {DIV} at (164,0) size 22x22
+          RenderBlock {DIV} at (10,3) size 153x16
+          RenderBlock {DIV} at (162,0) size 23x22
       RenderText {#text} at (0,0) size 0x0
 layer at (19,33) size 109x11
   RenderBlock {DIV} at (0,0) size 110x11
@@ -34,7 +34,7 @@
   RenderBlock {DIV} at (0,0) size 131x13
     RenderText {#text} at (0,0) size 28x13
       text run at (0,0) width 28: "small"
-layer at (336,29) size 154x16
-  RenderBlock {DIV} at (0,0) size 154x16
+layer at (336,29) size 152x16
+  RenderBlock {DIV} at (0,0) size 153x16
     RenderText {#text} at (0,0) size 43x16
       text run at (0,0) width 43: "regular"

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/visual-hebrew-text-field-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/visual-hebrew-text-field-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/forms/visual-hebrew-text-field-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -24,5 +24,5 @@
         RenderText {#text} at (0,0) size 0x0
 layer at (13,118) size 130x13
   RenderBlock {DIV} at (3,3) size 131x13
-    RenderText {#text} at (0,0) size 30x13
-      text run at (0,0) width 30 RTL: "\x{5DB}\x{5E4}\x{5EA}\x{5D5}\x{5E8}"
+    RenderText {#text} at (0,0) size 31x13
+      text run at (0,0) width 31 RTL: "\x{5DB}\x{5E4}\x{5EA}\x{5D5}\x{5E8}"

Deleted: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/text/drawBidiText-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/text/drawBidiText-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/text/drawBidiText-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/text/drawBidiText-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -6,5 +6,5 @@
       RenderBlock {P} at (0,0) size 784x18
         RenderText {#text} at (0,0) size 285x18
           text run at (0,0) width 285: "This tests GraphicsContext::drawBidiText()."
-      RenderListBox {SELECT} at (2,34) size 332x199 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+      RenderListBox {SELECT} at (2,34) size 335x199 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
       RenderListBox {SELECT} at (2,235) size 385x18 [bgcolor=#FFFFFF] [border: (1px inset #808080)]

Deleted: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png


(Binary files differ)

Modified: branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt (218009 => 218010)


--- branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/LayoutTests/platform/mac-elcapitan/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt	2017-06-09 19:00:07 UTC (rev 218010)
@@ -10,12 +10,12 @@
       RenderBlock {DIV} at (0,34) size 784x242
         RenderMenuList {SELECT} at (0,0) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (8,2) size 156x16
+            RenderText at (8,2) size 157x16
               text run at (8,2) width 31: "First "
-              text run at (38,2) width 48 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-              text run at (85,2) width 16: "03"
-              text run at (100,2) width 37 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-              text run at (136,2) width 28: " fifth"
+              text run at (38,2) width 49 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+              text run at (86,2) width 16: "03"
+              text run at (101,2) width 37 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+              text run at (137,2) width 28: " fifth"
         RenderBlock {DIV} at (0,23) size 470x36
           RenderText {#text} at (10,10) size 163x16
             text run at (10,10) width 32: "First "
@@ -25,12 +25,12 @@
             text run at (141,10) width 32: " fifth"
         RenderMenuList {SELECT} at (0,61) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (8,2) size 156x16
+            RenderText at (8,2) size 157x16
               text run at (8,2) width 24: "fifth"
-              text run at (31,2) width 51 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-              text run at (81,2) width 17: "03"
-              text run at (97,2) width 40 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-              text run at (136,2) width 28: "First"
+              text run at (31,2) width 53 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+              text run at (83,2) width 16: "03"
+              text run at (98,2) width 40 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+              text run at (137,2) width 28: "First"
         RenderBlock {DIV} at (0,84) size 470x36
           RenderText {#text} at (10,10) size 163x16
             text run at (10,10) width 27: "fifth"
@@ -40,15 +40,15 @@
             text run at (144,10) width 29: "First"
         RenderMenuList {SELECT} at (0,122) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (8,2) size 156x16
-              text run at (8,2) width 156 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+            RenderText at (8,2) size 157x16
+              text run at (8,2) width 157 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderBlock {DIV} at (0,145) size 470x36
           RenderText {#text} at (10,10) size 163x16
             text run at (10,10) width 163 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderMenuList {SELECT} at (0,183) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (8,2) size 156x16
-              text run at (8,2) width 156 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+            RenderText at (8,2) size 157x16
+              text run at (8,2) width 157 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderBlock {DIV} at (0,206) size 470x36
           RenderText {#text} at (10,10) size 163x16
             text run at (10,10) width 163 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
@@ -55,9 +55,9 @@
       RenderBlock {DIV} at (0,278) size 784x242
         RenderMenuList {SELECT} at (0,0) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (336,2) size 156x16
-              text run at (336,2) width 32: "First "
-              text run at (367,2) width 47 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+            RenderText at (335,2) size 157x16
+              text run at (335,2) width 32: "First "
+              text run at (366,2) width 48 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
               text run at (413,2) width 17: "03"
               text run at (429,2) width 36 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
               text run at (464,2) width 28: " fifth"
@@ -70,12 +70,12 @@
             text run at (429,10) width 31: " fifth"
         RenderMenuList {SELECT} at (0,61) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (336,2) size 156x16
-              text run at (336,2) width 24: "fifth"
-              text run at (359,2) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+            RenderText at (335,2) size 158x16
+              text run at (335,2) width 24: "fifth"
+              text run at (358,2) width 53 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
               text run at (410,2) width 16: "03"
               text run at (425,2) width 40 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-              text run at (464,2) width 28: "First"
+              text run at (464,2) width 29: "First"
         RenderBlock {DIV} at (0,84) size 470x36
           RenderText {#text} at (297,10) size 163x16
             text run at (297,10) width 28: "fifth"
@@ -85,15 +85,15 @@
             text run at (432,10) width 28: "First"
         RenderMenuList {SELECT} at (0,122) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (336,2) size 156x16
-              text run at (336,2) width 156 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+            RenderText at (335,2) size 157x16
+              text run at (335,2) width 157 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderBlock {DIV} at (0,145) size 470x36
           RenderText {#text} at (297,10) size 163x16
             text run at (297,10) width 163 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderMenuList {SELECT} at (0,183) size 500x21 [bgcolor=#FFFFFF]
           RenderBlock (anonymous) at (0,0) size 500x21
-            RenderText at (336,2) size 156x16
-              text run at (336,2) width 156 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+            RenderText at (335,2) size 157x16
+              text run at (335,2) width 157 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
         RenderBlock {DIV} at (0,206) size 470x36
           RenderText {#text} at (297,10) size 163x16
             text run at (297,10) width 163 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"

Modified: branches/safari-604.1.25-branch/Source/WebCore/ChangeLog (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/ChangeLog	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/ChangeLog	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,3 +1,11 @@
+2017-06-09  Matthew Hanson  <matthew_han...@apple.com>
+
+        Cherry-pick r218009. rdar://problem/32677465
+
+    2017-06-09  Matthew Hanson  <matthew_han...@apple.com>
+
+            Revert r217955. rdar://problem/21125708
+
 2017-06-08  Dean Jackson  <d...@apple.com>
 
         Disable some features on this release branch.

Modified: branches/safari-604.1.25-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-06-09 19:00:07 UTC (rev 218010)
@@ -991,9 +991,6 @@
 		1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */; };
 		1C0939EB1A13E12900B788E5 /* CachedSVGFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0939E91A13E12900B788E5 /* CachedSVGFont.h */; };
 		1C09D0591E31C6A900725F18 /* libPAL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C09D0501E31C32900725F18 /* libPAL.a */; };
-		1C12AC2A1EE778AE0079E0A0 /* FontFamilySpecificationCoreText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C12AC281EE778AE0079E0A0 /* FontFamilySpecificationCoreText.cpp */; };
-		1C12AC2B1EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C12AC291EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		1C12AC2D1EE779950079E0A0 /* FontDescriptionCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C12AC2C1EE779950079E0A0 /* FontDescriptionCocoa.cpp */; };
 		1C18DA58181AF6A500C4EF22 /* TextPainter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C18DA56181AF6A500C4EF22 /* TextPainter.cpp */; };
 		1C18DA59181AF6A500C4EF22 /* TextPainter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C18DA57181AF6A500C4EF22 /* TextPainter.h */; };
 		1C21E57C183ED1FF001C289D /* IOSurfacePool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C21E57A183ED1FF001C289D /* IOSurfacePool.cpp */; };
@@ -8520,9 +8517,6 @@
 		1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedSVGFont.cpp; sourceTree = "<group>"; };
 		1C0939E91A13E12900B788E5 /* CachedSVGFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGFont.h; sourceTree = "<group>"; };
 		1C09D04B1E31C32800725F18 /* PAL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PAL.xcodeproj; path = PAL/PAL.xcodeproj; sourceTree = "<group>"; };
-		1C12AC281EE778AE0079E0A0 /* FontFamilySpecificationCoreText.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FontFamilySpecificationCoreText.cpp; sourceTree = "<group>"; };
-		1C12AC291EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontFamilySpecificationCoreText.h; sourceTree = "<group>"; };
-		1C12AC2C1EE779950079E0A0 /* FontDescriptionCocoa.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FontDescriptionCocoa.cpp; sourceTree = "<group>"; };
 		1C18DA56181AF6A500C4EF22 /* TextPainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextPainter.cpp; sourceTree = "<group>"; };
 		1C18DA57181AF6A500C4EF22 /* TextPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPainter.h; sourceTree = "<group>"; };
 		1C21E57A183ED1FF001C289D /* IOSurfacePool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IOSurfacePool.cpp; sourceTree = "<group>"; };
@@ -23505,9 +23499,6 @@
 				CD5D27751E8318E000D80A3D /* WebCoreDecompressionSession.mm */,
 				316BDB8A1E6E153000DE0D5A /* WebGPULayer.h */,
 				316BDB891E6E153000DE0D5A /* WebGPULayer.mm */,
-				1C12AC281EE778AE0079E0A0 /* FontFamilySpecificationCoreText.cpp */,
-				1C12AC291EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h */,
-				1C12AC2C1EE779950079E0A0 /* FontDescriptionCocoa.cpp */,
 			);
 			path = cocoa;
 			sourceTree = "<group>";
@@ -26828,7 +26819,6 @@
 				262391361A648CEE007251A3 /* ContentExtensionsDebugging.h in Headers */,
 				51FB67DC1AE6B82F00D06C5A /* ContentExtensionStyleSheet.h in Headers */,
 				A149786F1ABAF33800CEF7E4 /* ContentFilter.h in Headers */,
-				1C12AC2B1EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h in Headers */,
 				A14090FD1AA51E480091191A /* ContentFilterUnblockHandler.h in Headers */,
 				97C471DC12F925BD0086354B /* ContentSecurityPolicy.h in Headers */,
 				CE799FA41C6A503A0097B518 /* ContentSecurityPolicyDirective.h in Headers */,
@@ -31384,7 +31374,6 @@
 				4A6E9FC713C17D570046A7F8 /* FontTaggedSettings.cpp in Sources */,
 				1C3249111C6D6A3B007EDB32 /* FontVariantBuilder.cpp in Sources */,
 				4A0DA2FE129B241900AB61E1 /* FormAssociatedElement.cpp in Sources */,
-				1C12AC2A1EE778AE0079E0A0 /* FontFamilySpecificationCoreText.cpp in Sources */,
 				D05CED290A40BB2C00C5AF38 /* FormatBlockCommand.cpp in Sources */,
 				7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */,
 				F50664F7157F52DC00AC226F /* FormController.cpp in Sources */,
@@ -32610,7 +32599,6 @@
 				CDCA98EB18B2C8EB00C12FF9 /* LegacyCDMPrivateMediaPlayer.cpp in Sources */,
 				CDE8B5F01A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp in Sources */,
 				E4C3B1FC0F0E4170009693F6 /* LegacyTileCache.mm in Sources */,
-				1C12AC2D1EE779950079E0A0 /* FontDescriptionCocoa.cpp in Sources */,
 				E4B65A5A132FAAF90070E7BE /* LegacyTileGrid.mm in Sources */,
 				E424A3A01330DF1E00CF6DC9 /* LegacyTileGridTile.mm in Sources */,
 				E4B65A5E132FADB60070E7BE /* LegacyTileLayer.mm in Sources */,

Modified: branches/safari-604.1.25-branch/Source/WebCore/page/MemoryRelease.cpp (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/page/MemoryRelease.cpp	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/page/MemoryRelease.cpp	2017-06-09 19:00:07 UTC (rev 218010)
@@ -60,7 +60,6 @@
     RenderTheme::singleton().purgeCaches();
 
     FontCache::singleton().purgeInactiveFontData();
-    FontDescription::invalidateCaches();
 
     clearWidthCaches();
 

Modified: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontCascadeFonts.cpp (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontCascadeFonts.cpp	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontCascadeFonts.cpp	2017-06-09 19:00:07 UTC (rev 218010)
@@ -138,28 +138,20 @@
 
 static FontRanges realizeNextFallback(const FontCascadeDescription& description, unsigned& index, FontSelector* fontSelector)
 {
-    ASSERT(index < description.effectiveFamilyCount());
+    ASSERT(index < description.familyCount());
 
     auto& fontCache = FontCache::singleton();
-    while (index < description.effectiveFamilyCount()) {
-        auto visitor = WTF::makeVisitor([&](const AtomicString& family) -> FontRanges {
-            if (family.isEmpty())
-                return FontRanges();
-            if (fontSelector) {
-                auto ranges = fontSelector->fontRangesForFamily(description, family);
-                if (!ranges.isNull())
-                    return ranges;
-            }
-            if (auto font = fontCache.fontForFamily(description, family))
-                return FontRanges(WTFMove(font));
-            return FontRanges();
-        }, [&](const FontFamilyPlatformSpecification& fontFamilySpecification) -> FontRanges {
-            return fontFamilySpecification.fontRanges(description);
-        });
-        const auto& currentFamily = description.effectiveFamilyAt(index++);
-        auto ranges = WTF::visit(visitor, currentFamily);
-        if (!ranges.isNull())
-            return ranges;
+    while (index < description.familyCount()) {
+        const AtomicString& family = description.familyAt(index++);
+        if (family.isEmpty())
+            continue;
+        if (fontSelector) {
+            auto ranges = fontSelector->fontRangesForFamily(description, family);
+            if (!ranges.isNull())
+                return ranges;
+        }
+        if (auto font = fontCache.fontForFamily(description, family))
+            return FontRanges(WTFMove(font));
     }
     // We didn't find a font. Try to find a similar font using our own specific knowledge about our platform.
     // For example on OS X, we know to map any families containing the words Arabic, Pashto, or Urdu to the
@@ -191,13 +183,13 @@
         return fontRanges;
     }
 
-    if (m_lastRealizedFallbackIndex < description.effectiveFamilyCount())
+    if (m_lastRealizedFallbackIndex < description.familyCount())
         fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
 
     if (fontRanges.isNull() && m_fontSelector) {
-        ASSERT(m_lastRealizedFallbackIndex >= description.effectiveFamilyCount());
+        ASSERT(m_lastRealizedFallbackIndex >= description.familyCount());
 
-        unsigned fontSelectorFallbackIndex = m_lastRealizedFallbackIndex - description.effectiveFamilyCount();
+        unsigned fontSelectorFallbackIndex = m_lastRealizedFallbackIndex - description.familyCount();
         if (fontSelectorFallbackIndex == m_fontSelector->fallbackFontCount())
             return fontRanges;
         ++m_lastRealizedFallbackIndex;

Modified: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontDescription.cpp (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontDescription.cpp	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontDescription.cpp	2017-06-09 19:00:07 UTC (rev 218010)
@@ -97,22 +97,6 @@
 {
 }
 
-#if !PLATFORM(COCOA)
-void FontDescription::invalidateCaches()
-{
-}
-    
-unsigned FontCascadeDescription::effectiveFamilyCount() const
-{
-    return familyCount();
-}
-
-FontFamilySpecification FontCascadeDescription::effectiveFamilyAt(unsigned i) const
-{
-    return familyAt(i);
-}
-#endif
-
 FontSelectionValue FontCascadeDescription::lighterWeight(FontSelectionValue weight)
 {
     if (weight < FontSelectionValue(100))

Modified: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontDescription.h (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontDescription.h	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontDescription.h	2017-06-09 19:00:07 UTC (rev 218010)
@@ -33,24 +33,9 @@
 #include <unicode/uscript.h>
 #include <wtf/MathExtras.h>
 #include <wtf/RefCountedArray.h>
-#include <wtf/Variant.h>
 
-#if PLATFORM(COCOA)
-#include "FontFamilySpecificationCoreText.h"
-#else
-#include "FontFamilySpecificationNull.h"
-#endif
-
 namespace WebCore {
 
-#if PLATFORM(COCOA)
-typedef FontFamilySpecificationCoreText FontFamilyPlatformSpecification;
-#else
-typedef FontFamilySpecificationNull FontFamilyPlatformSpecification;
-#endif
-
-typedef Variant<AtomicString, FontFamilyPlatformSpecification> FontFamilySpecification;
-
 using namespace WebKitFontFamilyNames;
 
 class FontDescription {
@@ -147,8 +132,6 @@
     void setOpticalSizing(FontOpticalSizing sizing) { m_opticalSizing = static_cast<unsigned>(sizing); }
     void setFontStyleAxis(FontStyleAxis axis) { m_fontStyleAxis = axis == FontStyleAxis::ital; }
 
-    static void invalidateCaches();
-
 private:
     // FIXME: Investigate moving these into their own object on the heap (to save memory).
     FontFeatureSettings m_featureSettings;
@@ -229,9 +212,6 @@
     const AtomicString& firstFamily() const { return familyAt(0); }
     const AtomicString& familyAt(unsigned i) const { return m_families[i]; }
     const RefCountedArray<AtomicString>& families() const { return m_families; }
-    
-    unsigned effectiveFamilyCount() const;
-    FontFamilySpecification effectiveFamilyAt(unsigned) const;
 
     float specifiedSize() const { return m_specifiedSize; }
     bool isAbsoluteSize() const { return m_isAbsoluteSize; }

Deleted: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontFamilySpecificationNull.h (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontFamilySpecificationNull.h	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/FontFamilySpecificationNull.h	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "FontSelector.h"
-
-namespace WebCore {
-
-class FontFamilySpecificationNull {
-public:
-    FontFamilySpecificationNull() = delete;
-    
-    FontRanges fontRanges(const FontDescription&) const
-    {
-        ASSERT_NOT_REACHED();
-        return FontRanges();
-    }
-};
-
-}
-

Modified: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2017-06-09 19:00:07 UTC (rev 218010)
@@ -720,16 +720,7 @@
 
 void FontCache::platformInit()
 {
-    CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, &fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFontsChangedNotification, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately);
-
-#if PLATFORM(MAC)
-    CFNotificationCenterRef center = CFNotificationCenterGetLocalCenter();
-    const CFStringRef notificationName = kCFLocaleCurrentLocaleDidChangeNotification;
-#else
-    CFNotificationCenterRef center = CFNotificationCenterGetDarwinNotifyCenter();
-    const CFStringRef notificationName = CFSTR("com.apple.language.changed");
-#endif
-    CFNotificationCenterAddObserver(center, this, &fontCacheRegisteredFontsChangedNotificationCallback, notificationName, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately);
+    CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFontsChangedNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
 }
 
 Vector<String> FontCache::systemFontFamilies()
@@ -1176,8 +1167,6 @@
         return;
     }
 
-    FontDescription::invalidateCaches();
-
     FontDatabase::singleton().clear();
 
     FontCache::singleton().invalidate();

Deleted: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,224 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FontDescription.h"
-
-#include "CoreTextSPI.h"
-#include "FontFamilySpecificationCoreText.h"
-#include <wtf/HashMap.h>
-#include <wtf/HashTraits.h>
-#include <wtf/text/AtomicString.h>
-#include <wtf/text/AtomicStringHash.h>
-
-namespace WebCore {
-
-class SystemFontDatabase {
-public:
-    struct CoreTextCascadeListParameters {
-        CoreTextCascadeListParameters()
-        {
-        }
-        
-        CoreTextCascadeListParameters(WTF::HashTableDeletedValueType)
-            : locale(WTF::HashTableDeletedValue)
-        {
-        }
-        
-        bool isHashTableDeletedValue() const
-        {
-            return locale.isHashTableDeletedValue();
-        }
-        
-        bool operator==(const CoreTextCascadeListParameters& other) const
-        {
-            return locale == other.locale
-                && weight == other.weight
-                && size == other.size
-                && italic == other.italic;
-        }
-        
-        unsigned hash() const
-        {
-            IntegerHasher hasher;
-            hasher.add(locale.isNull() ? 0 : locale.existingHash());
-            hasher.add(weight);
-            hasher.add(size);
-            hasher.add(italic);
-            return hasher.hash();
-        }
-    
-        AtomicString locale;
-        CGFloat weight { 0 };
-        float size { 0 };
-        bool italic { false };
-    };
-    
-    static SystemFontDatabase& singleton()
-    {
-        static NeverDestroyed<SystemFontDatabase> database = SystemFontDatabase();
-        return database.get();
-    }
-    
-    Vector<RetainPtr<CTFontDescriptorRef>> systemFontCascadeList(const CoreTextCascadeListParameters& parameters)
-    {
-        return m_systemFontCache.ensure(parameters, [&] {
-            auto localeString = parameters.locale.string().createCFString();
-            auto systemFont = adoptCF(CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, parameters.size, localeString.get()));
-            systemFont = applyWeightAndItalics(systemFont.get(), parameters.weight, parameters.italic, parameters.size);
-            return computeCascadeList(systemFont.get(), localeString.get());
-        }).iterator->value;
-    }
-    
-    void clear()
-    {
-        m_systemFontCache.clear();
-    }
-    
-private:
-    SystemFontDatabase()
-    {
-    }
-
-    static RetainPtr<CTFontRef> applyWeightAndItalics(CTFontRef font, CGFloat weight, bool italic, float size)
-    {
-        auto weightNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberCGFloatType, &weight));
-        const float systemFontItalicSlope = 0.07;
-        float italicsRawNumber = italic ? systemFontItalicSlope : 0;
-        auto italicsNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &italicsRawNumber));
-        CFTypeRef traitsKeys[] = { kCTFontWeightTrait, kCTFontSlantTrait, kCTFontUIFontDesignTrait };
-        CFTypeRef traitsValues[] = { weightNumber.get(), italicsNumber.get(), kCFBooleanTrue };
-        auto traitsDictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, traitsKeys, traitsValues, WTF_ARRAY_LENGTH(traitsKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-        CFTypeRef modificationKeys[] = { kCTFontTraitsAttribute };
-        CFTypeRef modificationValues[] = { traitsDictionary.get() };
-        auto attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, modificationKeys, modificationValues, WTF_ARRAY_LENGTH(modificationKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-        auto modification = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get()));
-        return adoptCF(CTFontCreateCopyWithAttributes(font, size, nullptr, modification.get()));
-    }
-    
-    static Vector<RetainPtr<CTFontDescriptorRef>> computeCascadeList(CTFontRef font, CFStringRef locale)
-    {
-        CFTypeRef arrayValues[] = { locale };
-        auto localeArray = adoptCF(CFArrayCreate(kCFAllocatorDefault, arrayValues, WTF_ARRAY_LENGTH(arrayValues), &kCFTypeArrayCallBacks));
-        auto cascadeList = adoptCF(CTFontCopyDefaultCascadeListForLanguages(font, localeArray.get()));
-        Vector<RetainPtr<CTFontDescriptorRef>> result;
-        result.append(adoptCF(CTFontCopyFontDescriptor(font)));
-        CFIndex arrayLength = CFArrayGetCount(cascadeList.get());
-        for (CFIndex i = 0; i < arrayLength; ++i)
-            result.append(static_cast<CTFontDescriptorRef>(CFArrayGetValueAtIndex(cascadeList.get(), i)));
-        return result;
-    }
-    
-    struct CoreTextCascadeListParametersHash : WTF::PairHash<AtomicString, float> {
-        static unsigned hash(const CoreTextCascadeListParameters& parameters)
-        {
-            return parameters.hash();
-        }
-        static bool equal(const CoreTextCascadeListParameters& a, const CoreTextCascadeListParameters& b)
-        {
-            return a == b;
-        }
-        static const bool safeToCompareToEmptyOrDeleted = true;
-    };
-    
-    HashMap<CoreTextCascadeListParameters, Vector<RetainPtr<CTFontDescriptorRef>>, CoreTextCascadeListParametersHash, SimpleClassHashTraits<CoreTextCascadeListParameters>> m_systemFontCache;
-};
-
-static inline bool isSystemFontString(const AtomicString& string)
-{
-    return equalLettersIgnoringASCIICase(string, "-webkit-system-font")
-        || equalLettersIgnoringASCIICase(string, "-apple-system")
-        || equalLettersIgnoringASCIICase(string, "-apple-system-font")
-        || equalLettersIgnoringASCIICase(string, "system-ui");
-}
-
-static inline SystemFontDatabase::CoreTextCascadeListParameters systemFontParameters(const FontCascadeDescription& description)
-{
-    SystemFontDatabase::CoreTextCascadeListParameters result;
-    result.locale = description.locale();
-    result.size = description.computedSize();
-    result.italic = isItalic(description.italic());
-    
-    auto weight = description.weight();
-    if (weight < FontSelectionValue(150))
-        result.weight = kCTFontWeightUltraLight;
-    else if (weight < FontSelectionValue(250))
-        result.weight = kCTFontWeightThin;
-    else if (weight < FontSelectionValue(350))
-        result.weight = kCTFontWeightLight;
-    else if (weight < FontSelectionValue(450))
-        result.weight = kCTFontWeightRegular;
-    else if (weight < FontSelectionValue(550))
-        result.weight = kCTFontWeightMedium;
-    else if (weight < FontSelectionValue(650))
-        result.weight = kCTFontWeightSemibold;
-    else if (weight < FontSelectionValue(750))
-        result.weight = kCTFontWeightBold;
-    else if (weight < FontSelectionValue(850))
-        result.weight = kCTFontWeightHeavy;
-    else
-        result.weight = kCTFontWeightBlack;
-        
-    return result;
-}
-
-void FontDescription::invalidateCaches()
-{
-    SystemFontDatabase::singleton().clear();
-}
-
-unsigned FontCascadeDescription::effectiveFamilyCount() const
-{
-    // FIXME: Move all the other system font keywords from platformFontWithFamilySpecialCase() to here.
-    unsigned result = 0;
-    for (unsigned i = 0; i < familyCount(); ++i) {
-        const auto& cssFamily = familyAt(i);
-        if (isSystemFontString(cssFamily))
-            result += SystemFontDatabase::singleton().systemFontCascadeList(systemFontParameters(*this)).size();
-        else
-            ++result;
-    }
-    return result;
-}
-
-FontFamilySpecification FontCascadeDescription::effectiveFamilyAt(unsigned index) const
-{
-    for (unsigned i = 0; i < familyCount(); ++i) {
-        const auto& cssFamily = familyAt(i);
-        if (isSystemFontString(cssFamily)) {
-            auto cascadeList = SystemFontDatabase::singleton().systemFontCascadeList(systemFontParameters(*this));
-            if (index < cascadeList.size())
-                return FontFamilySpecification(cascadeList[index].get());
-            index -= cascadeList.size();
-        } else if (!index)
-            return cssFamily;
-        else
-            --index;
-    }
-    ASSERT_NOT_REACHED();
-    return nullAtom;
-}
-
-}

Deleted: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FontFamilySpecificationCoreText.h"
-
-#include "FontCache.h"
-
-namespace WebCore {
-
-FontRanges FontFamilySpecificationCoreText::fontRanges(const FontDescription& fontDescription) const
-{
-    auto size = fontDescription.computedSize();
-    
-    auto font = adoptCF(CTFontCreateWithFontDescriptor(m_fontDescriptor.get(), size, nullptr));
-
-    font = preparePlatformFont(font.get(), fontDescription, nullptr, nullptr, { }, fontDescription.computedSize());
-    
-    bool syntheticBold, syntheticOblique;
-    std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair();
-    
-    FontPlatformData fontPlatformData(font.get(), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode());
-    
-    return FontRanges(FontCache::singleton().fontForPlatformData(fontPlatformData));
-}
-
-}

Deleted: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.h (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.h	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.h	2017-06-09 19:00:07 UTC (rev 218010)
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "FontSelector.h"
-#include <CoreText/CoreText.h>
-#include <wtf/RetainPtr.h>
-
-namespace WebCore {
-
-class FontFamilySpecificationCoreText {
-public:
-    FontFamilySpecificationCoreText(CTFontDescriptorRef fontDescriptor)
-        : m_fontDescriptor(fontDescriptor)
-    {
-    }
-    
-    FontRanges fontRanges(const FontDescription&) const;
-
-private:
-    RetainPtr<CTFontDescriptorRef> m_fontDescriptor;
-};
-
-}

Modified: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2017-06-09 19:00:07 UTC (rev 218010)
@@ -85,6 +85,69 @@
     return *fontForFamily(fontDescription, AtomicString(".PhoneFallback", AtomicString::ConstructFromLiteral));
 }
 
+static RetainPtr<CTFontDescriptorRef> baseSystemFontDescriptor(FontSelectionValue weight, bool bold, float size)
+{
+    CTFontUIFontType fontType = kCTFontUIFontSystem;
+    if (weight >= FontSelectionValue(350)) {
+        if (bold)
+            fontType = kCTFontUIFontEmphasizedSystem;
+    } else if (weight >= FontSelectionValue(250))
+        fontType = static_cast<CTFontUIFontType>(kCTFontUIFontSystemLight);
+    else if (weight >= FontSelectionValue(150))
+        fontType = static_cast<CTFontUIFontType>(kCTFontUIFontSystemThin);
+    else
+        fontType = static_cast<CTFontUIFontType>(kCTFontUIFontSystemUltraLight);
+    return adoptCF(CTFontDescriptorCreateForUIType(fontType, size, nullptr));
+}
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+static RetainPtr<NSDictionary> systemFontModificationAttributes(FontSelectionValue weight, bool italic)
+{
+    RetainPtr<NSMutableDictionary> traitsDictionary = adoptNS([[NSMutableDictionary alloc] init]);
+
+    float ctWeight = kCTFontWeightRegular;
+    if (weight < FontSelectionValue(150))
+        ctWeight = kCTFontWeightUltraLight;
+    else if (weight < FontSelectionValue(250))
+        ctWeight = kCTFontWeightThin;
+    else if (weight < FontSelectionValue(350))
+        ctWeight = kCTFontWeightLight;
+    else if (weight < FontSelectionValue(450))
+        ctWeight = kCTFontWeightRegular;
+    else if (weight < FontSelectionValue(550))
+        ctWeight = kCTFontWeightMedium;
+    else if (weight < FontSelectionValue(650))
+        ctWeight = kCTFontWeightSemibold;
+    else if (weight < FontSelectionValue(750))
+        ctWeight = kCTFontWeightBold;
+    else if (weight < FontSelectionValue(850))
+        ctWeight = kCTFontWeightHeavy;
+    else
+        ctWeight = kCTFontWeightBlack;
+    [traitsDictionary setObject:[NSNumber numberWithFloat:ctWeight] forKey:static_cast<NSString *>(kCTFontWeightTrait)];
+
+    [traitsDictionary setObject:@YES forKey:static_cast<NSString *>(kCTFontUIFontDesignTrait)];
+
+    if (italic)
+        [traitsDictionary setObject:[NSNumber numberWithInt:kCTFontItalicTrait] forKey:static_cast<NSString *>(kCTFontSymbolicTrait)];
+
+    return @{ static_cast<NSString *>(kCTFontTraitsAttribute) : traitsDictionary.get() };
+}
+#endif
+
+static RetainPtr<CTFontDescriptorRef> systemFontDescriptor(FontSelectionValue weight, bool bold, bool italic, float size)
+{
+    RetainPtr<CTFontDescriptorRef> fontDescriptor = baseSystemFontDescriptor(weight, bold, size);
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+    RetainPtr<NSDictionary> attributes = systemFontModificationAttributes(weight, italic);
+    return adoptCF(CTFontDescriptorCreateCopyWithAttributes(fontDescriptor.get(), static_cast<CFDictionaryRef>(attributes.get())));
+#else
+    if (italic)
+        return adoptCF(CTFontDescriptorCreateCopyWithSymbolicTraits(fontDescriptor.get(), kCTFontItalicTrait, kCTFontItalicTrait));
+    return fontDescriptor;
+#endif
+}
+
 RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomicString& family, FontSelectionRequest request, float size)
 {
     if (family.startsWith("UICTFontTextStyle")) {
@@ -97,6 +160,10 @@
         return adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), size, nullptr));
     }
 
+    if (equalLettersIgnoringASCIICase(family, "-webkit-system-font") || equalLettersIgnoringASCIICase(family, "-apple-system") || equalLettersIgnoringASCIICase(family, "-apple-system-font") || equalLettersIgnoringASCIICase(family, "system-ui")) {
+        return adoptCF(CTFontCreateWithFontDescriptor(systemFontDescriptor(request.weight, isFontWeightBold(request.weight), isItalic(request.slope), size).get(), size, nullptr));
+    }
+
     if (equalLettersIgnoringASCIICase(family, "-apple-system-monospaced-numbers")) {
         RetainPtr<CTFontDescriptorRef> systemFontDescriptor = adoptCF(CTFontDescriptorCreateForUIType(kCTFontUIFontSystem, size, nullptr));
         RetainPtr<CTFontDescriptorRef> monospaceFontDescriptor = adoptCF(CTFontDescriptorCreateCopyWithFeature(systemFontDescriptor.get(), (CFNumberRef)@(kNumberSpacingType), (CFNumberRef)@(kMonospacedNumbersSelector)));

Modified: branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (218009 => 218010)


--- branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2017-06-09 18:56:44 UTC (rev 218009)
+++ branches/safari-604.1.25-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2017-06-09 19:00:07 UTC (rev 218010)
@@ -59,8 +59,41 @@
 
 #if PLATFORM(MAC)
 
-RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomicString& family, FontSelectionRequest, float size)
+static CGFloat toNSFontWeight(FontSelectionValue fontWeight)
 {
+    if (fontWeight < FontSelectionValue(150))
+        return NSFontWeightUltraLight;
+    if (fontWeight < FontSelectionValue(250))
+        return NSFontWeightThin;
+    if (fontWeight < FontSelectionValue(350))
+        return NSFontWeightLight;
+    if (fontWeight < FontSelectionValue(450))
+        return NSFontWeightRegular;
+    if (fontWeight < FontSelectionValue(550))
+        return NSFontWeightMedium;
+    if (fontWeight < FontSelectionValue(650))
+        return NSFontWeightSemibold;
+    if (fontWeight < FontSelectionValue(750))
+        return NSFontWeightBold;
+    if (fontWeight < FontSelectionValue(850))
+        return NSFontWeightHeavy;
+    return NSFontWeightBlack;
+}
+
+RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomicString& family, FontSelectionRequest request, float size)
+{
+    if (equalLettersIgnoringASCIICase(family, "-webkit-system-font") || equalLettersIgnoringASCIICase(family, "-apple-system") || equalLettersIgnoringASCIICase(family, "-apple-system-font") || equalLettersIgnoringASCIICase(family, "system-ui")) {
+        RetainPtr<CTFontRef> result = toCTFont([NSFont systemFontOfSize:size weight:toNSFontWeight(request.weight)]);
+        if (isItalic(request.slope)) {
+            CTFontSymbolicTraits desiredTraits = kCTFontItalicTrait;
+            if (isFontWeightBold(request.weight))
+                desiredTraits |= kCTFontBoldTrait;
+            if (auto italicizedFont = adoptCF(CTFontCreateCopyWithSymbolicTraits(result.get(), size, nullptr, desiredTraits, desiredTraits)))
+                result = italicizedFont;
+        }
+        return result;
+    }
+
     if (equalLettersIgnoringASCIICase(family, "-apple-system-monospaced-numbers")) {
         int numberSpacingType = kNumberSpacingType;
         int monospacedNumbersSelector = kMonospacedNumbersSelector;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to