haikuwebkit/LayoutTests/fast/canvas/canvas-conic-gradient-angle...

29 lines
1.0 KiB
HTML
Raw Permalink Normal View History

Implement CanvasRenderingContext2D.createConicGradient https://bugs.webkit.org/show_bug.cgi?id=225539 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic-expected.txt: Source/WebCore: Proposal document: https://github.com/fserb/canvas2D/blob/master/spec/conic-gradient.md MDN documentation: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createConicGradient Tests: fast/canvas/canvas-conic-gradient-angle.html fast/canvas/canvas-conic-gradient-center.html fast/canvas/conicGradient-infinite-values.html * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasGradient.cpp: (WebCore::CanvasGradient::CanvasGradient): (WebCore::m_canvas): (WebCore::CanvasGradient::create): * html/canvas/CanvasGradient.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::createConicGradient): * html/canvas/CanvasRenderingContext2DBase.h: Source/WebInspectorUI: * UserInterface/Models/NativeFunctionParameters.js: * UserInterface/Models/Recording.js: (WI.Recording.prototype.async swizzle): * UserInterface/Views/RecordingActionTreeElement.js: (WI.RecordingActionTreeElement._classNameForAction): LayoutTests: * fast/canvas/canvas-conic-gradient-angle-expected.html: Added. * fast/canvas/canvas-conic-gradient-angle.html: Added. * fast/canvas/canvas-conic-gradient-center-expected.html: Added. * fast/canvas/canvas-conic-gradient-center.html: Added. * fast/canvas/conicGradient-infinite-values-expected.txt: Added. * fast/canvas/conicGradient-infinite-values.html: Added. * inspector/canvas/recording-html-2d-expected.txt: * inspector/canvas/recording-html-2d.html: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/237775@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277547 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-15 20:46:56 +00:00
<style>
canvas {
border: 1px solid;
}
</style>
<body>
<canvas id="c1" width="100" height="100"></canvas>
<canvas id="c2" width="100" height="100"></canvas>
<canvas id="c3" width="100" height="100"></canvas>
<canvas id="c4" width="100" height="100"></canvas>
<script>
function fillCanvasWithSolidColor(canvasId, x, y, width, height) {
const canvas = document.getElementById(canvasId);
const ctx = canvas.getContext('2d');
ctx.fillStyle = "black";
ctx.fillRect(x, y, width, height);
}
fillCanvasWithSolidColor("c1", 50, 0, 50, 50);
fillCanvasWithSolidColor("c1", 0, 50, 50, 50);
fillCanvasWithSolidColor("c2", 0, 0, 50, 50);
fillCanvasWithSolidColor("c2", 50, 50, 50, 50);
fillCanvasWithSolidColor("c3", 0, 50, 50, 50);
fillCanvasWithSolidColor("c3", 50, 0, 50, 50);
fillCanvasWithSolidColor("c4", 0, 0, 50, 50);
fillCanvasWithSolidColor("c4", 50, 50, 50, 50);
</script>
</body>