1 | /* |
2 | This file is part of the WebKit open source project. |
3 | This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
4 | |
5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. |
9 | |
10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 | Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #include "config.h" |
22 | |
23 | #if ENABLE(CSS_PAINTING_API) |
24 | |
25 | #include "JSPaintRenderingContext2D.h" |
26 | |
27 | #include "JSCanvasFillRule.h" |
28 | #include "JSCanvasGradient.h" |
29 | #include "JSCanvasLineCap.h" |
30 | #include "JSCanvasLineJoin.h" |
31 | #include "JSCanvasPattern.h" |
32 | #include "JSDOMAttribute.h" |
33 | #include "JSDOMBinding.h" |
34 | #include "JSDOMConstructorNotConstructable.h" |
35 | #include "JSDOMConvertBoolean.h" |
36 | #include "JSDOMConvertDictionary.h" |
37 | #include "JSDOMConvertEnumeration.h" |
38 | #include "JSDOMConvertInterface.h" |
39 | #include "JSDOMConvertNullable.h" |
40 | #include "JSDOMConvertNumbers.h" |
41 | #include "JSDOMConvertSequences.h" |
42 | #include "JSDOMConvertStrings.h" |
43 | #include "JSDOMConvertUnion.h" |
44 | #include "JSDOMExceptionHandling.h" |
45 | #include "JSDOMGlobalObject.h" |
46 | #include "JSDOMMatrix.h" |
47 | #include "JSDOMMatrix2DInit.h" |
48 | #include "JSDOMOperation.h" |
49 | #include "JSDOMWrapperCache.h" |
50 | #include "JSHTMLCanvasElement.h" |
51 | #include "JSHTMLImageElement.h" |
52 | #include "JSHTMLVideoElement.h" |
53 | #include "JSImageBitmap.h" |
54 | #include "JSImageSmoothingQuality.h" |
55 | #include "JSPath2D.h" |
56 | #include "RuntimeEnabledFeatures.h" |
57 | #include "ScriptExecutionContext.h" |
58 | #include <JavaScriptCore/FunctionPrototype.h> |
59 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
60 | #include <JavaScriptCore/JSArray.h> |
61 | #include <JavaScriptCore/JSCInlines.h> |
62 | #include <wtf/GetPtr.h> |
63 | #include <wtf/PointerPreparations.h> |
64 | #include <wtf/URL.h> |
65 | #include <wtf/Variant.h> |
66 | |
67 | |
68 | namespace WebCore { |
69 | using namespace JSC; |
70 | |
71 | // Functions |
72 | |
73 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionDrawImage(JSC::ExecState*); |
74 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionBeginPath(JSC::ExecState*); |
75 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionFill(JSC::ExecState*); |
76 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionStroke(JSC::ExecState*); |
77 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionClip(JSC::ExecState*); |
78 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionIsPointInPath(JSC::ExecState*); |
79 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionIsPointInStroke(JSC::ExecState*); |
80 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionCreateLinearGradient(JSC::ExecState*); |
81 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionCreateRadialGradient(JSC::ExecState*); |
82 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionCreatePattern(JSC::ExecState*); |
83 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionClosePath(JSC::ExecState*); |
84 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionMoveTo(JSC::ExecState*); |
85 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionLineTo(JSC::ExecState*); |
86 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionQuadraticCurveTo(JSC::ExecState*); |
87 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionBezierCurveTo(JSC::ExecState*); |
88 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionArcTo(JSC::ExecState*); |
89 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionRect(JSC::ExecState*); |
90 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionArc(JSC::ExecState*); |
91 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionEllipse(JSC::ExecState*); |
92 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionSetLineDash(JSC::ExecState*); |
93 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionGetLineDash(JSC::ExecState*); |
94 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionClearRect(JSC::ExecState*); |
95 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionFillRect(JSC::ExecState*); |
96 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionStrokeRect(JSC::ExecState*); |
97 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionSave(JSC::ExecState*); |
98 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionRestore(JSC::ExecState*); |
99 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionScale(JSC::ExecState*); |
100 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionRotate(JSC::ExecState*); |
101 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionTranslate(JSC::ExecState*); |
102 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionTransform(JSC::ExecState*); |
103 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionGetTransform(JSC::ExecState*); |
104 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionSetTransform(JSC::ExecState*); |
105 | JSC::EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionResetTransform(JSC::ExecState*); |
106 | |
107 | // Attributes |
108 | |
109 | JSC::EncodedJSValue jsPaintRenderingContext2DConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
110 | bool setJSPaintRenderingContext2DConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
111 | JSC::EncodedJSValue jsPaintRenderingContext2DGlobalAlpha(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
112 | bool setJSPaintRenderingContext2DGlobalAlpha(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
113 | JSC::EncodedJSValue jsPaintRenderingContext2DGlobalCompositeOperation(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
114 | bool setJSPaintRenderingContext2DGlobalCompositeOperation(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
115 | JSC::EncodedJSValue jsPaintRenderingContext2DStrokeStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
116 | bool setJSPaintRenderingContext2DStrokeStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
117 | JSC::EncodedJSValue jsPaintRenderingContext2DFillStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
118 | bool setJSPaintRenderingContext2DFillStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
119 | JSC::EncodedJSValue jsPaintRenderingContext2DImageSmoothingEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
120 | bool setJSPaintRenderingContext2DImageSmoothingEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
121 | JSC::EncodedJSValue jsPaintRenderingContext2DImageSmoothingQuality(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
122 | bool setJSPaintRenderingContext2DImageSmoothingQuality(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
123 | JSC::EncodedJSValue jsPaintRenderingContext2DCurrentX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
124 | JSC::EncodedJSValue jsPaintRenderingContext2DCurrentY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
125 | JSC::EncodedJSValue jsPaintRenderingContext2DLineWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
126 | bool setJSPaintRenderingContext2DLineWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
127 | JSC::EncodedJSValue jsPaintRenderingContext2DLineCap(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
128 | bool setJSPaintRenderingContext2DLineCap(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
129 | JSC::EncodedJSValue jsPaintRenderingContext2DLineJoin(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
130 | bool setJSPaintRenderingContext2DLineJoin(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
131 | JSC::EncodedJSValue jsPaintRenderingContext2DMiterLimit(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
132 | bool setJSPaintRenderingContext2DMiterLimit(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
133 | JSC::EncodedJSValue jsPaintRenderingContext2DLineDashOffset(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
134 | bool setJSPaintRenderingContext2DLineDashOffset(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
135 | JSC::EncodedJSValue jsPaintRenderingContext2DShadowOffsetX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
136 | bool setJSPaintRenderingContext2DShadowOffsetX(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
137 | JSC::EncodedJSValue jsPaintRenderingContext2DShadowOffsetY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
138 | bool setJSPaintRenderingContext2DShadowOffsetY(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
139 | JSC::EncodedJSValue jsPaintRenderingContext2DShadowBlur(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
140 | bool setJSPaintRenderingContext2DShadowBlur(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
141 | JSC::EncodedJSValue jsPaintRenderingContext2DShadowColor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
142 | bool setJSPaintRenderingContext2DShadowColor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
143 | |
144 | class JSPaintRenderingContext2DPrototype : public JSC::JSNonFinalObject { |
145 | public: |
146 | using Base = JSC::JSNonFinalObject; |
147 | static JSPaintRenderingContext2DPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
148 | { |
149 | JSPaintRenderingContext2DPrototype* ptr = new (NotNull, JSC::allocateCell<JSPaintRenderingContext2DPrototype>(vm.heap)) JSPaintRenderingContext2DPrototype(vm, globalObject, structure); |
150 | ptr->finishCreation(vm); |
151 | return ptr; |
152 | } |
153 | |
154 | DECLARE_INFO; |
155 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
156 | { |
157 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
158 | } |
159 | |
160 | private: |
161 | JSPaintRenderingContext2DPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
162 | : JSC::JSNonFinalObject(vm, structure) |
163 | { |
164 | } |
165 | |
166 | void finishCreation(JSC::VM&); |
167 | }; |
168 | |
169 | using JSPaintRenderingContext2DConstructor = JSDOMConstructorNotConstructable<JSPaintRenderingContext2D>; |
170 | |
171 | template<> JSValue JSPaintRenderingContext2DConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
172 | { |
173 | UNUSED_PARAM(vm); |
174 | return globalObject.functionPrototype(); |
175 | } |
176 | |
177 | template<> void JSPaintRenderingContext2DConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
178 | { |
179 | putDirect(vm, vm.propertyNames->prototype, JSPaintRenderingContext2D::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
180 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("PaintRenderingContext2D"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
181 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
182 | } |
183 | |
184 | template<> const ClassInfo JSPaintRenderingContext2DConstructor::s_info = { "PaintRenderingContext2D" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPaintRenderingContext2DConstructor) }; |
185 | |
186 | /* Hash table for prototype */ |
187 | |
188 | static const HashTableValue JSPaintRenderingContext2DPrototypeTableValues[] = |
189 | { |
190 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DConstructor) } }, |
191 | { "globalAlpha" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DGlobalAlpha), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DGlobalAlpha) } }, |
192 | { "globalCompositeOperation" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DGlobalCompositeOperation), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DGlobalCompositeOperation) } }, |
193 | { "strokeStyle" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DStrokeStyle), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DStrokeStyle) } }, |
194 | { "fillStyle" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DFillStyle), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DFillStyle) } }, |
195 | { "imageSmoothingEnabled" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DImageSmoothingEnabled), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DImageSmoothingEnabled) } }, |
196 | { "imageSmoothingQuality" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DImageSmoothingQuality), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DImageSmoothingQuality) } }, |
197 | { "currentX" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DCurrentX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
198 | { "currentY" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DCurrentY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
199 | { "lineWidth" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DLineWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DLineWidth) } }, |
200 | { "lineCap" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DLineCap), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DLineCap) } }, |
201 | { "lineJoin" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DLineJoin), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DLineJoin) } }, |
202 | { "miterLimit" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DMiterLimit), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DMiterLimit) } }, |
203 | { "lineDashOffset" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DLineDashOffset), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DLineDashOffset) } }, |
204 | { "shadowOffsetX" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DShadowOffsetX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DShadowOffsetX) } }, |
205 | { "shadowOffsetY" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DShadowOffsetY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DShadowOffsetY) } }, |
206 | { "shadowBlur" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DShadowBlur), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DShadowBlur) } }, |
207 | { "shadowColor" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintRenderingContext2DShadowColor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSPaintRenderingContext2DShadowColor) } }, |
208 | { "drawImage" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionDrawImage), (intptr_t) (3) } }, |
209 | { "beginPath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionBeginPath), (intptr_t) (0) } }, |
210 | { "fill" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionFill), (intptr_t) (0) } }, |
211 | { "stroke" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionStroke), (intptr_t) (0) } }, |
212 | { "clip" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionClip), (intptr_t) (0) } }, |
213 | { "isPointInPath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionIsPointInPath), (intptr_t) (2) } }, |
214 | { "isPointInStroke" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionIsPointInStroke), (intptr_t) (2) } }, |
215 | { "createLinearGradient" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionCreateLinearGradient), (intptr_t) (4) } }, |
216 | { "createRadialGradient" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionCreateRadialGradient), (intptr_t) (6) } }, |
217 | { "createPattern" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionCreatePattern), (intptr_t) (2) } }, |
218 | { "closePath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionClosePath), (intptr_t) (0) } }, |
219 | { "moveTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionMoveTo), (intptr_t) (2) } }, |
220 | { "lineTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionLineTo), (intptr_t) (2) } }, |
221 | { "quadraticCurveTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionQuadraticCurveTo), (intptr_t) (4) } }, |
222 | { "bezierCurveTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionBezierCurveTo), (intptr_t) (6) } }, |
223 | { "arcTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionArcTo), (intptr_t) (5) } }, |
224 | { "rect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionRect), (intptr_t) (4) } }, |
225 | { "arc" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionArc), (intptr_t) (5) } }, |
226 | { "ellipse" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionEllipse), (intptr_t) (7) } }, |
227 | { "setLineDash" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionSetLineDash), (intptr_t) (1) } }, |
228 | { "getLineDash" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionGetLineDash), (intptr_t) (0) } }, |
229 | { "clearRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionClearRect), (intptr_t) (4) } }, |
230 | { "fillRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionFillRect), (intptr_t) (4) } }, |
231 | { "strokeRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionStrokeRect), (intptr_t) (4) } }, |
232 | { "save" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionSave), (intptr_t) (0) } }, |
233 | { "restore" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionRestore), (intptr_t) (0) } }, |
234 | { "scale" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionScale), (intptr_t) (2) } }, |
235 | { "rotate" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionRotate), (intptr_t) (1) } }, |
236 | { "translate" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionTranslate), (intptr_t) (2) } }, |
237 | { "transform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionTransform), (intptr_t) (6) } }, |
238 | { "getTransform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionGetTransform), (intptr_t) (0) } }, |
239 | { "setTransform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionSetTransform), (intptr_t) (0) } }, |
240 | { "resetTransform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsPaintRenderingContext2DPrototypeFunctionResetTransform), (intptr_t) (0) } }, |
241 | }; |
242 | |
243 | const ClassInfo JSPaintRenderingContext2DPrototype::s_info = { "PaintRenderingContext2DPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPaintRenderingContext2DPrototype) }; |
244 | |
245 | void JSPaintRenderingContext2DPrototype::finishCreation(VM& vm) |
246 | { |
247 | Base::finishCreation(vm); |
248 | reifyStaticProperties(vm, JSPaintRenderingContext2D::info(), JSPaintRenderingContext2DPrototypeTableValues, *this); |
249 | bool hasDisabledRuntimeProperties = false; |
250 | if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { |
251 | hasDisabledRuntimeProperties = true; |
252 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("currentX" ), strlen("currentX" )); |
253 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
254 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
255 | } |
256 | if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { |
257 | hasDisabledRuntimeProperties = true; |
258 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("currentY" ), strlen("currentY" )); |
259 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
260 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
261 | } |
262 | if (hasDisabledRuntimeProperties && structure()->isDictionary()) |
263 | flattenDictionaryObject(vm); |
264 | } |
265 | |
266 | const ClassInfo JSPaintRenderingContext2D::s_info = { "PaintRenderingContext2D" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPaintRenderingContext2D) }; |
267 | |
268 | JSPaintRenderingContext2D::JSPaintRenderingContext2D(Structure* structure, JSDOMGlobalObject& globalObject, Ref<PaintRenderingContext2D>&& impl) |
269 | : JSDOMWrapper<PaintRenderingContext2D>(structure, globalObject, WTFMove(impl)) |
270 | { |
271 | } |
272 | |
273 | void JSPaintRenderingContext2D::finishCreation(VM& vm) |
274 | { |
275 | Base::finishCreation(vm); |
276 | ASSERT(inherits(vm, info())); |
277 | |
278 | } |
279 | |
280 | JSObject* JSPaintRenderingContext2D::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
281 | { |
282 | return JSPaintRenderingContext2DPrototype::create(vm, &globalObject, JSPaintRenderingContext2DPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
283 | } |
284 | |
285 | JSObject* JSPaintRenderingContext2D::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
286 | { |
287 | return getDOMPrototype<JSPaintRenderingContext2D>(vm, globalObject); |
288 | } |
289 | |
290 | JSValue JSPaintRenderingContext2D::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
291 | { |
292 | return getDOMConstructor<JSPaintRenderingContext2DConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
293 | } |
294 | |
295 | void JSPaintRenderingContext2D::destroy(JSC::JSCell* cell) |
296 | { |
297 | JSPaintRenderingContext2D* thisObject = static_cast<JSPaintRenderingContext2D*>(cell); |
298 | thisObject->JSPaintRenderingContext2D::~JSPaintRenderingContext2D(); |
299 | } |
300 | |
301 | template<> inline JSPaintRenderingContext2D* IDLAttribute<JSPaintRenderingContext2D>::cast(ExecState& state, EncodedJSValue thisValue) |
302 | { |
303 | return jsDynamicCast<JSPaintRenderingContext2D*>(state.vm(), JSValue::decode(thisValue)); |
304 | } |
305 | |
306 | template<> inline JSPaintRenderingContext2D* IDLOperation<JSPaintRenderingContext2D>::cast(ExecState& state) |
307 | { |
308 | return jsDynamicCast<JSPaintRenderingContext2D*>(state.vm(), state.thisValue()); |
309 | } |
310 | |
311 | EncodedJSValue jsPaintRenderingContext2DConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
312 | { |
313 | VM& vm = state->vm(); |
314 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
315 | auto* prototype = jsDynamicCast<JSPaintRenderingContext2DPrototype*>(vm, JSValue::decode(thisValue)); |
316 | if (UNLIKELY(!prototype)) |
317 | return throwVMTypeError(state, throwScope); |
318 | return JSValue::encode(JSPaintRenderingContext2D::getConstructor(state->vm(), prototype->globalObject())); |
319 | } |
320 | |
321 | bool setJSPaintRenderingContext2DConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
322 | { |
323 | VM& vm = state->vm(); |
324 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
325 | auto* prototype = jsDynamicCast<JSPaintRenderingContext2DPrototype*>(vm, JSValue::decode(thisValue)); |
326 | if (UNLIKELY(!prototype)) { |
327 | throwVMTypeError(state, throwScope); |
328 | return false; |
329 | } |
330 | // Shadowing a built-in constructor |
331 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
332 | } |
333 | |
334 | static inline JSValue jsPaintRenderingContext2DGlobalAlphaGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
335 | { |
336 | UNUSED_PARAM(throwScope); |
337 | UNUSED_PARAM(state); |
338 | auto& impl = thisObject.wrapped(); |
339 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.globalAlpha()); |
340 | return result; |
341 | } |
342 | |
343 | EncodedJSValue jsPaintRenderingContext2DGlobalAlpha(ExecState* state, EncodedJSValue thisValue, PropertyName) |
344 | { |
345 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DGlobalAlphaGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "globalAlpha" ); |
346 | } |
347 | |
348 | static inline bool setJSPaintRenderingContext2DGlobalAlphaSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
349 | { |
350 | UNUSED_PARAM(throwScope); |
351 | auto& impl = thisObject.wrapped(); |
352 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
353 | RETURN_IF_EXCEPTION(throwScope, false); |
354 | AttributeSetter::call(state, throwScope, [&] { |
355 | return impl.setGlobalAlpha(WTFMove(nativeValue)); |
356 | }); |
357 | return true; |
358 | } |
359 | |
360 | bool setJSPaintRenderingContext2DGlobalAlpha(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
361 | { |
362 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DGlobalAlphaSetter>(*state, thisValue, encodedValue, "globalAlpha" ); |
363 | } |
364 | |
365 | static inline JSValue jsPaintRenderingContext2DGlobalCompositeOperationGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
366 | { |
367 | UNUSED_PARAM(throwScope); |
368 | UNUSED_PARAM(state); |
369 | auto& impl = thisObject.wrapped(); |
370 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.globalCompositeOperation()); |
371 | return result; |
372 | } |
373 | |
374 | EncodedJSValue jsPaintRenderingContext2DGlobalCompositeOperation(ExecState* state, EncodedJSValue thisValue, PropertyName) |
375 | { |
376 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DGlobalCompositeOperationGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "globalCompositeOperation" ); |
377 | } |
378 | |
379 | static inline bool setJSPaintRenderingContext2DGlobalCompositeOperationSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
380 | { |
381 | UNUSED_PARAM(throwScope); |
382 | auto& impl = thisObject.wrapped(); |
383 | auto nativeValue = convert<IDLDOMString>(state, value); |
384 | RETURN_IF_EXCEPTION(throwScope, false); |
385 | AttributeSetter::call(state, throwScope, [&] { |
386 | return impl.setGlobalCompositeOperation(WTFMove(nativeValue)); |
387 | }); |
388 | return true; |
389 | } |
390 | |
391 | bool setJSPaintRenderingContext2DGlobalCompositeOperation(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
392 | { |
393 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DGlobalCompositeOperationSetter>(*state, thisValue, encodedValue, "globalCompositeOperation" ); |
394 | } |
395 | |
396 | static inline JSValue jsPaintRenderingContext2DStrokeStyleGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
397 | { |
398 | UNUSED_PARAM(throwScope); |
399 | UNUSED_PARAM(state); |
400 | auto& impl = thisObject.wrapped(); |
401 | JSValue result = toJS<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, *thisObject.globalObject(), throwScope, impl.strokeStyle()); |
402 | return result; |
403 | } |
404 | |
405 | EncodedJSValue jsPaintRenderingContext2DStrokeStyle(ExecState* state, EncodedJSValue thisValue, PropertyName) |
406 | { |
407 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DStrokeStyleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "strokeStyle" ); |
408 | } |
409 | |
410 | static inline bool setJSPaintRenderingContext2DStrokeStyleSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
411 | { |
412 | UNUSED_PARAM(throwScope); |
413 | auto& impl = thisObject.wrapped(); |
414 | auto nativeValue = convert<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, value); |
415 | RETURN_IF_EXCEPTION(throwScope, false); |
416 | AttributeSetter::call(state, throwScope, [&] { |
417 | return impl.setStrokeStyle(WTFMove(nativeValue)); |
418 | }); |
419 | return true; |
420 | } |
421 | |
422 | bool setJSPaintRenderingContext2DStrokeStyle(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
423 | { |
424 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DStrokeStyleSetter>(*state, thisValue, encodedValue, "strokeStyle" ); |
425 | } |
426 | |
427 | static inline JSValue jsPaintRenderingContext2DFillStyleGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
428 | { |
429 | UNUSED_PARAM(throwScope); |
430 | UNUSED_PARAM(state); |
431 | auto& impl = thisObject.wrapped(); |
432 | JSValue result = toJS<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, *thisObject.globalObject(), throwScope, impl.fillStyle()); |
433 | return result; |
434 | } |
435 | |
436 | EncodedJSValue jsPaintRenderingContext2DFillStyle(ExecState* state, EncodedJSValue thisValue, PropertyName) |
437 | { |
438 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DFillStyleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "fillStyle" ); |
439 | } |
440 | |
441 | static inline bool setJSPaintRenderingContext2DFillStyleSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
442 | { |
443 | UNUSED_PARAM(throwScope); |
444 | auto& impl = thisObject.wrapped(); |
445 | auto nativeValue = convert<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, value); |
446 | RETURN_IF_EXCEPTION(throwScope, false); |
447 | AttributeSetter::call(state, throwScope, [&] { |
448 | return impl.setFillStyle(WTFMove(nativeValue)); |
449 | }); |
450 | return true; |
451 | } |
452 | |
453 | bool setJSPaintRenderingContext2DFillStyle(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
454 | { |
455 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DFillStyleSetter>(*state, thisValue, encodedValue, "fillStyle" ); |
456 | } |
457 | |
458 | static inline JSValue jsPaintRenderingContext2DImageSmoothingEnabledGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
459 | { |
460 | UNUSED_PARAM(throwScope); |
461 | UNUSED_PARAM(state); |
462 | auto& impl = thisObject.wrapped(); |
463 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.imageSmoothingEnabled()); |
464 | return result; |
465 | } |
466 | |
467 | EncodedJSValue jsPaintRenderingContext2DImageSmoothingEnabled(ExecState* state, EncodedJSValue thisValue, PropertyName) |
468 | { |
469 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DImageSmoothingEnabledGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "imageSmoothingEnabled" ); |
470 | } |
471 | |
472 | static inline bool setJSPaintRenderingContext2DImageSmoothingEnabledSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
473 | { |
474 | UNUSED_PARAM(throwScope); |
475 | auto& impl = thisObject.wrapped(); |
476 | auto nativeValue = convert<IDLBoolean>(state, value); |
477 | RETURN_IF_EXCEPTION(throwScope, false); |
478 | AttributeSetter::call(state, throwScope, [&] { |
479 | return impl.setImageSmoothingEnabled(WTFMove(nativeValue)); |
480 | }); |
481 | return true; |
482 | } |
483 | |
484 | bool setJSPaintRenderingContext2DImageSmoothingEnabled(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
485 | { |
486 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DImageSmoothingEnabledSetter>(*state, thisValue, encodedValue, "imageSmoothingEnabled" ); |
487 | } |
488 | |
489 | static inline JSValue jsPaintRenderingContext2DImageSmoothingQualityGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
490 | { |
491 | UNUSED_PARAM(throwScope); |
492 | UNUSED_PARAM(state); |
493 | auto& impl = thisObject.wrapped(); |
494 | JSValue result = toJS<IDLEnumeration<ImageSmoothingQuality>>(state, throwScope, impl.imageSmoothingQuality()); |
495 | return result; |
496 | } |
497 | |
498 | EncodedJSValue jsPaintRenderingContext2DImageSmoothingQuality(ExecState* state, EncodedJSValue thisValue, PropertyName) |
499 | { |
500 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DImageSmoothingQualityGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "imageSmoothingQuality" ); |
501 | } |
502 | |
503 | static inline bool setJSPaintRenderingContext2DImageSmoothingQualitySetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
504 | { |
505 | UNUSED_PARAM(throwScope); |
506 | auto& impl = thisObject.wrapped(); |
507 | auto optionalNativeValue = parseEnumeration<ImageSmoothingQuality>(state, value); |
508 | RETURN_IF_EXCEPTION(throwScope, false); |
509 | if (UNLIKELY(!optionalNativeValue)) |
510 | return false; |
511 | auto nativeValue = optionalNativeValue.value(); |
512 | AttributeSetter::call(state, throwScope, [&] { |
513 | return impl.setImageSmoothingQuality(WTFMove(nativeValue)); |
514 | }); |
515 | return true; |
516 | } |
517 | |
518 | bool setJSPaintRenderingContext2DImageSmoothingQuality(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
519 | { |
520 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DImageSmoothingQualitySetter>(*state, thisValue, encodedValue, "imageSmoothingQuality" ); |
521 | } |
522 | |
523 | static inline JSValue jsPaintRenderingContext2DCurrentXGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
524 | { |
525 | UNUSED_PARAM(throwScope); |
526 | UNUSED_PARAM(state); |
527 | auto& impl = thisObject.wrapped(); |
528 | JSValue result = toJS<IDLFloat>(state, throwScope, impl.currentX()); |
529 | return result; |
530 | } |
531 | |
532 | EncodedJSValue jsPaintRenderingContext2DCurrentX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
533 | { |
534 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DCurrentXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "currentX" ); |
535 | } |
536 | |
537 | static inline JSValue jsPaintRenderingContext2DCurrentYGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
538 | { |
539 | UNUSED_PARAM(throwScope); |
540 | UNUSED_PARAM(state); |
541 | auto& impl = thisObject.wrapped(); |
542 | JSValue result = toJS<IDLFloat>(state, throwScope, impl.currentY()); |
543 | return result; |
544 | } |
545 | |
546 | EncodedJSValue jsPaintRenderingContext2DCurrentY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
547 | { |
548 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DCurrentYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "currentY" ); |
549 | } |
550 | |
551 | static inline JSValue jsPaintRenderingContext2DLineWidthGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
552 | { |
553 | UNUSED_PARAM(throwScope); |
554 | UNUSED_PARAM(state); |
555 | auto& impl = thisObject.wrapped(); |
556 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.lineWidth()); |
557 | return result; |
558 | } |
559 | |
560 | EncodedJSValue jsPaintRenderingContext2DLineWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
561 | { |
562 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DLineWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineWidth" ); |
563 | } |
564 | |
565 | static inline bool setJSPaintRenderingContext2DLineWidthSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
566 | { |
567 | UNUSED_PARAM(throwScope); |
568 | auto& impl = thisObject.wrapped(); |
569 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
570 | RETURN_IF_EXCEPTION(throwScope, false); |
571 | AttributeSetter::call(state, throwScope, [&] { |
572 | return impl.setLineWidth(WTFMove(nativeValue)); |
573 | }); |
574 | return true; |
575 | } |
576 | |
577 | bool setJSPaintRenderingContext2DLineWidth(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
578 | { |
579 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DLineWidthSetter>(*state, thisValue, encodedValue, "lineWidth" ); |
580 | } |
581 | |
582 | static inline JSValue jsPaintRenderingContext2DLineCapGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
583 | { |
584 | UNUSED_PARAM(throwScope); |
585 | UNUSED_PARAM(state); |
586 | auto& impl = thisObject.wrapped(); |
587 | JSValue result = toJS<IDLEnumeration<CanvasLineCap>>(state, throwScope, impl.lineCap()); |
588 | return result; |
589 | } |
590 | |
591 | EncodedJSValue jsPaintRenderingContext2DLineCap(ExecState* state, EncodedJSValue thisValue, PropertyName) |
592 | { |
593 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DLineCapGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineCap" ); |
594 | } |
595 | |
596 | static inline bool setJSPaintRenderingContext2DLineCapSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
597 | { |
598 | UNUSED_PARAM(throwScope); |
599 | auto& impl = thisObject.wrapped(); |
600 | auto optionalNativeValue = parseEnumeration<CanvasLineCap>(state, value); |
601 | RETURN_IF_EXCEPTION(throwScope, false); |
602 | if (UNLIKELY(!optionalNativeValue)) |
603 | return false; |
604 | auto nativeValue = optionalNativeValue.value(); |
605 | AttributeSetter::call(state, throwScope, [&] { |
606 | return impl.setLineCap(WTFMove(nativeValue)); |
607 | }); |
608 | return true; |
609 | } |
610 | |
611 | bool setJSPaintRenderingContext2DLineCap(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
612 | { |
613 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DLineCapSetter>(*state, thisValue, encodedValue, "lineCap" ); |
614 | } |
615 | |
616 | static inline JSValue jsPaintRenderingContext2DLineJoinGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
617 | { |
618 | UNUSED_PARAM(throwScope); |
619 | UNUSED_PARAM(state); |
620 | auto& impl = thisObject.wrapped(); |
621 | JSValue result = toJS<IDLEnumeration<CanvasLineJoin>>(state, throwScope, impl.lineJoin()); |
622 | return result; |
623 | } |
624 | |
625 | EncodedJSValue jsPaintRenderingContext2DLineJoin(ExecState* state, EncodedJSValue thisValue, PropertyName) |
626 | { |
627 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DLineJoinGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineJoin" ); |
628 | } |
629 | |
630 | static inline bool setJSPaintRenderingContext2DLineJoinSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
631 | { |
632 | UNUSED_PARAM(throwScope); |
633 | auto& impl = thisObject.wrapped(); |
634 | auto optionalNativeValue = parseEnumeration<CanvasLineJoin>(state, value); |
635 | RETURN_IF_EXCEPTION(throwScope, false); |
636 | if (UNLIKELY(!optionalNativeValue)) |
637 | return false; |
638 | auto nativeValue = optionalNativeValue.value(); |
639 | AttributeSetter::call(state, throwScope, [&] { |
640 | return impl.setLineJoin(WTFMove(nativeValue)); |
641 | }); |
642 | return true; |
643 | } |
644 | |
645 | bool setJSPaintRenderingContext2DLineJoin(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
646 | { |
647 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DLineJoinSetter>(*state, thisValue, encodedValue, "lineJoin" ); |
648 | } |
649 | |
650 | static inline JSValue jsPaintRenderingContext2DMiterLimitGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
651 | { |
652 | UNUSED_PARAM(throwScope); |
653 | UNUSED_PARAM(state); |
654 | auto& impl = thisObject.wrapped(); |
655 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.miterLimit()); |
656 | return result; |
657 | } |
658 | |
659 | EncodedJSValue jsPaintRenderingContext2DMiterLimit(ExecState* state, EncodedJSValue thisValue, PropertyName) |
660 | { |
661 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DMiterLimitGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "miterLimit" ); |
662 | } |
663 | |
664 | static inline bool setJSPaintRenderingContext2DMiterLimitSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
665 | { |
666 | UNUSED_PARAM(throwScope); |
667 | auto& impl = thisObject.wrapped(); |
668 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
669 | RETURN_IF_EXCEPTION(throwScope, false); |
670 | AttributeSetter::call(state, throwScope, [&] { |
671 | return impl.setMiterLimit(WTFMove(nativeValue)); |
672 | }); |
673 | return true; |
674 | } |
675 | |
676 | bool setJSPaintRenderingContext2DMiterLimit(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
677 | { |
678 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DMiterLimitSetter>(*state, thisValue, encodedValue, "miterLimit" ); |
679 | } |
680 | |
681 | static inline JSValue jsPaintRenderingContext2DLineDashOffsetGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
682 | { |
683 | UNUSED_PARAM(throwScope); |
684 | UNUSED_PARAM(state); |
685 | auto& impl = thisObject.wrapped(); |
686 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.lineDashOffset()); |
687 | return result; |
688 | } |
689 | |
690 | EncodedJSValue jsPaintRenderingContext2DLineDashOffset(ExecState* state, EncodedJSValue thisValue, PropertyName) |
691 | { |
692 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DLineDashOffsetGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineDashOffset" ); |
693 | } |
694 | |
695 | static inline bool setJSPaintRenderingContext2DLineDashOffsetSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
696 | { |
697 | UNUSED_PARAM(throwScope); |
698 | auto& impl = thisObject.wrapped(); |
699 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
700 | RETURN_IF_EXCEPTION(throwScope, false); |
701 | AttributeSetter::call(state, throwScope, [&] { |
702 | return impl.setLineDashOffset(WTFMove(nativeValue)); |
703 | }); |
704 | return true; |
705 | } |
706 | |
707 | bool setJSPaintRenderingContext2DLineDashOffset(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
708 | { |
709 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DLineDashOffsetSetter>(*state, thisValue, encodedValue, "lineDashOffset" ); |
710 | } |
711 | |
712 | static inline JSValue jsPaintRenderingContext2DShadowOffsetXGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
713 | { |
714 | UNUSED_PARAM(throwScope); |
715 | UNUSED_PARAM(state); |
716 | auto& impl = thisObject.wrapped(); |
717 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.shadowOffsetX()); |
718 | return result; |
719 | } |
720 | |
721 | EncodedJSValue jsPaintRenderingContext2DShadowOffsetX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
722 | { |
723 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DShadowOffsetXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowOffsetX" ); |
724 | } |
725 | |
726 | static inline bool setJSPaintRenderingContext2DShadowOffsetXSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
727 | { |
728 | UNUSED_PARAM(throwScope); |
729 | auto& impl = thisObject.wrapped(); |
730 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
731 | RETURN_IF_EXCEPTION(throwScope, false); |
732 | AttributeSetter::call(state, throwScope, [&] { |
733 | return impl.setShadowOffsetX(WTFMove(nativeValue)); |
734 | }); |
735 | return true; |
736 | } |
737 | |
738 | bool setJSPaintRenderingContext2DShadowOffsetX(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
739 | { |
740 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DShadowOffsetXSetter>(*state, thisValue, encodedValue, "shadowOffsetX" ); |
741 | } |
742 | |
743 | static inline JSValue jsPaintRenderingContext2DShadowOffsetYGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
744 | { |
745 | UNUSED_PARAM(throwScope); |
746 | UNUSED_PARAM(state); |
747 | auto& impl = thisObject.wrapped(); |
748 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.shadowOffsetY()); |
749 | return result; |
750 | } |
751 | |
752 | EncodedJSValue jsPaintRenderingContext2DShadowOffsetY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
753 | { |
754 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DShadowOffsetYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowOffsetY" ); |
755 | } |
756 | |
757 | static inline bool setJSPaintRenderingContext2DShadowOffsetYSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
758 | { |
759 | UNUSED_PARAM(throwScope); |
760 | auto& impl = thisObject.wrapped(); |
761 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
762 | RETURN_IF_EXCEPTION(throwScope, false); |
763 | AttributeSetter::call(state, throwScope, [&] { |
764 | return impl.setShadowOffsetY(WTFMove(nativeValue)); |
765 | }); |
766 | return true; |
767 | } |
768 | |
769 | bool setJSPaintRenderingContext2DShadowOffsetY(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
770 | { |
771 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DShadowOffsetYSetter>(*state, thisValue, encodedValue, "shadowOffsetY" ); |
772 | } |
773 | |
774 | static inline JSValue jsPaintRenderingContext2DShadowBlurGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
775 | { |
776 | UNUSED_PARAM(throwScope); |
777 | UNUSED_PARAM(state); |
778 | auto& impl = thisObject.wrapped(); |
779 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.shadowBlur()); |
780 | return result; |
781 | } |
782 | |
783 | EncodedJSValue jsPaintRenderingContext2DShadowBlur(ExecState* state, EncodedJSValue thisValue, PropertyName) |
784 | { |
785 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DShadowBlurGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowBlur" ); |
786 | } |
787 | |
788 | static inline bool setJSPaintRenderingContext2DShadowBlurSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
789 | { |
790 | UNUSED_PARAM(throwScope); |
791 | auto& impl = thisObject.wrapped(); |
792 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
793 | RETURN_IF_EXCEPTION(throwScope, false); |
794 | AttributeSetter::call(state, throwScope, [&] { |
795 | return impl.setShadowBlur(WTFMove(nativeValue)); |
796 | }); |
797 | return true; |
798 | } |
799 | |
800 | bool setJSPaintRenderingContext2DShadowBlur(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
801 | { |
802 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DShadowBlurSetter>(*state, thisValue, encodedValue, "shadowBlur" ); |
803 | } |
804 | |
805 | static inline JSValue jsPaintRenderingContext2DShadowColorGetter(ExecState& state, JSPaintRenderingContext2D& thisObject, ThrowScope& throwScope) |
806 | { |
807 | UNUSED_PARAM(throwScope); |
808 | UNUSED_PARAM(state); |
809 | auto& impl = thisObject.wrapped(); |
810 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.shadowColor()); |
811 | return result; |
812 | } |
813 | |
814 | EncodedJSValue jsPaintRenderingContext2DShadowColor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
815 | { |
816 | return IDLAttribute<JSPaintRenderingContext2D>::get<jsPaintRenderingContext2DShadowColorGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowColor" ); |
817 | } |
818 | |
819 | static inline bool setJSPaintRenderingContext2DShadowColorSetter(ExecState& state, JSPaintRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
820 | { |
821 | UNUSED_PARAM(throwScope); |
822 | auto& impl = thisObject.wrapped(); |
823 | auto nativeValue = convert<IDLDOMString>(state, value); |
824 | RETURN_IF_EXCEPTION(throwScope, false); |
825 | AttributeSetter::call(state, throwScope, [&] { |
826 | return impl.setShadowColor(WTFMove(nativeValue)); |
827 | }); |
828 | return true; |
829 | } |
830 | |
831 | bool setJSPaintRenderingContext2DShadowColor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
832 | { |
833 | return IDLAttribute<JSPaintRenderingContext2D>::set<setJSPaintRenderingContext2DShadowColorSetter>(*state, thisValue, encodedValue, "shadowColor" ); |
834 | } |
835 | |
836 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionDrawImage1Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
837 | { |
838 | UNUSED_PARAM(state); |
839 | UNUSED_PARAM(throwScope); |
840 | auto& impl = castedThis->wrapped(); |
841 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
842 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
843 | auto dx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
844 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
845 | auto dy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
846 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
847 | propagateException(*state, throwScope, impl.drawImage(WTFMove(image), WTFMove(dx), WTFMove(dy))); |
848 | return JSValue::encode(jsUndefined()); |
849 | } |
850 | |
851 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionDrawImage2Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
852 | { |
853 | UNUSED_PARAM(state); |
854 | UNUSED_PARAM(throwScope); |
855 | auto& impl = castedThis->wrapped(); |
856 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
857 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
858 | auto dx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
859 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
860 | auto dy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
861 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
862 | auto dw = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
863 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
864 | auto dh = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
865 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
866 | propagateException(*state, throwScope, impl.drawImage(WTFMove(image), WTFMove(dx), WTFMove(dy), WTFMove(dw), WTFMove(dh))); |
867 | return JSValue::encode(jsUndefined()); |
868 | } |
869 | |
870 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionDrawImage3Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
871 | { |
872 | UNUSED_PARAM(state); |
873 | UNUSED_PARAM(throwScope); |
874 | auto& impl = castedThis->wrapped(); |
875 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
876 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
877 | auto sx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
878 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
879 | auto sy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
880 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
881 | auto sw = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
882 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
883 | auto sh = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
884 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
885 | auto dx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(5)); |
886 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
887 | auto dy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(6)); |
888 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
889 | auto dw = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(7)); |
890 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
891 | auto dh = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(8)); |
892 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
893 | propagateException(*state, throwScope, impl.drawImage(WTFMove(image), WTFMove(sx), WTFMove(sy), WTFMove(sw), WTFMove(sh), WTFMove(dx), WTFMove(dy), WTFMove(dw), WTFMove(dh))); |
894 | return JSValue::encode(jsUndefined()); |
895 | } |
896 | |
897 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionDrawImageOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
898 | { |
899 | UNUSED_PARAM(state); |
900 | UNUSED_PARAM(throwScope); |
901 | VM& vm = state->vm(); |
902 | UNUSED_PARAM(vm); |
903 | size_t argsCount = std::min<size_t>(9, state->argumentCount()); |
904 | if (argsCount == 3) { |
905 | return jsPaintRenderingContext2DPrototypeFunctionDrawImage1Body(state, castedThis, throwScope); |
906 | } |
907 | if (argsCount == 5) { |
908 | return jsPaintRenderingContext2DPrototypeFunctionDrawImage2Body(state, castedThis, throwScope); |
909 | } |
910 | if (argsCount == 9) { |
911 | return jsPaintRenderingContext2DPrototypeFunctionDrawImage3Body(state, castedThis, throwScope); |
912 | } |
913 | return argsCount < 3 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
914 | } |
915 | |
916 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionDrawImage(ExecState* state) |
917 | { |
918 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionDrawImageOverloadDispatcher>(*state, "drawImage" ); |
919 | } |
920 | |
921 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionBeginPathBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
922 | { |
923 | UNUSED_PARAM(state); |
924 | UNUSED_PARAM(throwScope); |
925 | auto& impl = castedThis->wrapped(); |
926 | impl.beginPath(); |
927 | return JSValue::encode(jsUndefined()); |
928 | } |
929 | |
930 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionBeginPath(ExecState* state) |
931 | { |
932 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionBeginPathBody>(*state, "beginPath" ); |
933 | } |
934 | |
935 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionFill1Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
936 | { |
937 | UNUSED_PARAM(state); |
938 | UNUSED_PARAM(throwScope); |
939 | auto& impl = castedThis->wrapped(); |
940 | auto fillRule = state->argument(0).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 0, "fillRule" , "PaintRenderingContext2D" , "fill" , expectedEnumerationValues<CanvasFillRule>()); }); |
941 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
942 | impl.fill(WTFMove(fillRule)); |
943 | return JSValue::encode(jsUndefined()); |
944 | } |
945 | |
946 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionFill2Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
947 | { |
948 | UNUSED_PARAM(state); |
949 | UNUSED_PARAM(throwScope); |
950 | auto& impl = castedThis->wrapped(); |
951 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "PaintRenderingContext2D" , "fill" , "Path2D" ); }); |
952 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
953 | auto fillRule = state->argument(1).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 1, "fillRule" , "PaintRenderingContext2D" , "fill" , expectedEnumerationValues<CanvasFillRule>()); }); |
954 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
955 | impl.fill(*path, WTFMove(fillRule)); |
956 | return JSValue::encode(jsUndefined()); |
957 | } |
958 | |
959 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionFillOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
960 | { |
961 | UNUSED_PARAM(state); |
962 | UNUSED_PARAM(throwScope); |
963 | VM& vm = state->vm(); |
964 | UNUSED_PARAM(vm); |
965 | size_t argsCount = std::min<size_t>(2, state->argumentCount()); |
966 | if (argsCount == 0) { |
967 | return jsPaintRenderingContext2DPrototypeFunctionFill1Body(state, castedThis, throwScope); |
968 | } |
969 | if (argsCount == 1) { |
970 | JSValue distinguishingArg = state->uncheckedArgument(0); |
971 | if (distinguishingArg.isUndefined()) |
972 | return jsPaintRenderingContext2DPrototypeFunctionFill1Body(state, castedThis, throwScope); |
973 | if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSPath2D>(vm)) |
974 | return jsPaintRenderingContext2DPrototypeFunctionFill2Body(state, castedThis, throwScope); |
975 | return jsPaintRenderingContext2DPrototypeFunctionFill1Body(state, castedThis, throwScope); |
976 | } |
977 | if (argsCount == 2) { |
978 | return jsPaintRenderingContext2DPrototypeFunctionFill2Body(state, castedThis, throwScope); |
979 | } |
980 | return throwVMTypeError(state, throwScope); |
981 | } |
982 | |
983 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionFill(ExecState* state) |
984 | { |
985 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionFillOverloadDispatcher>(*state, "fill" ); |
986 | } |
987 | |
988 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionStroke1Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
989 | { |
990 | UNUSED_PARAM(state); |
991 | UNUSED_PARAM(throwScope); |
992 | auto& impl = castedThis->wrapped(); |
993 | impl.stroke(); |
994 | return JSValue::encode(jsUndefined()); |
995 | } |
996 | |
997 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionStroke2Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
998 | { |
999 | UNUSED_PARAM(state); |
1000 | UNUSED_PARAM(throwScope); |
1001 | auto& impl = castedThis->wrapped(); |
1002 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "PaintRenderingContext2D" , "stroke" , "Path2D" ); }); |
1003 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1004 | impl.stroke(*path); |
1005 | return JSValue::encode(jsUndefined()); |
1006 | } |
1007 | |
1008 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionStrokeOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1009 | { |
1010 | UNUSED_PARAM(state); |
1011 | UNUSED_PARAM(throwScope); |
1012 | VM& vm = state->vm(); |
1013 | UNUSED_PARAM(vm); |
1014 | size_t argsCount = std::min<size_t>(1, state->argumentCount()); |
1015 | if (argsCount == 0) { |
1016 | return jsPaintRenderingContext2DPrototypeFunctionStroke1Body(state, castedThis, throwScope); |
1017 | } |
1018 | if (argsCount == 1) { |
1019 | return jsPaintRenderingContext2DPrototypeFunctionStroke2Body(state, castedThis, throwScope); |
1020 | } |
1021 | return throwVMTypeError(state, throwScope); |
1022 | } |
1023 | |
1024 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionStroke(ExecState* state) |
1025 | { |
1026 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionStrokeOverloadDispatcher>(*state, "stroke" ); |
1027 | } |
1028 | |
1029 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionClip1Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1030 | { |
1031 | UNUSED_PARAM(state); |
1032 | UNUSED_PARAM(throwScope); |
1033 | auto& impl = castedThis->wrapped(); |
1034 | auto fillRule = state->argument(0).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 0, "fillRule" , "PaintRenderingContext2D" , "clip" , expectedEnumerationValues<CanvasFillRule>()); }); |
1035 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1036 | impl.clip(WTFMove(fillRule)); |
1037 | return JSValue::encode(jsUndefined()); |
1038 | } |
1039 | |
1040 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionClip2Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1041 | { |
1042 | UNUSED_PARAM(state); |
1043 | UNUSED_PARAM(throwScope); |
1044 | auto& impl = castedThis->wrapped(); |
1045 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "PaintRenderingContext2D" , "clip" , "Path2D" ); }); |
1046 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1047 | auto fillRule = state->argument(1).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 1, "fillRule" , "PaintRenderingContext2D" , "clip" , expectedEnumerationValues<CanvasFillRule>()); }); |
1048 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1049 | impl.clip(*path, WTFMove(fillRule)); |
1050 | return JSValue::encode(jsUndefined()); |
1051 | } |
1052 | |
1053 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionClipOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1054 | { |
1055 | UNUSED_PARAM(state); |
1056 | UNUSED_PARAM(throwScope); |
1057 | VM& vm = state->vm(); |
1058 | UNUSED_PARAM(vm); |
1059 | size_t argsCount = std::min<size_t>(2, state->argumentCount()); |
1060 | if (argsCount == 0) { |
1061 | return jsPaintRenderingContext2DPrototypeFunctionClip1Body(state, castedThis, throwScope); |
1062 | } |
1063 | if (argsCount == 1) { |
1064 | JSValue distinguishingArg = state->uncheckedArgument(0); |
1065 | if (distinguishingArg.isUndefined()) |
1066 | return jsPaintRenderingContext2DPrototypeFunctionClip1Body(state, castedThis, throwScope); |
1067 | if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSPath2D>(vm)) |
1068 | return jsPaintRenderingContext2DPrototypeFunctionClip2Body(state, castedThis, throwScope); |
1069 | return jsPaintRenderingContext2DPrototypeFunctionClip1Body(state, castedThis, throwScope); |
1070 | } |
1071 | if (argsCount == 2) { |
1072 | return jsPaintRenderingContext2DPrototypeFunctionClip2Body(state, castedThis, throwScope); |
1073 | } |
1074 | return throwVMTypeError(state, throwScope); |
1075 | } |
1076 | |
1077 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionClip(ExecState* state) |
1078 | { |
1079 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionClipOverloadDispatcher>(*state, "clip" ); |
1080 | } |
1081 | |
1082 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionIsPointInPath1Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1083 | { |
1084 | UNUSED_PARAM(state); |
1085 | UNUSED_PARAM(throwScope); |
1086 | auto& impl = castedThis->wrapped(); |
1087 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1088 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1089 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1090 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1091 | auto fillRule = state->argument(2).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(2), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 2, "fillRule" , "PaintRenderingContext2D" , "isPointInPath" , expectedEnumerationValues<CanvasFillRule>()); }); |
1092 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1093 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInPath(WTFMove(x), WTFMove(y), WTFMove(fillRule)))); |
1094 | } |
1095 | |
1096 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionIsPointInPath2Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1097 | { |
1098 | UNUSED_PARAM(state); |
1099 | UNUSED_PARAM(throwScope); |
1100 | auto& impl = castedThis->wrapped(); |
1101 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "PaintRenderingContext2D" , "isPointInPath" , "Path2D" ); }); |
1102 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1103 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1104 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1105 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1106 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1107 | auto fillRule = state->argument(3).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(3), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 3, "fillRule" , "PaintRenderingContext2D" , "isPointInPath" , expectedEnumerationValues<CanvasFillRule>()); }); |
1108 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1109 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInPath(*path, WTFMove(x), WTFMove(y), WTFMove(fillRule)))); |
1110 | } |
1111 | |
1112 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionIsPointInPathOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1113 | { |
1114 | UNUSED_PARAM(state); |
1115 | UNUSED_PARAM(throwScope); |
1116 | VM& vm = state->vm(); |
1117 | UNUSED_PARAM(vm); |
1118 | size_t argsCount = std::min<size_t>(4, state->argumentCount()); |
1119 | if (argsCount == 2) { |
1120 | return jsPaintRenderingContext2DPrototypeFunctionIsPointInPath1Body(state, castedThis, throwScope); |
1121 | } |
1122 | if (argsCount == 3) { |
1123 | JSValue distinguishingArg = state->uncheckedArgument(0); |
1124 | if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSPath2D>(vm)) |
1125 | return jsPaintRenderingContext2DPrototypeFunctionIsPointInPath2Body(state, castedThis, throwScope); |
1126 | if (distinguishingArg.isNumber()) |
1127 | return jsPaintRenderingContext2DPrototypeFunctionIsPointInPath1Body(state, castedThis, throwScope); |
1128 | return jsPaintRenderingContext2DPrototypeFunctionIsPointInPath1Body(state, castedThis, throwScope); |
1129 | } |
1130 | if (argsCount == 4) { |
1131 | return jsPaintRenderingContext2DPrototypeFunctionIsPointInPath2Body(state, castedThis, throwScope); |
1132 | } |
1133 | return argsCount < 2 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
1134 | } |
1135 | |
1136 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionIsPointInPath(ExecState* state) |
1137 | { |
1138 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionIsPointInPathOverloadDispatcher>(*state, "isPointInPath" ); |
1139 | } |
1140 | |
1141 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionIsPointInStroke1Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1142 | { |
1143 | UNUSED_PARAM(state); |
1144 | UNUSED_PARAM(throwScope); |
1145 | auto& impl = castedThis->wrapped(); |
1146 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1147 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1148 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1149 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1150 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInStroke(WTFMove(x), WTFMove(y)))); |
1151 | } |
1152 | |
1153 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionIsPointInStroke2Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1154 | { |
1155 | UNUSED_PARAM(state); |
1156 | UNUSED_PARAM(throwScope); |
1157 | auto& impl = castedThis->wrapped(); |
1158 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "PaintRenderingContext2D" , "isPointInStroke" , "Path2D" ); }); |
1159 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1160 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1161 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1162 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1163 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1164 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInStroke(*path, WTFMove(x), WTFMove(y)))); |
1165 | } |
1166 | |
1167 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionIsPointInStrokeOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1168 | { |
1169 | UNUSED_PARAM(state); |
1170 | UNUSED_PARAM(throwScope); |
1171 | VM& vm = state->vm(); |
1172 | UNUSED_PARAM(vm); |
1173 | size_t argsCount = std::min<size_t>(3, state->argumentCount()); |
1174 | if (argsCount == 2) { |
1175 | return jsPaintRenderingContext2DPrototypeFunctionIsPointInStroke1Body(state, castedThis, throwScope); |
1176 | } |
1177 | if (argsCount == 3) { |
1178 | return jsPaintRenderingContext2DPrototypeFunctionIsPointInStroke2Body(state, castedThis, throwScope); |
1179 | } |
1180 | return argsCount < 2 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
1181 | } |
1182 | |
1183 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionIsPointInStroke(ExecState* state) |
1184 | { |
1185 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionIsPointInStrokeOverloadDispatcher>(*state, "isPointInStroke" ); |
1186 | } |
1187 | |
1188 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionCreateLinearGradientBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1189 | { |
1190 | UNUSED_PARAM(state); |
1191 | UNUSED_PARAM(throwScope); |
1192 | auto& impl = castedThis->wrapped(); |
1193 | if (UNLIKELY(state->argumentCount() < 4)) |
1194 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1195 | auto x0 = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
1196 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1197 | auto y0 = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
1198 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1199 | auto x1 = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
1200 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1201 | auto y1 = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
1202 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1203 | return JSValue::encode(toJS<IDLInterface<CanvasGradient>>(*state, *castedThis->globalObject(), throwScope, impl.createLinearGradient(WTFMove(x0), WTFMove(y0), WTFMove(x1), WTFMove(y1)))); |
1204 | } |
1205 | |
1206 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionCreateLinearGradient(ExecState* state) |
1207 | { |
1208 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionCreateLinearGradientBody>(*state, "createLinearGradient" ); |
1209 | } |
1210 | |
1211 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionCreateRadialGradientBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1212 | { |
1213 | UNUSED_PARAM(state); |
1214 | UNUSED_PARAM(throwScope); |
1215 | auto& impl = castedThis->wrapped(); |
1216 | if (UNLIKELY(state->argumentCount() < 6)) |
1217 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1218 | auto x0 = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
1219 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1220 | auto y0 = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
1221 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1222 | auto r0 = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
1223 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1224 | auto x1 = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
1225 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1226 | auto y1 = convert<IDLFloat>(*state, state->uncheckedArgument(4)); |
1227 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1228 | auto r1 = convert<IDLFloat>(*state, state->uncheckedArgument(5)); |
1229 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1230 | return JSValue::encode(toJS<IDLInterface<CanvasGradient>>(*state, *castedThis->globalObject(), throwScope, impl.createRadialGradient(WTFMove(x0), WTFMove(y0), WTFMove(r0), WTFMove(x1), WTFMove(y1), WTFMove(r1)))); |
1231 | } |
1232 | |
1233 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionCreateRadialGradient(ExecState* state) |
1234 | { |
1235 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionCreateRadialGradientBody>(*state, "createRadialGradient" ); |
1236 | } |
1237 | |
1238 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionCreatePatternBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1239 | { |
1240 | UNUSED_PARAM(state); |
1241 | UNUSED_PARAM(throwScope); |
1242 | auto& impl = castedThis->wrapped(); |
1243 | if (UNLIKELY(state->argumentCount() < 2)) |
1244 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1245 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
1246 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1247 | auto repetition = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(*state, state->uncheckedArgument(1)); |
1248 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1249 | return JSValue::encode(toJS<IDLNullable<IDLInterface<CanvasPattern>>>(*state, *castedThis->globalObject(), throwScope, impl.createPattern(WTFMove(image), WTFMove(repetition)))); |
1250 | } |
1251 | |
1252 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionCreatePattern(ExecState* state) |
1253 | { |
1254 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionCreatePatternBody>(*state, "createPattern" ); |
1255 | } |
1256 | |
1257 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionClosePathBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1258 | { |
1259 | UNUSED_PARAM(state); |
1260 | UNUSED_PARAM(throwScope); |
1261 | auto& impl = castedThis->wrapped(); |
1262 | impl.closePath(); |
1263 | return JSValue::encode(jsUndefined()); |
1264 | } |
1265 | |
1266 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionClosePath(ExecState* state) |
1267 | { |
1268 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionClosePathBody>(*state, "closePath" ); |
1269 | } |
1270 | |
1271 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionMoveToBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1272 | { |
1273 | UNUSED_PARAM(state); |
1274 | UNUSED_PARAM(throwScope); |
1275 | auto& impl = castedThis->wrapped(); |
1276 | if (UNLIKELY(state->argumentCount() < 2)) |
1277 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1278 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
1279 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1280 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
1281 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1282 | impl.moveTo(WTFMove(x), WTFMove(y)); |
1283 | return JSValue::encode(jsUndefined()); |
1284 | } |
1285 | |
1286 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionMoveTo(ExecState* state) |
1287 | { |
1288 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionMoveToBody>(*state, "moveTo" ); |
1289 | } |
1290 | |
1291 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionLineToBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1292 | { |
1293 | UNUSED_PARAM(state); |
1294 | UNUSED_PARAM(throwScope); |
1295 | auto& impl = castedThis->wrapped(); |
1296 | if (UNLIKELY(state->argumentCount() < 2)) |
1297 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1298 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
1299 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1300 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
1301 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1302 | impl.lineTo(WTFMove(x), WTFMove(y)); |
1303 | return JSValue::encode(jsUndefined()); |
1304 | } |
1305 | |
1306 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionLineTo(ExecState* state) |
1307 | { |
1308 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionLineToBody>(*state, "lineTo" ); |
1309 | } |
1310 | |
1311 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionQuadraticCurveToBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1312 | { |
1313 | UNUSED_PARAM(state); |
1314 | UNUSED_PARAM(throwScope); |
1315 | auto& impl = castedThis->wrapped(); |
1316 | if (UNLIKELY(state->argumentCount() < 4)) |
1317 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1318 | auto cpx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
1319 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1320 | auto cpy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
1321 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1322 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
1323 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1324 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
1325 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1326 | impl.quadraticCurveTo(WTFMove(cpx), WTFMove(cpy), WTFMove(x), WTFMove(y)); |
1327 | return JSValue::encode(jsUndefined()); |
1328 | } |
1329 | |
1330 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionQuadraticCurveTo(ExecState* state) |
1331 | { |
1332 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionQuadraticCurveToBody>(*state, "quadraticCurveTo" ); |
1333 | } |
1334 | |
1335 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionBezierCurveToBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1336 | { |
1337 | UNUSED_PARAM(state); |
1338 | UNUSED_PARAM(throwScope); |
1339 | auto& impl = castedThis->wrapped(); |
1340 | if (UNLIKELY(state->argumentCount() < 6)) |
1341 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1342 | auto cp1x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
1343 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1344 | auto cp1y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
1345 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1346 | auto cp2x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
1347 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1348 | auto cp2y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
1349 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1350 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
1351 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1352 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(5)); |
1353 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1354 | impl.bezierCurveTo(WTFMove(cp1x), WTFMove(cp1y), WTFMove(cp2x), WTFMove(cp2y), WTFMove(x), WTFMove(y)); |
1355 | return JSValue::encode(jsUndefined()); |
1356 | } |
1357 | |
1358 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionBezierCurveTo(ExecState* state) |
1359 | { |
1360 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionBezierCurveToBody>(*state, "bezierCurveTo" ); |
1361 | } |
1362 | |
1363 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionArcToBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1364 | { |
1365 | UNUSED_PARAM(state); |
1366 | UNUSED_PARAM(throwScope); |
1367 | auto& impl = castedThis->wrapped(); |
1368 | if (UNLIKELY(state->argumentCount() < 5)) |
1369 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1370 | auto x1 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
1371 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1372 | auto y1 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
1373 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1374 | auto x2 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
1375 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1376 | auto y2 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
1377 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1378 | auto radius = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
1379 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1380 | propagateException(*state, throwScope, impl.arcTo(WTFMove(x1), WTFMove(y1), WTFMove(x2), WTFMove(y2), WTFMove(radius))); |
1381 | return JSValue::encode(jsUndefined()); |
1382 | } |
1383 | |
1384 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionArcTo(ExecState* state) |
1385 | { |
1386 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionArcToBody>(*state, "arcTo" ); |
1387 | } |
1388 | |
1389 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionRectBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1390 | { |
1391 | UNUSED_PARAM(state); |
1392 | UNUSED_PARAM(throwScope); |
1393 | auto& impl = castedThis->wrapped(); |
1394 | if (UNLIKELY(state->argumentCount() < 4)) |
1395 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1396 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
1397 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1398 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
1399 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1400 | auto w = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
1401 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1402 | auto h = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
1403 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1404 | impl.rect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
1405 | return JSValue::encode(jsUndefined()); |
1406 | } |
1407 | |
1408 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionRect(ExecState* state) |
1409 | { |
1410 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionRectBody>(*state, "rect" ); |
1411 | } |
1412 | |
1413 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionArcBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1414 | { |
1415 | UNUSED_PARAM(state); |
1416 | UNUSED_PARAM(throwScope); |
1417 | auto& impl = castedThis->wrapped(); |
1418 | if (UNLIKELY(state->argumentCount() < 5)) |
1419 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1420 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
1421 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1422 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
1423 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1424 | auto radius = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
1425 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1426 | auto startAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
1427 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1428 | auto endAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
1429 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1430 | auto anticlockwise = convert<IDLBoolean>(*state, state->argument(5)); |
1431 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1432 | propagateException(*state, throwScope, impl.arc(WTFMove(x), WTFMove(y), WTFMove(radius), WTFMove(startAngle), WTFMove(endAngle), WTFMove(anticlockwise))); |
1433 | return JSValue::encode(jsUndefined()); |
1434 | } |
1435 | |
1436 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionArc(ExecState* state) |
1437 | { |
1438 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionArcBody>(*state, "arc" ); |
1439 | } |
1440 | |
1441 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionEllipseBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1442 | { |
1443 | UNUSED_PARAM(state); |
1444 | UNUSED_PARAM(throwScope); |
1445 | auto& impl = castedThis->wrapped(); |
1446 | if (UNLIKELY(state->argumentCount() < 7)) |
1447 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1448 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
1449 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1450 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
1451 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1452 | auto radiusX = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
1453 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1454 | auto radiusY = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
1455 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1456 | auto rotation = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
1457 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1458 | auto startAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(5)); |
1459 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1460 | auto endAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(6)); |
1461 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1462 | auto anticlockwise = convert<IDLBoolean>(*state, state->argument(7)); |
1463 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1464 | propagateException(*state, throwScope, impl.ellipse(WTFMove(x), WTFMove(y), WTFMove(radiusX), WTFMove(radiusY), WTFMove(rotation), WTFMove(startAngle), WTFMove(endAngle), WTFMove(anticlockwise))); |
1465 | return JSValue::encode(jsUndefined()); |
1466 | } |
1467 | |
1468 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionEllipse(ExecState* state) |
1469 | { |
1470 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionEllipseBody>(*state, "ellipse" ); |
1471 | } |
1472 | |
1473 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionSetLineDashBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1474 | { |
1475 | UNUSED_PARAM(state); |
1476 | UNUSED_PARAM(throwScope); |
1477 | auto& impl = castedThis->wrapped(); |
1478 | if (UNLIKELY(state->argumentCount() < 1)) |
1479 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1480 | auto segments = convert<IDLSequence<IDLUnrestrictedFloat>>(*state, state->uncheckedArgument(0)); |
1481 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1482 | impl.setLineDash(WTFMove(segments)); |
1483 | return JSValue::encode(jsUndefined()); |
1484 | } |
1485 | |
1486 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionSetLineDash(ExecState* state) |
1487 | { |
1488 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionSetLineDashBody>(*state, "setLineDash" ); |
1489 | } |
1490 | |
1491 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionGetLineDashBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1492 | { |
1493 | UNUSED_PARAM(state); |
1494 | UNUSED_PARAM(throwScope); |
1495 | auto& impl = castedThis->wrapped(); |
1496 | return JSValue::encode(toJS<IDLSequence<IDLUnrestrictedFloat>>(*state, *castedThis->globalObject(), impl.getLineDash())); |
1497 | } |
1498 | |
1499 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionGetLineDash(ExecState* state) |
1500 | { |
1501 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionGetLineDashBody>(*state, "getLineDash" ); |
1502 | } |
1503 | |
1504 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionClearRectBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1505 | { |
1506 | UNUSED_PARAM(state); |
1507 | UNUSED_PARAM(throwScope); |
1508 | auto& impl = castedThis->wrapped(); |
1509 | if (UNLIKELY(state->argumentCount() < 4)) |
1510 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1511 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1512 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1513 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1514 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1515 | auto w = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1516 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1517 | auto h = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1518 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1519 | impl.clearRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
1520 | return JSValue::encode(jsUndefined()); |
1521 | } |
1522 | |
1523 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionClearRect(ExecState* state) |
1524 | { |
1525 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionClearRectBody>(*state, "clearRect" ); |
1526 | } |
1527 | |
1528 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionFillRectBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1529 | { |
1530 | UNUSED_PARAM(state); |
1531 | UNUSED_PARAM(throwScope); |
1532 | auto& impl = castedThis->wrapped(); |
1533 | if (UNLIKELY(state->argumentCount() < 4)) |
1534 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1535 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1536 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1537 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1538 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1539 | auto w = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1540 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1541 | auto h = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1542 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1543 | impl.fillRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
1544 | return JSValue::encode(jsUndefined()); |
1545 | } |
1546 | |
1547 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionFillRect(ExecState* state) |
1548 | { |
1549 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionFillRectBody>(*state, "fillRect" ); |
1550 | } |
1551 | |
1552 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionStrokeRectBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1553 | { |
1554 | UNUSED_PARAM(state); |
1555 | UNUSED_PARAM(throwScope); |
1556 | auto& impl = castedThis->wrapped(); |
1557 | if (UNLIKELY(state->argumentCount() < 4)) |
1558 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1559 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1560 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1561 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1562 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1563 | auto w = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1564 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1565 | auto h = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1566 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1567 | impl.strokeRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
1568 | return JSValue::encode(jsUndefined()); |
1569 | } |
1570 | |
1571 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionStrokeRect(ExecState* state) |
1572 | { |
1573 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionStrokeRectBody>(*state, "strokeRect" ); |
1574 | } |
1575 | |
1576 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionSaveBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1577 | { |
1578 | UNUSED_PARAM(state); |
1579 | UNUSED_PARAM(throwScope); |
1580 | auto& impl = castedThis->wrapped(); |
1581 | impl.save(); |
1582 | return JSValue::encode(jsUndefined()); |
1583 | } |
1584 | |
1585 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionSave(ExecState* state) |
1586 | { |
1587 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionSaveBody>(*state, "save" ); |
1588 | } |
1589 | |
1590 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionRestoreBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1591 | { |
1592 | UNUSED_PARAM(state); |
1593 | UNUSED_PARAM(throwScope); |
1594 | auto& impl = castedThis->wrapped(); |
1595 | impl.restore(); |
1596 | return JSValue::encode(jsUndefined()); |
1597 | } |
1598 | |
1599 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionRestore(ExecState* state) |
1600 | { |
1601 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionRestoreBody>(*state, "restore" ); |
1602 | } |
1603 | |
1604 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionScaleBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1605 | { |
1606 | UNUSED_PARAM(state); |
1607 | UNUSED_PARAM(throwScope); |
1608 | auto& impl = castedThis->wrapped(); |
1609 | if (UNLIKELY(state->argumentCount() < 2)) |
1610 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1611 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1612 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1613 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1614 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1615 | impl.scale(WTFMove(x), WTFMove(y)); |
1616 | return JSValue::encode(jsUndefined()); |
1617 | } |
1618 | |
1619 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionScale(ExecState* state) |
1620 | { |
1621 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionScaleBody>(*state, "scale" ); |
1622 | } |
1623 | |
1624 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionRotateBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1625 | { |
1626 | UNUSED_PARAM(state); |
1627 | UNUSED_PARAM(throwScope); |
1628 | auto& impl = castedThis->wrapped(); |
1629 | if (UNLIKELY(state->argumentCount() < 1)) |
1630 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1631 | auto angle = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1632 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1633 | impl.rotate(WTFMove(angle)); |
1634 | return JSValue::encode(jsUndefined()); |
1635 | } |
1636 | |
1637 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionRotate(ExecState* state) |
1638 | { |
1639 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionRotateBody>(*state, "rotate" ); |
1640 | } |
1641 | |
1642 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionTranslateBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1643 | { |
1644 | UNUSED_PARAM(state); |
1645 | UNUSED_PARAM(throwScope); |
1646 | auto& impl = castedThis->wrapped(); |
1647 | if (UNLIKELY(state->argumentCount() < 2)) |
1648 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1649 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1650 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1651 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1652 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1653 | impl.translate(WTFMove(x), WTFMove(y)); |
1654 | return JSValue::encode(jsUndefined()); |
1655 | } |
1656 | |
1657 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionTranslate(ExecState* state) |
1658 | { |
1659 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionTranslateBody>(*state, "translate" ); |
1660 | } |
1661 | |
1662 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionTransformBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1663 | { |
1664 | UNUSED_PARAM(state); |
1665 | UNUSED_PARAM(throwScope); |
1666 | auto& impl = castedThis->wrapped(); |
1667 | if (UNLIKELY(state->argumentCount() < 6)) |
1668 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1669 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1670 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1671 | auto b = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1672 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1673 | auto c = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1674 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1675 | auto d = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1676 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1677 | auto e = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
1678 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1679 | auto f = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(5)); |
1680 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1681 | impl.transform(WTFMove(a), WTFMove(b), WTFMove(c), WTFMove(d), WTFMove(e), WTFMove(f)); |
1682 | return JSValue::encode(jsUndefined()); |
1683 | } |
1684 | |
1685 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionTransform(ExecState* state) |
1686 | { |
1687 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionTransformBody>(*state, "transform" ); |
1688 | } |
1689 | |
1690 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionGetTransformBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1691 | { |
1692 | UNUSED_PARAM(state); |
1693 | UNUSED_PARAM(throwScope); |
1694 | auto& impl = castedThis->wrapped(); |
1695 | return JSValue::encode(toJSNewlyCreated<IDLInterface<DOMMatrix>>(*state, *castedThis->globalObject(), impl.getTransform())); |
1696 | } |
1697 | |
1698 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionGetTransform(ExecState* state) |
1699 | { |
1700 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionGetTransformBody>(*state, "getTransform" ); |
1701 | } |
1702 | |
1703 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionSetTransform1Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1704 | { |
1705 | UNUSED_PARAM(state); |
1706 | UNUSED_PARAM(throwScope); |
1707 | auto& impl = castedThis->wrapped(); |
1708 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1709 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1710 | auto b = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1711 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1712 | auto c = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1713 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1714 | auto d = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1715 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1716 | auto e = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
1717 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1718 | auto f = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(5)); |
1719 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1720 | impl.setTransform(WTFMove(a), WTFMove(b), WTFMove(c), WTFMove(d), WTFMove(e), WTFMove(f)); |
1721 | return JSValue::encode(jsUndefined()); |
1722 | } |
1723 | |
1724 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionSetTransform2Body(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1725 | { |
1726 | UNUSED_PARAM(state); |
1727 | UNUSED_PARAM(throwScope); |
1728 | auto& impl = castedThis->wrapped(); |
1729 | auto transform = convert<IDLDictionary<DOMMatrix2DInit>>(*state, state->argument(0)); |
1730 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1731 | propagateException(*state, throwScope, impl.setTransform(WTFMove(transform))); |
1732 | return JSValue::encode(jsUndefined()); |
1733 | } |
1734 | |
1735 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionSetTransformOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1736 | { |
1737 | UNUSED_PARAM(state); |
1738 | UNUSED_PARAM(throwScope); |
1739 | VM& vm = state->vm(); |
1740 | UNUSED_PARAM(vm); |
1741 | size_t argsCount = std::min<size_t>(6, state->argumentCount()); |
1742 | if (argsCount == 0) { |
1743 | return jsPaintRenderingContext2DPrototypeFunctionSetTransform2Body(state, castedThis, throwScope); |
1744 | } |
1745 | if (argsCount == 1) { |
1746 | return jsPaintRenderingContext2DPrototypeFunctionSetTransform2Body(state, castedThis, throwScope); |
1747 | } |
1748 | if (argsCount == 6) { |
1749 | return jsPaintRenderingContext2DPrototypeFunctionSetTransform1Body(state, castedThis, throwScope); |
1750 | } |
1751 | return throwVMTypeError(state, throwScope); |
1752 | } |
1753 | |
1754 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionSetTransform(ExecState* state) |
1755 | { |
1756 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionSetTransformOverloadDispatcher>(*state, "setTransform" ); |
1757 | } |
1758 | |
1759 | static inline JSC::EncodedJSValue jsPaintRenderingContext2DPrototypeFunctionResetTransformBody(JSC::ExecState* state, typename IDLOperation<JSPaintRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1760 | { |
1761 | UNUSED_PARAM(state); |
1762 | UNUSED_PARAM(throwScope); |
1763 | auto& impl = castedThis->wrapped(); |
1764 | impl.resetTransform(); |
1765 | return JSValue::encode(jsUndefined()); |
1766 | } |
1767 | |
1768 | EncodedJSValue JSC_HOST_CALL jsPaintRenderingContext2DPrototypeFunctionResetTransform(ExecState* state) |
1769 | { |
1770 | return IDLOperation<JSPaintRenderingContext2D>::call<jsPaintRenderingContext2DPrototypeFunctionResetTransformBody>(*state, "resetTransform" ); |
1771 | } |
1772 | |
1773 | void JSPaintRenderingContext2D::visitChildren(JSCell* cell, SlotVisitor& visitor) |
1774 | { |
1775 | auto* thisObject = jsCast<JSPaintRenderingContext2D*>(cell); |
1776 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
1777 | Base::visitChildren(thisObject, visitor); |
1778 | thisObject->visitAdditionalChildren(visitor); |
1779 | } |
1780 | |
1781 | void JSPaintRenderingContext2D::visitOutputConstraints(JSCell* cell, SlotVisitor& visitor) |
1782 | { |
1783 | auto* thisObject = jsCast<JSPaintRenderingContext2D*>(cell); |
1784 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
1785 | Base::visitOutputConstraints(thisObject, visitor); |
1786 | thisObject->visitAdditionalChildren(visitor); |
1787 | } |
1788 | |
1789 | void JSPaintRenderingContext2D::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
1790 | { |
1791 | auto* thisObject = jsCast<JSPaintRenderingContext2D*>(cell); |
1792 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
1793 | if (thisObject->scriptExecutionContext()) |
1794 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
1795 | Base::heapSnapshot(cell, builder); |
1796 | } |
1797 | |
1798 | void JSPaintRenderingContext2DOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
1799 | { |
1800 | auto* jsPaintRenderingContext2D = static_cast<JSPaintRenderingContext2D*>(handle.slot()->asCell()); |
1801 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
1802 | uncacheWrapper(world, &jsPaintRenderingContext2D->wrapped(), jsPaintRenderingContext2D); |
1803 | } |
1804 | |
1805 | #if ENABLE(BINDING_INTEGRITY) |
1806 | #if PLATFORM(WIN) |
1807 | #pragma warning(disable: 4483) |
1808 | extern "C" { extern void (*const __identifier("??_7PaintRenderingContext2D@WebCore@@6B@" )[])(); } |
1809 | #else |
1810 | extern "C" { extern void* _ZTVN7WebCore23PaintRenderingContext2DE[]; } |
1811 | #endif |
1812 | #endif |
1813 | |
1814 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<PaintRenderingContext2D>&& impl) |
1815 | { |
1816 | |
1817 | #if ENABLE(BINDING_INTEGRITY) |
1818 | void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr())); |
1819 | #if PLATFORM(WIN) |
1820 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7PaintRenderingContext2D@WebCore@@6B@" )); |
1821 | #else |
1822 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore23PaintRenderingContext2DE[2]); |
1823 | #endif |
1824 | |
1825 | // If this fails PaintRenderingContext2D does not have a vtable, so you need to add the |
1826 | // ImplementationLacksVTable attribute to the interface definition |
1827 | static_assert(std::is_polymorphic<PaintRenderingContext2D>::value, "PaintRenderingContext2D is not polymorphic" ); |
1828 | |
1829 | // If you hit this assertion you either have a use after free bug, or |
1830 | // PaintRenderingContext2D has subclasses. If PaintRenderingContext2D has subclasses that get passed |
1831 | // to toJS() we currently require PaintRenderingContext2D you to opt out of binding hardening |
1832 | // by adding the SkipVTableValidation attribute to the interface IDL definition |
1833 | RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
1834 | #endif |
1835 | return createWrapper<PaintRenderingContext2D>(globalObject, WTFMove(impl)); |
1836 | } |
1837 | |
1838 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, PaintRenderingContext2D& impl) |
1839 | { |
1840 | return wrap(state, globalObject, impl); |
1841 | } |
1842 | |
1843 | PaintRenderingContext2D* JSPaintRenderingContext2D::toWrapped(JSC::VM& vm, JSC::JSValue value) |
1844 | { |
1845 | if (auto* wrapper = jsDynamicCast<JSPaintRenderingContext2D*>(vm, value)) |
1846 | return &wrapper->wrapped(); |
1847 | return nullptr; |
1848 | } |
1849 | |
1850 | } |
1851 | |
1852 | #endif // ENABLE(CSS_PAINTING_API) |
1853 | |