WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-227519-20210706121017.patch (text/plain), 8.99 KB, created by
Myles C. Maxfield
on 2021-07-06 12:10:18 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2021-07-06 12:10:18 PDT
Size:
8.99 KB
patch
obsolete
>Subversion Revision: 279599 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a80891cb65b1e4f0333517869fb838ae74d227df..1a8b793df3ca575fad1b37f357f62a238c38b192 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2021-06-30 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ [GPU Process] Canvas image rendering can render arbitrary DOM content in the GPU process, which is against policy (for now) >+ https://bugs.webkit.org/show_bug.cgi?id=227519 >+ <rdar://problem/76678163> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Rendering arbitrary DOM content in the GPU process isn't supported yet, but canvas rendering is. However, >+ canvas has a drawImage() function which can accept an HTMLImageElement as its source, and an HTMLImageElement >+ can have an SVG document as its source, which would end up triggering our DOM codepath in canvas and thus >+ in the GPU process. >+ >+ This patch disables this for now, by rendering the SVG into an ImageBuffer and then drawing the ImageBuffer >+ in the GPU process. When we eventually implement arbitrary DOM rendering in the GPU process, this patch will >+ need to be reverted. >+ >+ Test: fast/images/svg-mask-in-canvas.html >+ >+ * svg/graphics/SVGImage.cpp: >+ (WebCore::SVGImage::draw): >+ > 2021-07-06 Alex Christensen <achristensen@webkit.org> > > loadSimulatedRequest: should do same delegate callbacks as loadHTMLString and loadData >diff --git a/Source/WebCore/svg/graphics/SVGImage.cpp b/Source/WebCore/svg/graphics/SVGImage.cpp >index e7697124d18526e81182706fea1fc8ec83e0610a..2a12ce328205eaa0fb380472c179e4cf4b783321 100644 >--- a/Source/WebCore/svg/graphics/SVGImage.cpp >+++ b/Source/WebCore/svg/graphics/SVGImage.cpp >@@ -273,6 +273,24 @@ ImageDrawResult SVGImage::draw(GraphicsContext& context, const FloatRect& dstRec > if (!m_page) > return ImageDrawResult::DidNothing; > >+ // Display list drawing can't handle arbitrary DOM content. >+ // FIXME: Remove this when it can. >+ if (!context.hasPlatformContext()) { >+ if (auto nativeImage = this->nativeImage(nullptr)) { >+ auto localImagePaintingOptions = options; >+ if (static_cast<ImageOrientation::Orientation>(options.orientation()) == ImageOrientation::Orientation::FromImage) >+ localImagePaintingOptions = ImagePaintingOptions(options, ImageOrientation::Orientation::None); >+ >+ context.drawNativeImage(*nativeImage, size(), dstRect, srcRect, localImagePaintingOptions); >+ >+ if (imageObserver()) >+ imageObserver()->didDraw(*this); >+ >+ return ImageDrawResult::DidDraw; >+ } >+ return ImageDrawResult::DidNothing; >+ } >+ > auto view = makeRefPtr(frameView()); > ASSERT(view); > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 24dc858f4a765dc4c3c4c161b48d595388e8e907..ecd554dc8044efb5201ee64c44d90828dafd7b92 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2021-06-30 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ [GPU Process] Canvas image rendering can render arbitrary DOM content in the GPU process, which is against policy (for now) >+ https://bugs.webkit.org/show_bug.cgi?id=227519 >+ <rdar://problem/76678163> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/images/resources/mask.svg: Added. >+ * fast/images/svg-mask-in-canvas-expected.html: Added. >+ * fast/images/svg-mask-in-canvas.html: Added. >+ * imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/createImageBitmap-flipY-expected.txt: Updated. >+ > 2021-07-06 Eric Hutchison <ehutchison@apple.com> > > [BigSur E Wk2 Release] imported/w3c/web-platform-tests/webrtc/RTCRtpSender-encode-same-track-twice.https.html in flaky failure >diff --git a/LayoutTests/fast/images/resources/mask.svg b/LayoutTests/fast/images/resources/mask.svg >new file mode 100644 >index 0000000000000000000000000000000000000000..c4d4bc4bf2a9573ad3e9907ac4f7c6b8994b24aa >--- /dev/null >+++ b/LayoutTests/fast/images/resources/mask.svg >@@ -0,0 +1,9 @@ >+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> >+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300px" height="300px" viewBox="0 0 300 300" version="1.1"> >+ <defs> >+ <mask id="mask" maskUnits="userSpaceOnUse" x="0" y="0" width="300" height="300"> >+ <rect x="50" y="50" width="200" height="200" fill="white"/> >+ </mask> >+ </defs> >+ <rect x="100" y="0" width="100" height="300" fill="black" mask="url(#mask)"/> >+</svg> >diff --git a/LayoutTests/fast/images/svg-mask-in-canvas-expected.html b/LayoutTests/fast/images/svg-mask-in-canvas-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0b09ce1e0c4bb2f03d51feafb0bd81aa602a784d >--- /dev/null >+++ b/LayoutTests/fast/images/svg-mask-in-canvas-expected.html >@@ -0,0 +1,15 @@ >+<!DOCTYPE html> >+<html> >+<head> >+</head> >+<body> >+<p>This test passes if you see a black rectangle with a green border below.</p> >+<div style="position: relative;"> >+ <div style="position: absolute; left: 100px; top: 50px; width: 100px; height: 200px; background: black;"></div> >+ <div style="position: absolute; top: 47px; left: 97px; width: 6px; height: 206px; background: green;"></div> >+ <div style="position: absolute; top: 47px; left: 197px; width: 6px; height: 206px; background: green;"></div> >+ <div style="position: absolute; top: 47px; left: 97px; width: 106px; height: 6px; background: green;"></div> >+ <div style="position: absolute; top: 247px; left: 97px; width: 106px; height: 6px; background: green;"></div> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/fast/images/svg-mask-in-canvas.html b/LayoutTests/fast/images/svg-mask-in-canvas.html >new file mode 100644 >index 0000000000000000000000000000000000000000..06fde591457d9921b4b75b1a3b9dfb42f91ad467 >--- /dev/null >+++ b/LayoutTests/fast/images/svg-mask-in-canvas.html >@@ -0,0 +1,28 @@ >+<!DOCTYPE html> >+<html> >+<head> >+</head> >+<body> >+<p>This test passes if you see a black rectangle with a green border below.</p> >+<div style="position: relative;"> >+ <canvas id="canvas" width="300" height="300"></canvas> >+ <div style="position: absolute; top: 47px; left: 97px; width: 6px; height: 206px; background: green;"></div> >+ <div style="position: absolute; top: 47px; left: 197px; width: 6px; height: 206px; background: green;"></div> >+ <div style="position: absolute; top: 47px; left: 97px; width: 106px; height: 6px; background: green;"></div> >+ <div style="position: absolute; top: 247px; left: 97px; width: 106px; height: 6px; background: green;"></div> >+</div> >+<script> >+if (window.testRunner) >+ testRunner.waitUntilDone(); >+let canvas = document.getElementById("canvas"); >+let context = canvas.getContext("2d"); >+let image = document.createElement("img"); >+image.addEventListener("load", function() { >+ context.drawImage(image, 0, 0, 300, 300); >+ if (window.testRunner) >+ testRunner.notifyDone(); >+}); >+image.src = "resources/mask.svg"; >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/createImageBitmap-flipY-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/createImageBitmap-flipY-expected.txt >index 6294ee1a0e707b44d7156dad73c50d5746d01bf2..80f079cbb7904b0fffef22f7c8258eacb54f5163 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/createImageBitmap-flipY-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/createImageBitmap-flipY-expected.txt >@@ -8,7 +8,7 @@ PASS createImageBitmap from an HTMLVideoElement from a data URL imageOrientation > PASS createImageBitmap from a bitmap HTMLImageElement imageOrientation: "none", and drawImage on the created ImageBitmap > PASS createImageBitmap from a bitmap HTMLImageElement imageOrientation: "flipY", and drawImage on the created ImageBitmap > PASS createImageBitmap from a vector HTMLImageElement imageOrientation: "none", and drawImage on the created ImageBitmap >-FAIL createImageBitmap from a vector HTMLImageElement imageOrientation: "flipY", and drawImage on the created ImageBitmap assert_approx_equals: Red channel of the pixel at (5, 15) expected 255 +/- 10 but got 0 >+PASS createImageBitmap from a vector HTMLImageElement imageOrientation: "flipY", and drawImage on the created ImageBitmap > FAIL createImageBitmap from a bitmap SVGImageElement imageOrientation: "none", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error" > FAIL createImageBitmap from a bitmap SVGImageElement imageOrientation: "flipY", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error" > FAIL createImageBitmap from a vector SVGImageElement imageOrientation: "none", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
darin
:
review+
ews-feeder
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 227519
:
432568
|
432622
| 432957 |
433072
|
433075
|
433121