File tree 2 files changed +18
-2
lines changed
main/native/Source/WebCore/platform/graphics
test/java/test/javafx/scene/web
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,26 @@ ImageFrame::ImageFrame()
37
37
ImageFrame::ImageFrame (Ref<NativeImage>&& nativeImage)
38
38
: m_nativeImage(WTFMove(nativeImage))
39
39
{
40
+ #if PLATFORM(JAVA)
41
+ /* Ref: Webkit 619.1 javafx.web/src/main/native/Source/WebCore/platform/graphics/ImageSource.cpp refactoring in 620.1
42
+ *
43
+ * In the case of the canvas pattern using a transform property filled with an SVGMatrix()
44
+ * created by an SVG element, `frame.m_nativeImage->size()` calls `NativeImage::size()`
45
+ * from NativeImageJava.cpp.
46
+ *
47
+ * In this scenario, `*m_platformImage->getImage().get()` may be invalid,
48
+ * as the image decoder has already populated `frame.m_size` during image metadata caching.
49
+ *
50
+ * To avoid potential invalid accesses and unintended size resets, only update `m_size`
51
+ * if the frame does not already have a valid native image.
52
+ */
53
+ if (!hasNativeImage () && m_nativeImage)
54
+ m_size = m_nativeImage->size ();
55
+ #else
40
56
m_size = m_nativeImage->size ();
57
+ #endif
41
58
m_hasAlpha = m_nativeImage->hasAlpha ();
59
+
42
60
}
43
61
44
62
ImageFrame::~ImageFrame ()
Original file line number Diff line number Diff line change 37
37
import org .junit .jupiter .api .AfterEach ;
38
38
import org .junit .jupiter .api .Test ;
39
39
import static org .junit .jupiter .api .Assertions .*;
40
- import org .junit .jupiter .api .Disabled ;
41
40
42
41
/**
43
42
* Test the Image to DataURL function
@@ -121,7 +120,6 @@ public class CanvasTest extends TestBase {
121
120
}
122
121
123
122
// JDK-8234471
124
- @ Disabled ("JDK-8347937" )
125
123
@ Test public void testCanvasPattern () throws Exception {
126
124
final String htmlCanvasContent = "\n "
127
125
+ "<canvas id='canvaspattern' width='100' height='100'></canvas>\n "
You can’t perform that action at this time.
0 commit comments