Title: [293820] trunk
Revision
293820
Author
drou...@apple.com
Date
2022-05-04 21:56:56 -0700 (Wed, 04 May 2022)

Log Message

[Apple Pay] REGRESSION(r291588): `appearance: -apple-pay-button` doesn't work with `border-width: 0`
https://bugs.webkit.org/show_bug.cgi?id=240087
<rdar://problem/92559095>

Reviewed by Kate Cheney.

Source/WebCore:

As of r291588, all `appearance` values now correspond to a specific element (or form control)
with the exception of `-apple-pay-button`, which can be applied to any element. Add logic to
specifically allow for this behavior.

Test: fast/css/appearance-apple-pay-button-border-width.html

* rendering/RenderTheme.cpp:
(WebCore::isAppearanceAllowedForAllElements): Added.
(WebCore::RenderTheme::adjustStyle):

LayoutTests:

* fast/css/appearance-apple-pay-button-border-width.html: Added.
* fast/css/appearance-apple-pay-button-border-width-expected-mismatch.html: Added.

* TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (293819 => 293820)


--- trunk/LayoutTests/ChangeLog	2022-05-05 04:45:27 UTC (rev 293819)
+++ trunk/LayoutTests/ChangeLog	2022-05-05 04:56:56 UTC (rev 293820)
@@ -1,3 +1,18 @@
+2022-05-04  Devin Rousso  <drou...@apple.com>
+
+        [Apple Pay] REGRESSION(r291588): `appearance: -apple-pay-button` doesn't work with `border-width: 0`
+        https://bugs.webkit.org/show_bug.cgi?id=240087
+        <rdar://problem/92559095>
+
+        Reviewed by Kate Cheney.
+
+        * fast/css/appearance-apple-pay-button-border-width.html: Added.
+        * fast/css/appearance-apple-pay-button-border-width-expected-mismatch.html: Added.
+
+        * TestExpectations:
+        * platform/ios/TestExpectations:
+        * platform/mac/TestExpectations:
+
 2022-05-04  Alex Christensen  <achristen...@webkit.org>
 
         Crash in WindowProxy::setDOMWindow

Modified: trunk/LayoutTests/TestExpectations (293819 => 293820)


--- trunk/LayoutTests/TestExpectations	2022-05-05 04:45:27 UTC (rev 293819)
+++ trunk/LayoutTests/TestExpectations	2022-05-05 04:56:56 UTC (rev 293820)
@@ -280,6 +280,7 @@
 fast/css/appearance-apple-pay-button.html [ Skip ]
 fast/css/appearance-apple-pay-button-border-radius.html [ Skip ]
 fast/css/appearance-apple-pay-button-border-radius-longhands.html [ Skip ]
+fast/css/appearance-apple-pay-button-border-width.html [ Skip ]
 fast/css/appearance-apple-pay-button-default-corners.html [ Skip ]
 fast/css/getComputedStyle/computed-style-apple-pay-button.html [ Skip ]
 fast/css/webkit-named-image/apple-pay-logo-black [ Skip ]

Added: trunk/LayoutTests/fast/css/appearance-apple-pay-button-border-width-expected-mismatch.html (0 => 293820)


--- trunk/LayoutTests/fast/css/appearance-apple-pay-button-border-width-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/appearance-apple-pay-button-border-width-expected-mismatch.html	2022-05-05 04:56:56 UTC (rev 293820)
@@ -0,0 +1 @@
+<div></div>

Added: trunk/LayoutTests/fast/css/appearance-apple-pay-button-border-width.html (0 => 293820)


--- trunk/LayoutTests/fast/css/appearance-apple-pay-button-border-width.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/appearance-apple-pay-button-border-width.html	2022-05-05 04:56:56 UTC (rev 293820)
@@ -0,0 +1,9 @@
+<style>
+div {
+    width: 100px;
+    height: 50px;
+    appearance: -apple-pay-button;
+    border-width: 0;
+}
+</style>
+<div></div>

Modified: trunk/LayoutTests/platform/ios/TestExpectations (293819 => 293820)


