Title: [262574] trunk/Source
Revision
262574
Author
wenson_hs...@apple.com
Date
2020-06-04 15:10:18 -0700 (Thu, 04 Jun 2020)

Log Message

[macOS] Add a way to override the contact AutoFill button image
https://bugs.webkit.org/show_bug.cgi?id=212775
<rdar://problem/60381452>

Reviewed by Tim Horton.

Source/WebCore:

Rename `SYSTEM_ATTACHMENT_PLACEHOLDER_ICON` to `ALTERNATE_ICONS`, and use it to additionally guard an alternate
appearance for the contact AutoFill button icon.

* css/html.css:
(input::-webkit-contacts-auto-fill-button):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::extraDefaultStyleSheet):

Source/WTF:

Rename `SYSTEM_ATTACHMENT_PLACEHOLDER_ICON` to `ALTERNATE_ICONS`.

* wtf/PlatformHave.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (262573 => 262574)


--- trunk/Source/WTF/ChangeLog	2020-06-04 21:54:46 UTC (rev 262573)
+++ trunk/Source/WTF/ChangeLog	2020-06-04 22:10:18 UTC (rev 262574)
@@ -1,3 +1,15 @@
+2020-06-04  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        [macOS] Add a way to override the contact AutoFill button image
+        https://bugs.webkit.org/show_bug.cgi?id=212775
+        <rdar://problem/60381452>
+
+        Reviewed by Tim Horton.
+
+        Rename `SYSTEM_ATTACHMENT_PLACEHOLDER_ICON` to `ALTERNATE_ICONS`.
+
+        * wtf/PlatformHave.h:
+
 2020-06-04  Jacob Uphoff  <jacob_uph...@apple.com>
 
         Unreviewed, reverting r262546.

Modified: trunk/Source/WTF/wtf/PlatformHave.h (262573 => 262574)


--- trunk/Source/WTF/wtf/PlatformHave.h	2020-06-04 21:54:46 UTC (rev 262573)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2020-06-04 22:10:18 UTC (rev 262574)
@@ -572,7 +572,7 @@
 #endif
 
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600)
-#define HAVE_SYSTEM_ATTACHMENT_PLACEHOLDER_ICON 1
+#define HAVE_ALTERNATE_ICONS 1
 #endif
 
 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)

Modified: trunk/Source/WebCore/ChangeLog (262573 => 262574)


--- trunk/Source/WebCore/ChangeLog	2020-06-04 21:54:46 UTC (rev 262573)
+++ trunk/Source/WebCore/ChangeLog	2020-06-04 22:10:18 UTC (rev 262574)
@@ -1,3 +1,20 @@
+2020-06-04  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        [macOS] Add a way to override the contact AutoFill button image
+        https://bugs.webkit.org/show_bug.cgi?id=212775
+        <rdar://problem/60381452>
+
+        Reviewed by Tim Horton.
+
+        Rename `SYSTEM_ATTACHMENT_PLACEHOLDER_ICON` to `ALTERNATE_ICONS`, and use it to additionally guard an alternate
+        appearance for the contact AutoFill button icon.
+
+        * css/html.css:
+        (input::-webkit-contacts-auto-fill-button):
+        * rendering/RenderThemeMac.h:
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::extraDefaultStyleSheet):
+
 2020-06-04  Tetsuharu Ohzeki  <tetsuharu.ohz...@gmail.com>
 
         Rename BlobLineEndings to EndingType to match the latest spec

Modified: trunk/Source/WebCore/css/html.css (262573 => 262574)


--- trunk/Source/WebCore/css/html.css	2020-06-04 21:54:46 UTC (rev 262573)
+++ trunk/Source/WebCore/css/html.css	2020-06-04 22:10:18 UTC (rev 262574)
@@ -597,7 +597,9 @@
 }
 
 input::-webkit-contacts-auto-fill-button {
+#if !(defined(HAVE_ALTERNATE_ICONS) && HAVE_ALTERNATE_ICONS)
     -webkit-mask-image: url('data:image/svg+xml,<svg viewBox="0 0 44 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M 30.25 9.25 L 36.5 15.75 L 42.75 9.25" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="12" r="11" fill="none" stroke="black" stroke-width="2"/><path d="M 12 11.5 C 10.3 11.5 9 10.1 9 8.2 C 9 6.5 10.3 5 12 5 C 13.6 5 15 6.5 15 8.2 C 15 10.1 13.6 11.5 12 11.5 Z M 6.6 18 C 6.2 18 6 17.7 6 17.4 C 6 16.2 7.9 13 12 13 C 16.1 13 18 16.2 18 17.4 C 18 17.7 17.8 18 17.4 18 L 6.6 18 Z"/></svg>');
+#endif
     -webkit-mask-size: 22px 12px;
     width: 22px;
     height: 12px;

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (262573 => 262574)


--- trunk/Source/WebCore/rendering/RenderThemeMac.h	2020-06-04 21:54:46 UTC (rev 262573)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h	2020-06-04 22:10:18 UTC (rev 262574)
@@ -104,6 +104,8 @@
     // System fonts.
     void updateCachedSystemFontDescription(CSSValueID, FontCascadeDescription&) const final;
 
+    String extraDefaultStyleSheet() final;
+
 #if ENABLE(VIDEO)
     // Media controls
     String mediaControlsStyleSheet() final;

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (262573 => 262574)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2020-06-04 21:54:46 UTC (rev 262573)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2020-06-04 22:10:18 UTC (rev 262574)
@@ -2785,7 +2785,7 @@
     icon->paint(context, layout.iconRect);
 }
 
-#if HAVE(SYSTEM_ATTACHMENT_PLACEHOLDER_ICON) && USE(APPLE_INTERNAL_SDK)
+#if HAVE(ALTERNATE_ICONS) && USE(APPLE_INTERNAL_SDK)
 #import <WebKitAdditions/RenderThemeMacAdditions.mm>
 #else
 
@@ -2797,6 +2797,11 @@
     return { Image::loadPlatformResource("AttachmentPlaceholder"), 1 };
 }
 
+String RenderThemeMac::extraDefaultStyleSheet()
+{
+    return { };
+}
+
 #endif
 
 static void paintAttachmentIconPlaceholder(const RenderAttachment& attachment, GraphicsContext& context, AttachmentLayout& layout)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to