[iOS] Password fields obscure the text with rectangles instead of circles
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2018 17:31:46 +0000 (17:31 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2018 17:31:46 +0000 (17:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185760
<rdar://problem/38644697>

Reviewed by Zalan Bujtas.

Source/WebCore:

Password fields are obscured by drawing U+25CF BLACK CIRCLE. On iOS, we have custom handling
for this character. However, this custom handling is unnecessary and isn't present on macOS.
Instead, we should simply unify the password obscuring codepath between iOS and macOS.

Test: fast/text/black-circle.html

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::requiresCustomFallbackFont):
(WebCore::FontCache::getCustomFallbackFont):

LayoutTests:

* fast/text/black-circle-expected.html: Added.
* fast/text/black-circle.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/text/black-circle-expected.html [new file with mode: 0644]
LayoutTests/fast/text/black-circle.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ios/FontCacheIOS.mm

index 2bb8eb8..948508b 100644 (file)
@@ -1,3 +1,14 @@
+2018-05-18  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [iOS] Password fields obscure the text with rectangles instead of circles
+        https://bugs.webkit.org/show_bug.cgi?id=185760
+        <rdar://problem/38644697>
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/text/black-circle-expected.html: Added.
+        * fast/text/black-circle.html: Added.
+
 2018-05-18  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r231935.
diff --git a/LayoutTests/fast/text/black-circle-expected.html b/LayoutTests/fast/text/black-circle-expected.html
new file mode 100644 (file)
index 0000000..4e26525
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+This test makes sure that U+25CF BLACK CIRCLE is rendered as an actual dot. The test passes if you see a black square below.
+<div style="position: relative; width: 50px; height: 50px; overflow: hidden; background-color: black;">
+</div>
+</body>
+</html>
diff --git a/LayoutTests/fast/text/black-circle.html b/LayoutTests/fast/text/black-circle.html
new file mode 100644 (file)
index 0000000..8afcd11
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+This test makes sure that U+25CF BLACK CIRCLE is rendered as an actual dot. The test passes if you see a black square below.
+<div style="position: relative; width: 50px; height: 50px; overflow: hidden;">
+<div style="font-family: 'Courier'; transform-origin: left top; transform: scale(20); position: absolute; left: -60px; top: -150px;">&#x25CF;</div>
+</div>
+</body>
+</html>
index 57b817a..b670bef 100644 (file)
@@ -1,3 +1,21 @@
+2018-05-18  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [iOS] Password fields obscure the text with rectangles instead of circles
+        https://bugs.webkit.org/show_bug.cgi?id=185760
+        <rdar://problem/38644697>
+
+        Reviewed by Zalan Bujtas.
+
+        Password fields are obscured by drawing U+25CF BLACK CIRCLE. On iOS, we have custom handling
+        for this character. However, this custom handling is unnecessary and isn't present on macOS.
+        Instead, we should simply unify the password obscuring codepath between iOS and macOS.
+
+        Test: fast/text/black-circle.html
+
+        * platform/graphics/ios/FontCacheIOS.mm:
+        (WebCore::requiresCustomFallbackFont):
+        (WebCore::FontCache::getCustomFallbackFont):
+
 2018-05-18  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r231935.
index deeb97a..9e5ed9e 100644 (file)
@@ -45,7 +45,7 @@ namespace WebCore {
 
 bool requiresCustomFallbackFont(UChar32 character)
 {
-    return character == AppleLogo || character == blackCircle || character == narrowNonBreakingSpace;
+    return character == AppleLogo || character == narrowNonBreakingSpace;
 }
 
 FontPlatformData* FontCache::getCustomFallbackFont(const UInt32 c, const FontDescription& description)
@@ -53,7 +53,6 @@ FontPlatformData* FontCache::getCustomFallbackFont(const UInt32 c, const FontDes
     ASSERT(requiresCustomFallbackFont(c));
 
     static NeverDestroyed<AtomicString> helveticaFamily("Helvetica Neue", AtomicString::ConstructFromLiteral);
-    static NeverDestroyed<AtomicString> lockClockFamily("LockClock-Light", AtomicString::ConstructFromLiteral);
     static NeverDestroyed<AtomicString> timesNewRomanPSMTFamily("TimesNewRomanPSMT", AtomicString::ConstructFromLiteral);
 
     AtomicString* family = nullptr;
@@ -61,9 +60,6 @@ FontPlatformData* FontCache::getCustomFallbackFont(const UInt32 c, const FontDes
     case AppleLogo:
         family = &helveticaFamily.get();
         break;
-    case blackCircle:
-        family = &lockClockFamily.get();
-        break;
     case narrowNonBreakingSpace:
         family = &timesNewRomanPSMTFamily.get();
         break;