--- trunk/LayoutTests/platform/ios/TestExpectations	2022-05-05 04:45:27 UTC (rev 293819)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2022-05-05 04:56:56 UTC (rev 293820)
@@ -39,6 +39,7 @@
 fast/css/appearance-apple-pay-button.html [ Pass ]
 fast/css/appearance-apple-pay-button-border-radius.html [ Pass ]
 fast/css/appearance-apple-pay-button-border-radius-longhands.html [ Pass ]
+fast/css/appearance-apple-pay-button-border-width.html [ Pass ]
 fast/css/appearance-apple-pay-button-default-corners.html [ Pass ]
 fast/css/webkit-named-image/apple-pay-logo-black [ Pass ]
 fast/css/webkit-named-image/apple-pay-logo-white [ Pass ]

Modified: trunk/LayoutTests/platform/mac/TestExpectations (293819 => 293820)


--- trunk/LayoutTests/platform/mac/TestExpectations	2022-05-05 04:45:27 UTC (rev 293819)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-05-05 04:56:56 UTC (rev 293820)
@@ -1042,6 +1042,7 @@
 fast/css/appearance-apple-pay-button.html [ Pass ]
 fast/css/appearance-apple-pay-button-border-radius.html [ Pass ]
 fast/css/appearance-apple-pay-button-border-radius-longhands.html [ Pass ]
+fast/css/appearance-apple-pay-button-border-width.html [ Pass ]
 fast/css/appearance-apple-pay-button-default-corners.html [ Pass ]
 fast/css/webkit-named-image/apple-pay-logo-black [ Pass ]
 fast/css/webkit-named-image/apple-pay-logo-white [ Pass ]

Modified: trunk/Source/WebCore/ChangeLog (293819 => 293820)


--- trunk/Source/WebCore/ChangeLog	2022-05-05 04:45:27 UTC (rev 293819)
+++ trunk/Source/WebCore/ChangeLog	2022-05-05 04:56:56 UTC (rev 293820)
@@ -1,3 +1,21 @@
+2022-05-04  Devin Rousso  <drou...@apple.com>
+
+        [Apple Pay] REGRESSION(r291588): `appearance: -apple-pay-button` doesn't work with `border-width: 0`
+        https://bugs.webkit.org/show_bug.cgi?id=240087
+        <rdar://problem/92559095>
+
+        Reviewed by Kate Cheney.
+
+        As of r291588, all `appearance` values now correspond to a specific element (or form control)
+        with the exception of `-apple-pay-button`, which can be applied to any element. Add logic to
+        specifically allow for this behavior.
+
+        Test: fast/css/appearance-apple-pay-button-border-width.html
+
+        * rendering/RenderTheme.cpp:
+        (WebCore::isAppearanceAllowedForAllElements): Added.
+        (WebCore::RenderTheme::adjustStyle):
+
 2022-05-04  Alex Christensen  <achristen...@webkit.org>
 
         Crash in WindowProxy::setDOMWindow

Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (293819 => 293820)


--- trunk/Source/WebCore/rendering/RenderTheme.cpp	2022-05-05 04:45:27 UTC (rev 293819)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp	2022-05-05 04:56:56 UTC (rev 293820)
@@ -120,6 +120,17 @@
     return part;
 }
 
+static bool isAppearanceAllowedForAllElements(ControlPart part)
+{
+#if ENABLE(APPLE_PAY)
+    if (part == ApplePayButtonPart)
+        return true;
+#endif
+
+    UNUSED_PARAM(part);
+    return false;
+}
+
 void RenderTheme::adjustStyle(RenderStyle& style, const Element* element, const RenderStyle* userAgentAppearanceStyle)
 {
     ControlPart autoAppearance = autoAppearanceForElement(element);
@@ -150,7 +161,8 @@
         style.setEffectiveAppearance(part);
     }
 
-    if (!userAgentAppearanceStyle
+    if (!isAppearanceAllowedForAllElements(part)
+        && !userAgentAppearanceStyle
         && autoAppearance == NoControlPart
         && !style.borderAndBackgroundEqual(RenderStyle::defaultStyle()))
         style.setEffectiveAppearance(NoControlPart);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to