From 596f22103c01e14063ebb2388c4dabf4714d37c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 6 Dec 2024 17:09:49 +0100 Subject: [PATCH] fix(editor): Fix svg background pattern rendering on safari (#12079) --- .../editor-ui/src/components/canvas/Canvas.test.ts | 11 ++++++++--- packages/editor-ui/src/components/canvas/Canvas.vue | 9 +++++++-- .../elements/CanvasBackgroundStripedPattern.vue | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/editor-ui/src/components/canvas/Canvas.test.ts b/packages/editor-ui/src/components/canvas/Canvas.test.ts index afeb69479c0cd..bf7dae71a7cd1 100644 --- a/packages/editor-ui/src/components/canvas/Canvas.test.ts +++ b/packages/editor-ui/src/components/canvas/Canvas.test.ts @@ -200,13 +200,18 @@ describe('Canvas', () => { describe('background', () => { it('should render default background', () => { const { container } = renderComponent(); - expect(container.querySelector('#pattern-canvas')).toBeInTheDocument(); + const patternCanvas = container.querySelector('#pattern-canvas'); + expect(patternCanvas).toBeInTheDocument(); + expect(patternCanvas?.innerHTML).toContain(' { const { container } = renderComponent({ props: { readOnly: true } }); - expect(container.querySelector('#pattern-canvas')).not.toBeInTheDocument(); - expect(container.querySelector('#diagonalHatch')).toBeInTheDocument(); + const patternCanvas = container.querySelector('#pattern-canvas'); + expect(patternCanvas).toBeInTheDocument(); + expect(patternCanvas?.innerHTML).toContain(' -