Diff
Modified: trunk/LayoutTests/ChangeLog (284623 => 284624)
--- trunk/LayoutTests/ChangeLog 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/ChangeLog 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1,3 +1,30 @@
+2021-10-21 Devin Rousso <[email protected]>
+
+ REGRESSION(r283864): Apple Pay named images are missing
+ https://bugs.webkit.org/show_bug.cgi?id=232050
+ <rdar://problem/84413831>
+
+ Reviewed by Andy Estes.
+
+ * fast/css/webkit-named-image/apple-pay-logo-black/offset.html: Added.
+ * fast/css/webkit-named-image/apple-pay-logo-black/offset-expected-mismatch.html: Added.
+ * fast/css/webkit-named-image/apple-pay-logo-white/offset.html: Added.
+ * fast/css/webkit-named-image/apple-pay-logo-white/offset-expected-mismatch.html: Added.
+
+ * fast/css/webkit-named-image/apple-pay-logo-white/background-size-centered.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/background-size-centered-expected-mismatch.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/background-size.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/background-size-expected-mismatch.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/basic.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/basic-expected-mismatch.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/container-larger-height.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/container-larger-height-expected-mismatch.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/container-larger-width.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/container-larger-width-expected-mismatch.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/mask.html:
+ * fast/css/webkit-named-image/apple-pay-logo-white/mask-expected-mismatch.html:
+ Drive-by: fix these to also have `background-color: black;` in the `-expected-mismatch.html`.
+
2021-10-21 Kate Cheney <[email protected]>
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html is a constant timeout
Copied: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-black/offset-expected-mismatch.html (from rev 284623, trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-centered-expected-mismatch.html) (0 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-black/offset-expected-mismatch.html (rev 0)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-black/offset-expected-mismatch.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -0,0 +1 @@
+<div></div>
Copied: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-black/offset.html (from rev 284623, trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/basic.html) (0 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-black/offset.html (rev 0)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-black/offset.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -0,0 +1,12 @@
+<style>
+div {
+ width: 100px;
+ height: 100px;
+ margin-top: 200px;
+ margin-left: 200px;
+ background-image: -webkit-named-image(apple-pay-logo-black);
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
+}
+</style>
+<div></div>
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-centered-expected-mismatch.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-centered-expected-mismatch.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-centered-expected-mismatch.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1 +1,5 @@
-<div></div>
+<style>
+body {
+ background-color: black;
+}
+</style>
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-centered.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-centered.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-centered.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1,8 +1,10 @@
<style>
+body {
+ background-color: black;
+}
div {
width: 100px;
height: 100px;
- background-color: black;
background-image: -webkit-named-image(apple-pay-logo-white);
background-size: 50px 50px;
background-position: 50% 50%;
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-expected-mismatch.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-expected-mismatch.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size-expected-mismatch.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1 +1,5 @@
-<div></div>
+<style>
+body {
+ background-color: black;
+}
+</style>
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/background-size.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1,8 +1,10 @@
<style>
+body {
+ background-color: black;
+}
div {
width: 100px;
height: 100px;
- background-color: black;
background-image: -webkit-named-image(apple-pay-logo-white);
background-size: 50px 50px;
background-repeat: no-repeat;
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/basic-expected-mismatch.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/basic-expected-mismatch.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/basic-expected-mismatch.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1 +1,5 @@
-<div></div>
+<style>
+body {
+ background-color: black;
+}
+</style>
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/basic.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/basic.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/basic.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1,8 +1,10 @@
<style>
+body {
+ background-color: black;
+}
div {
width: 100px;
height: 100px;
- background-color: black;
background-image: -webkit-named-image(apple-pay-logo-white);
background-size: 100% 100%;
background-repeat: no-repeat;
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-height-expected-mismatch.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-height-expected-mismatch.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-height-expected-mismatch.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1 +1,5 @@
-<div></div>
+<style>
+body {
+ background-color: black;
+}
+</style>
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-height.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-height.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-height.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1,8 +1,10 @@
<style>
+body {
+ background-color: black;
+}
div {
width: 100px;
height: 150px;
- background-color: black;
background-image: -webkit-named-image(apple-pay-logo-white);
background-size: 100% 100%;
background-repeat: no-repeat;
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-width-expected-mismatch.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-width-expected-mismatch.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-width-expected-mismatch.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1 +1,5 @@
-<div></div>
+<style>
+body {
+ background-color: black;
+}
+</style>
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-width.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-width.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/container-larger-width.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1,8 +1,10 @@
<style>
+body {
+ background-color: black;
+}
div {
width: 150px;
height: 100px;
- background-color: black;
background-image: -webkit-named-image(apple-pay-logo-white);
background-size: 100% 100%;
background-repeat: no-repeat;
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/mask-expected-mismatch.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/mask-expected-mismatch.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/mask-expected-mismatch.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1 +1,5 @@
-<div></div>
+<style>
+body {
+ background-color: black;
+}
+</style>
Modified: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/mask.html (284623 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/mask.html 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/mask.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1,4 +1,7 @@
<style>
+body {
+ background-color: black;
+}
div {
width: 100px;
height: 100px;
Added: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/offset-expected-mismatch.html (0 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/offset-expected-mismatch.html (rev 0)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/offset-expected-mismatch.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -0,0 +1,5 @@
+<style>
+body {
+ background-color: black;
+}
+</style>
Copied: trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/offset.html (from rev 284623, trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/basic.html) (0 => 284624)
--- trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/offset.html (rev 0)
+++ trunk/LayoutTests/fast/css/webkit-named-image/apple-pay-logo-white/offset.html 2021-10-21 17:55:14 UTC (rev 284624)
@@ -0,0 +1,15 @@
+<style>
+body {
+ background-color: black;
+}
+div {
+ width: 100px;
+ height: 100px;
+ margin-top: 200px;
+ margin-left: 200px;
+ background-image: -webkit-named-image(apple-pay-logo-white);
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
+}
+</style>
+<div></div>
Modified: trunk/Source/WebCore/ChangeLog (284623 => 284624)
--- trunk/Source/WebCore/ChangeLog 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/Source/WebCore/ChangeLog 2021-10-21 17:55:14 UTC (rev 284624)
@@ -1,3 +1,29 @@
+2021-10-21 Devin Rousso <[email protected]>
+
+ REGRESSION(r283864): Apple Pay named images are missing
+ https://bugs.webkit.org/show_bug.cgi?id=232050
+ <rdar://problem/84413831>
+
+ Reviewed by Andy Estes.
+
+ `NamedImageGeneratedImage` already does a translate before calling into `drawNamedImage`, so
+ there's no reason to pass along the location of the named image. Instead, just pass the size.
+
+ Tests: fast/css/webkit-named-image/apple-pay-logo-black/offset.html
+ fast/css/webkit-named-image/apple-pay-logo-white/offset.html
+
+ * platform/Theme.h:
+ * platform/Theme.cpp:
+ (WebCore::Theme::drawNamedImage const):
+ * platform/cocoa/ThemeCocoa.h:
+ * platform/cocoa/ThemeCocoa.mm:
+ (WebCore::drawApplePayButton):
+ (WebCore::ThemeCocoa::drawNamedImage const):
+
+ * platform/graphics/NamedImageGeneratedImage.cpp:
+ (WebCore::NamedImageGeneratedImage::draw):
+ (WebCore::NamedImageGeneratedImage::drawPattern):
+
2021-10-21 Tyler Wilcock <[email protected]>
AX: Remove redundant insert of autofill button child in AccessibilityRenderObject::addTextFieldChildren
Modified: trunk/Source/WebCore/platform/Theme.cpp (284623 => 284624)
--- trunk/Source/WebCore/platform/Theme.cpp 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/Source/WebCore/platform/Theme.cpp 2021-10-21 17:55:14 UTC (rev 284624)
@@ -116,7 +116,7 @@
}
}
-void Theme::drawNamedImage(const String& name, GraphicsContext& context, const FloatRect& rect) const
+void Theme::drawNamedImage(const String& name, GraphicsContext& context, const FloatSize& size) const
{
// We only handle one icon at the moment.
if (name != "wireless-playback")
@@ -127,7 +127,7 @@
// Draw a generic Wireless Playback icon.
- context.scale(rect.size() / 100);
+ context.scale(size / 100);
context.translate(8, 1);
Path outline;
Modified: trunk/Source/WebCore/platform/Theme.h (284623 => 284624)
--- trunk/Source/WebCore/platform/Theme.h 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/Source/WebCore/platform/Theme.h 2021-10-21 17:55:14 UTC (rev 284624)
@@ -34,6 +34,7 @@
class Color;
class ControlStates;
class FloatRect;
+class FloatSize;
class FontCascade;
class FontCascadeDescription;
class GraphicsContext;
@@ -78,7 +79,7 @@
// amount is also scaled by the zoomFactor.
virtual void inflateControlPaintRect(ControlPart, const ControlStates&, FloatRect& zoomedRect, float zoomFactor) const;
- virtual void drawNamedImage(const String&, GraphicsContext&, const FloatRect&) const;
+ virtual void drawNamedImage(const String&, GraphicsContext&, const FloatSize&) const;
virtual bool userPrefersContrast() const;
virtual bool userPrefersReducedMotion() const;
Modified: trunk/Source/WebCore/platform/cocoa/ThemeCocoa.h (284623 => 284624)
--- trunk/Source/WebCore/platform/cocoa/ThemeCocoa.h 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/Source/WebCore/platform/cocoa/ThemeCocoa.h 2021-10-21 17:55:14 UTC (rev 284624)
@@ -33,7 +33,7 @@
protected:
ThemeCocoa() = default;
private:
- void drawNamedImage(const String&, GraphicsContext&, const FloatRect&) const final;
+ void drawNamedImage(const String&, GraphicsContext&, const FloatSize&) const final;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/cocoa/ThemeCocoa.mm (284623 => 284624)
--- trunk/Source/WebCore/platform/cocoa/ThemeCocoa.mm 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/Source/WebCore/platform/cocoa/ThemeCocoa.mm 2021-10-21 17:55:14 UTC (rev 284624)
@@ -108,9 +108,9 @@
return logoPage;
};
-static void drawApplePayButton(GraphicsContext& context, CGPDFPageRef page, const FloatRect& rect)
+static void drawApplePayButton(GraphicsContext& context, CGPDFPageRef page, const FloatSize& size)
{
- auto imageBuffer = ImageBuffer::createCompatibleBuffer(rect.size(), context);
+ auto imageBuffer = ImageBuffer::createCompatibleBuffer(size, context);
if (!imageBuffer)
return;
@@ -117,17 +117,17 @@
CGSize pdfSize = CGPDFPageGetBoxRect(page, kCGPDFMediaBox).size;
auto& imageContext = imageBuffer->context();
- fitContextToBox(imageContext, FloatSize(pdfSize), rect.size());
+ fitContextToBox(imageContext, FloatSize(pdfSize), size);
imageContext.translate(0, pdfSize.height);
imageContext.scale(FloatSize(1, -1));
CGContextDrawPDFPage(imageContext.platformContext(), page);
- context.drawConsumingImageBuffer(WTFMove(imageBuffer), rect);
+ context.drawConsumingImageBuffer(WTFMove(imageBuffer), FloatRect(FloatPoint::zero(), size));
};
#endif
-void ThemeCocoa::drawNamedImage(const String& name, GraphicsContext& context, const FloatRect& rect) const
+void ThemeCocoa::drawNamedImage(const String& name, GraphicsContext& context, const FloatSize& size) const
{
if (name == "wireless-playback") {
GraphicsContextStateSaver stateSaver(context);
@@ -134,7 +134,7 @@
context.setFillColor(Color::black);
FloatSize wirelessPlaybackSrcSize(32, 24.016);
- fitContextToBox(context, wirelessPlaybackSrcSize, rect.size());
+ fitContextToBox(context, wirelessPlaybackSrcSize, size);
Path outline;
outline.moveTo(FloatPoint(24.066, 18));
@@ -164,7 +164,7 @@
#if ENABLE(APPLE_PAY)
if (name == "apple-pay-logo-black") {
if (auto logo = applePayButtonLogoBlack()) {
- drawApplePayButton(context, logo, rect);
+ drawApplePayButton(context, logo, size);
return;
}
}
@@ -171,13 +171,13 @@
if (name == "apple-pay-logo-white") {
if (auto logo = applePayButtonLogoWhite()) {
- drawApplePayButton(context, logo, rect);
+ drawApplePayButton(context, logo, size);
return;
}
}
#endif
- Theme::drawNamedImage(name, context, rect);
+ Theme::drawNamedImage(name, context, size);
}
}
Modified: trunk/Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp (284623 => 284624)
--- trunk/Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp 2021-10-21 17:54:48 UTC (rev 284623)
+++ trunk/Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp 2021-10-21 17:55:14 UTC (rev 284624)
@@ -51,7 +51,7 @@
context.scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
context.translate(-srcRect.location());
- Theme::singleton().drawNamedImage(m_name, context, dstRect);
+ Theme::singleton().drawNamedImage(m_name, context, dstRect.size());
return ImageDrawResult::DidDraw;
#else
UNUSED_PARAM(context);
@@ -70,7 +70,7 @@
return;
GraphicsContext& graphicsContext = imageBuffer->context();
- Theme::singleton().drawNamedImage(m_name, graphicsContext, FloatRect(0, 0, size().width(), size().height()));
+ Theme::singleton().drawNamedImage(m_name, graphicsContext, size());
// Tile the image buffer into the context.
imageBuffer->drawPattern(context, dstRect, srcRect, patternTransform, phase, spacing, options);