| 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 | #include "JSOffscreenCanvasRenderingContext2D.h" |
| 23 | |
| 24 | #include "JSCanvasFillRule.h" |
| 25 | #include "JSCanvasGradient.h" |
| 26 | #include "JSCanvasLineCap.h" |
| 27 | #include "JSCanvasLineJoin.h" |
| 28 | #include "JSCanvasPattern.h" |
| 29 | #include "JSDOMAttribute.h" |
| 30 | #include "JSDOMBinding.h" |
| 31 | #include "JSDOMConstructorNotConstructable.h" |
| 32 | #include "JSDOMConvertBoolean.h" |
| 33 | #include "JSDOMConvertDictionary.h" |
| 34 | #include "JSDOMConvertEnumeration.h" |
| 35 | #include "JSDOMConvertInterface.h" |
| 36 | #include "JSDOMConvertNullable.h" |
| 37 | #include "JSDOMConvertNumbers.h" |
| 38 | #include "JSDOMConvertSequences.h" |
| 39 | #include "JSDOMConvertStrings.h" |
| 40 | #include "JSDOMConvertUnion.h" |
| 41 | #include "JSDOMExceptionHandling.h" |
| 42 | #include "JSDOMGlobalObject.h" |
| 43 | #include "JSDOMMatrix.h" |
| 44 | #include "JSDOMMatrix2DInit.h" |
| 45 | #include "JSDOMOperation.h" |
| 46 | #include "JSDOMWrapperCache.h" |
| 47 | #include "JSHTMLCanvasElement.h" |
| 48 | #include "JSHTMLImageElement.h" |
| 49 | #include "JSHTMLVideoElement.h" |
| 50 | #include "JSImageBitmap.h" |
| 51 | #include "JSImageData.h" |
| 52 | #include "JSImageSmoothingQuality.h" |
| 53 | #include "JSOffscreenCanvas.h" |
| 54 | #include "JSPath2D.h" |
| 55 | #include "RuntimeEnabledFeatures.h" |
| 56 | #include "ScriptExecutionContext.h" |
| 57 | #include <JavaScriptCore/FunctionPrototype.h> |
| 58 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
| 59 | #include <JavaScriptCore/JSArray.h> |
| 60 | #include <JavaScriptCore/JSCInlines.h> |
| 61 | #include <wtf/GetPtr.h> |
| 62 | #include <wtf/PointerPreparations.h> |
| 63 | #include <wtf/URL.h> |
| 64 | #include <wtf/Variant.h> |
| 65 | |
| 66 | |
| 67 | namespace WebCore { |
| 68 | using namespace JSC; |
| 69 | |
| 70 | // Functions |
| 71 | |
| 72 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImage(JSC::ExecState*); |
| 73 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionBeginPath(JSC::ExecState*); |
| 74 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill(JSC::ExecState*); |
| 75 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionStroke(JSC::ExecState*); |
| 76 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip(JSC::ExecState*); |
| 77 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath(JSC::ExecState*); |
| 78 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInStroke(JSC::ExecState*); |
| 79 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateLinearGradient(JSC::ExecState*); |
| 80 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateRadialGradient(JSC::ExecState*); |
| 81 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreatePattern(JSC::ExecState*); |
| 82 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateImageData(JSC::ExecState*); |
| 83 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetImageData(JSC::ExecState*); |
| 84 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionPutImageData(JSC::ExecState*); |
| 85 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionClosePath(JSC::ExecState*); |
| 86 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionMoveTo(JSC::ExecState*); |
| 87 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionLineTo(JSC::ExecState*); |
| 88 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionQuadraticCurveTo(JSC::ExecState*); |
| 89 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionBezierCurveTo(JSC::ExecState*); |
| 90 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionArcTo(JSC::ExecState*); |
| 91 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionRect(JSC::ExecState*); |
| 92 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionArc(JSC::ExecState*); |
| 93 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionEllipse(JSC::ExecState*); |
| 94 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetLineDash(JSC::ExecState*); |
| 95 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetLineDash(JSC::ExecState*); |
| 96 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionClearRect(JSC::ExecState*); |
| 97 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionFillRect(JSC::ExecState*); |
| 98 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionStrokeRect(JSC::ExecState*); |
| 99 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionSave(JSC::ExecState*); |
| 100 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionRestore(JSC::ExecState*); |
| 101 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionScale(JSC::ExecState*); |
| 102 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionRotate(JSC::ExecState*); |
| 103 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionTranslate(JSC::ExecState*); |
| 104 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionTransform(JSC::ExecState*); |
| 105 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetTransform(JSC::ExecState*); |
| 106 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransform(JSC::ExecState*); |
| 107 | JSC::EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionResetTransform(JSC::ExecState*); |
| 108 | |
| 109 | // Attributes |
| 110 | |
| 111 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 112 | bool setJSOffscreenCanvasRenderingContext2DConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 113 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DCanvas(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 114 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DGlobalAlpha(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 115 | bool setJSOffscreenCanvasRenderingContext2DGlobalAlpha(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 116 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DGlobalCompositeOperation(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 117 | bool setJSOffscreenCanvasRenderingContext2DGlobalCompositeOperation(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 118 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DStrokeStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 119 | bool setJSOffscreenCanvasRenderingContext2DStrokeStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 120 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DFillStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 121 | bool setJSOffscreenCanvasRenderingContext2DFillStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 122 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DImageSmoothingEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 123 | bool setJSOffscreenCanvasRenderingContext2DImageSmoothingEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 124 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DImageSmoothingQuality(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 125 | bool setJSOffscreenCanvasRenderingContext2DImageSmoothingQuality(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 126 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DCurrentX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 127 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DCurrentY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 128 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DLineWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 129 | bool setJSOffscreenCanvasRenderingContext2DLineWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 130 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DLineCap(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 131 | bool setJSOffscreenCanvasRenderingContext2DLineCap(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 132 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DLineJoin(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 133 | bool setJSOffscreenCanvasRenderingContext2DLineJoin(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 134 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DMiterLimit(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 135 | bool setJSOffscreenCanvasRenderingContext2DMiterLimit(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 136 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DLineDashOffset(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 137 | bool setJSOffscreenCanvasRenderingContext2DLineDashOffset(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 138 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DShadowOffsetX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 139 | bool setJSOffscreenCanvasRenderingContext2DShadowOffsetX(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 140 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DShadowOffsetY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 141 | bool setJSOffscreenCanvasRenderingContext2DShadowOffsetY(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 142 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DShadowBlur(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 143 | bool setJSOffscreenCanvasRenderingContext2DShadowBlur(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 144 | JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DShadowColor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 145 | bool setJSOffscreenCanvasRenderingContext2DShadowColor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 146 | |
| 147 | class JSOffscreenCanvasRenderingContext2DPrototype : public JSC::JSNonFinalObject { |
| 148 | public: |
| 149 | using Base = JSC::JSNonFinalObject; |
| 150 | static JSOffscreenCanvasRenderingContext2DPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| 151 | { |
| 152 | JSOffscreenCanvasRenderingContext2DPrototype* ptr = new (NotNull, JSC::allocateCell<JSOffscreenCanvasRenderingContext2DPrototype>(vm.heap)) JSOffscreenCanvasRenderingContext2DPrototype(vm, globalObject, structure); |
| 153 | ptr->finishCreation(vm); |
| 154 | return ptr; |
| 155 | } |
| 156 | |
| 157 | DECLARE_INFO; |
| 158 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| 159 | { |
| 160 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| 161 | } |
| 162 | |
| 163 | private: |
| 164 | JSOffscreenCanvasRenderingContext2DPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| 165 | : JSC::JSNonFinalObject(vm, structure) |
| 166 | { |
| 167 | } |
| 168 | |
| 169 | void finishCreation(JSC::VM&); |
| 170 | }; |
| 171 | |
| 172 | using JSOffscreenCanvasRenderingContext2DConstructor = JSDOMConstructorNotConstructable<JSOffscreenCanvasRenderingContext2D>; |
| 173 | |
| 174 | template<> JSValue JSOffscreenCanvasRenderingContext2DConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| 175 | { |
| 176 | UNUSED_PARAM(vm); |
| 177 | return globalObject.functionPrototype(); |
| 178 | } |
| 179 | |
| 180 | template<> void JSOffscreenCanvasRenderingContext2DConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| 181 | { |
| 182 | putDirect(vm, vm.propertyNames->prototype, JSOffscreenCanvasRenderingContext2D::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 183 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("OffscreenCanvasRenderingContext2D"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 184 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 185 | } |
| 186 | |
| 187 | template<> const ClassInfo JSOffscreenCanvasRenderingContext2DConstructor::s_info = { "OffscreenCanvasRenderingContext2D" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSOffscreenCanvasRenderingContext2DConstructor) }; |
| 188 | |
| 189 | /* Hash table for prototype */ |
| 190 | |
| 191 | static const HashTableValue JSOffscreenCanvasRenderingContext2DPrototypeTableValues[] = |
| 192 | { |
| 193 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DConstructor) } }, |
| 194 | { "canvas" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DCanvas), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 195 | { "globalAlpha" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DGlobalAlpha), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DGlobalAlpha) } }, |
| 196 | { "globalCompositeOperation" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DGlobalCompositeOperation), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DGlobalCompositeOperation) } }, |
| 197 | { "strokeStyle" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DStrokeStyle), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DStrokeStyle) } }, |
| 198 | { "fillStyle" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DFillStyle), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DFillStyle) } }, |
| 199 | { "imageSmoothingEnabled" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DImageSmoothingEnabled), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DImageSmoothingEnabled) } }, |
| 200 | { "imageSmoothingQuality" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DImageSmoothingQuality), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DImageSmoothingQuality) } }, |
| 201 | { "currentX" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DCurrentX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 202 | { "currentY" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DCurrentY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 203 | { "lineWidth" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DLineWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DLineWidth) } }, |
| 204 | { "lineCap" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DLineCap), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DLineCap) } }, |
| 205 | { "lineJoin" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DLineJoin), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DLineJoin) } }, |
| 206 | { "miterLimit" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DMiterLimit), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DMiterLimit) } }, |
| 207 | { "lineDashOffset" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DLineDashOffset), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DLineDashOffset) } }, |
| 208 | { "shadowOffsetX" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DShadowOffsetX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DShadowOffsetX) } }, |
| 209 | { "shadowOffsetY" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DShadowOffsetY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DShadowOffsetY) } }, |
| 210 | { "shadowBlur" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DShadowBlur), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DShadowBlur) } }, |
| 211 | { "shadowColor" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOffscreenCanvasRenderingContext2DShadowColor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSOffscreenCanvasRenderingContext2DShadowColor) } }, |
| 212 | { "drawImage" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImage), (intptr_t) (3) } }, |
| 213 | { "beginPath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionBeginPath), (intptr_t) (0) } }, |
| 214 | { "fill" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill), (intptr_t) (0) } }, |
| 215 | { "stroke" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionStroke), (intptr_t) (0) } }, |
| 216 | { "clip" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip), (intptr_t) (0) } }, |
| 217 | { "isPointInPath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath), (intptr_t) (2) } }, |
| 218 | { "isPointInStroke" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInStroke), (intptr_t) (2) } }, |
| 219 | { "createLinearGradient" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateLinearGradient), (intptr_t) (4) } }, |
| 220 | { "createRadialGradient" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateRadialGradient), (intptr_t) (6) } }, |
| 221 | { "createPattern" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreatePattern), (intptr_t) (2) } }, |
| 222 | { "createImageData" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateImageData), (intptr_t) (1) } }, |
| 223 | { "getImageData" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetImageData), (intptr_t) (4) } }, |
| 224 | { "putImageData" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionPutImageData), (intptr_t) (3) } }, |
| 225 | { "closePath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionClosePath), (intptr_t) (0) } }, |
| 226 | { "moveTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionMoveTo), (intptr_t) (2) } }, |
| 227 | { "lineTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionLineTo), (intptr_t) (2) } }, |
| 228 | { "quadraticCurveTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionQuadraticCurveTo), (intptr_t) (4) } }, |
| 229 | { "bezierCurveTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionBezierCurveTo), (intptr_t) (6) } }, |
| 230 | { "arcTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionArcTo), (intptr_t) (5) } }, |
| 231 | { "rect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionRect), (intptr_t) (4) } }, |
| 232 | { "arc" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionArc), (intptr_t) (5) } }, |
| 233 | { "ellipse" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionEllipse), (intptr_t) (7) } }, |
| 234 | { "setLineDash" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetLineDash), (intptr_t) (1) } }, |
| 235 | { "getLineDash" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetLineDash), (intptr_t) (0) } }, |
| 236 | { "clearRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionClearRect), (intptr_t) (4) } }, |
| 237 | { "fillRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionFillRect), (intptr_t) (4) } }, |
| 238 | { "strokeRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionStrokeRect), (intptr_t) (4) } }, |
| 239 | { "save" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionSave), (intptr_t) (0) } }, |
| 240 | { "restore" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionRestore), (intptr_t) (0) } }, |
| 241 | { "scale" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionScale), (intptr_t) (2) } }, |
| 242 | { "rotate" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionRotate), (intptr_t) (1) } }, |
| 243 | { "translate" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionTranslate), (intptr_t) (2) } }, |
| 244 | { "transform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionTransform), (intptr_t) (6) } }, |
| 245 | { "getTransform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetTransform), (intptr_t) (0) } }, |
| 246 | { "setTransform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransform), (intptr_t) (0) } }, |
| 247 | { "resetTransform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsOffscreenCanvasRenderingContext2DPrototypeFunctionResetTransform), (intptr_t) (0) } }, |
| 248 | }; |
| 249 | |
| 250 | const ClassInfo JSOffscreenCanvasRenderingContext2DPrototype::s_info = { "OffscreenCanvasRenderingContext2DPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSOffscreenCanvasRenderingContext2DPrototype) }; |
| 251 | |
| 252 | void JSOffscreenCanvasRenderingContext2DPrototype::finishCreation(VM& vm) |
| 253 | { |
| 254 | Base::finishCreation(vm); |
| 255 | reifyStaticProperties(vm, JSOffscreenCanvasRenderingContext2D::info(), JSOffscreenCanvasRenderingContext2DPrototypeTableValues, *this); |
| 256 | bool hasDisabledRuntimeProperties = false; |
| 257 | if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { |
| 258 | hasDisabledRuntimeProperties = true; |
| 259 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("currentX" ), strlen("currentX" )); |
| 260 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
| 261 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
| 262 | } |
| 263 | if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { |
| 264 | hasDisabledRuntimeProperties = true; |
| 265 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("currentY" ), strlen("currentY" )); |
| 266 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
| 267 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
| 268 | } |
| 269 | if (hasDisabledRuntimeProperties && structure()->isDictionary()) |
| 270 | flattenDictionaryObject(vm); |
| 271 | } |
| 272 | |
| 273 | const ClassInfo JSOffscreenCanvasRenderingContext2D::s_info = { "OffscreenCanvasRenderingContext2D" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSOffscreenCanvasRenderingContext2D) }; |
| 274 | |
| 275 | JSOffscreenCanvasRenderingContext2D::JSOffscreenCanvasRenderingContext2D(Structure* structure, JSDOMGlobalObject& globalObject, Ref<OffscreenCanvasRenderingContext2D>&& impl) |
| 276 | : JSDOMWrapper<OffscreenCanvasRenderingContext2D>(structure, globalObject, WTFMove(impl)) |
| 277 | { |
| 278 | } |
| 279 | |
| 280 | void JSOffscreenCanvasRenderingContext2D::finishCreation(VM& vm) |
| 281 | { |
| 282 | Base::finishCreation(vm); |
| 283 | ASSERT(inherits(vm, info())); |
| 284 | |
| 285 | } |
| 286 | |
| 287 | JSObject* JSOffscreenCanvasRenderingContext2D::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 288 | { |
| 289 | return JSOffscreenCanvasRenderingContext2DPrototype::create(vm, &globalObject, JSOffscreenCanvasRenderingContext2DPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
| 290 | } |
| 291 | |
| 292 | JSObject* JSOffscreenCanvasRenderingContext2D::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 293 | { |
| 294 | return getDOMPrototype<JSOffscreenCanvasRenderingContext2D>(vm, globalObject); |
| 295 | } |
| 296 | |
| 297 | JSValue JSOffscreenCanvasRenderingContext2D::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| 298 | { |
| 299 | return getDOMConstructor<JSOffscreenCanvasRenderingContext2DConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| 300 | } |
| 301 | |
| 302 | void JSOffscreenCanvasRenderingContext2D::destroy(JSC::JSCell* cell) |
| 303 | { |
| 304 | JSOffscreenCanvasRenderingContext2D* thisObject = static_cast<JSOffscreenCanvasRenderingContext2D*>(cell); |
| 305 | thisObject->JSOffscreenCanvasRenderingContext2D::~JSOffscreenCanvasRenderingContext2D(); |
| 306 | } |
| 307 | |
| 308 | template<> inline JSOffscreenCanvasRenderingContext2D* IDLAttribute<JSOffscreenCanvasRenderingContext2D>::cast(ExecState& state, EncodedJSValue thisValue) |
| 309 | { |
| 310 | return jsDynamicCast<JSOffscreenCanvasRenderingContext2D*>(state.vm(), JSValue::decode(thisValue)); |
| 311 | } |
| 312 | |
| 313 | template<> inline JSOffscreenCanvasRenderingContext2D* IDLOperation<JSOffscreenCanvasRenderingContext2D>::cast(ExecState& state) |
| 314 | { |
| 315 | return jsDynamicCast<JSOffscreenCanvasRenderingContext2D*>(state.vm(), state.thisValue()); |
| 316 | } |
| 317 | |
| 318 | EncodedJSValue jsOffscreenCanvasRenderingContext2DConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 319 | { |
| 320 | VM& vm = state->vm(); |
| 321 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 322 | auto* prototype = jsDynamicCast<JSOffscreenCanvasRenderingContext2DPrototype*>(vm, JSValue::decode(thisValue)); |
| 323 | if (UNLIKELY(!prototype)) |
| 324 | return throwVMTypeError(state, throwScope); |
| 325 | return JSValue::encode(JSOffscreenCanvasRenderingContext2D::getConstructor(state->vm(), prototype->globalObject())); |
| 326 | } |
| 327 | |
| 328 | bool setJSOffscreenCanvasRenderingContext2DConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 329 | { |
| 330 | VM& vm = state->vm(); |
| 331 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 332 | auto* prototype = jsDynamicCast<JSOffscreenCanvasRenderingContext2DPrototype*>(vm, JSValue::decode(thisValue)); |
| 333 | if (UNLIKELY(!prototype)) { |
| 334 | throwVMTypeError(state, throwScope); |
| 335 | return false; |
| 336 | } |
| 337 | // Shadowing a built-in constructor |
| 338 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
| 339 | } |
| 340 | |
| 341 | static inline JSValue jsOffscreenCanvasRenderingContext2DCanvasGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 342 | { |
| 343 | UNUSED_PARAM(throwScope); |
| 344 | UNUSED_PARAM(state); |
| 345 | auto& impl = thisObject.wrapped(); |
| 346 | JSValue result = toJS<IDLInterface<OffscreenCanvas>>(state, *thisObject.globalObject(), throwScope, impl.canvas()); |
| 347 | return result; |
| 348 | } |
| 349 | |
| 350 | EncodedJSValue jsOffscreenCanvasRenderingContext2DCanvas(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 351 | { |
| 352 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DCanvasGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "canvas" ); |
| 353 | } |
| 354 | |
| 355 | static inline JSValue jsOffscreenCanvasRenderingContext2DGlobalAlphaGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 356 | { |
| 357 | UNUSED_PARAM(throwScope); |
| 358 | UNUSED_PARAM(state); |
| 359 | auto& impl = thisObject.wrapped(); |
| 360 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.globalAlpha()); |
| 361 | return result; |
| 362 | } |
| 363 | |
| 364 | EncodedJSValue jsOffscreenCanvasRenderingContext2DGlobalAlpha(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 365 | { |
| 366 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DGlobalAlphaGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "globalAlpha" ); |
| 367 | } |
| 368 | |
| 369 | static inline bool setJSOffscreenCanvasRenderingContext2DGlobalAlphaSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 370 | { |
| 371 | UNUSED_PARAM(throwScope); |
| 372 | auto& impl = thisObject.wrapped(); |
| 373 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
| 374 | RETURN_IF_EXCEPTION(throwScope, false); |
| 375 | AttributeSetter::call(state, throwScope, [&] { |
| 376 | return impl.setGlobalAlpha(WTFMove(nativeValue)); |
| 377 | }); |
| 378 | return true; |
| 379 | } |
| 380 | |
| 381 | bool setJSOffscreenCanvasRenderingContext2DGlobalAlpha(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 382 | { |
| 383 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DGlobalAlphaSetter>(*state, thisValue, encodedValue, "globalAlpha" ); |
| 384 | } |
| 385 | |
| 386 | static inline JSValue jsOffscreenCanvasRenderingContext2DGlobalCompositeOperationGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 387 | { |
| 388 | UNUSED_PARAM(throwScope); |
| 389 | UNUSED_PARAM(state); |
| 390 | auto& impl = thisObject.wrapped(); |
| 391 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.globalCompositeOperation()); |
| 392 | return result; |
| 393 | } |
| 394 | |
| 395 | EncodedJSValue jsOffscreenCanvasRenderingContext2DGlobalCompositeOperation(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 396 | { |
| 397 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DGlobalCompositeOperationGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "globalCompositeOperation" ); |
| 398 | } |
| 399 | |
| 400 | static inline bool setJSOffscreenCanvasRenderingContext2DGlobalCompositeOperationSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 401 | { |
| 402 | UNUSED_PARAM(throwScope); |
| 403 | auto& impl = thisObject.wrapped(); |
| 404 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 405 | RETURN_IF_EXCEPTION(throwScope, false); |
| 406 | AttributeSetter::call(state, throwScope, [&] { |
| 407 | return impl.setGlobalCompositeOperation(WTFMove(nativeValue)); |
| 408 | }); |
| 409 | return true; |
| 410 | } |
| 411 | |
| 412 | bool setJSOffscreenCanvasRenderingContext2DGlobalCompositeOperation(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 413 | { |
| 414 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DGlobalCompositeOperationSetter>(*state, thisValue, encodedValue, "globalCompositeOperation" ); |
| 415 | } |
| 416 | |
| 417 | static inline JSValue jsOffscreenCanvasRenderingContext2DStrokeStyleGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 418 | { |
| 419 | UNUSED_PARAM(throwScope); |
| 420 | UNUSED_PARAM(state); |
| 421 | auto& impl = thisObject.wrapped(); |
| 422 | JSValue result = toJS<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, *thisObject.globalObject(), throwScope, impl.strokeStyle()); |
| 423 | return result; |
| 424 | } |
| 425 | |
| 426 | EncodedJSValue jsOffscreenCanvasRenderingContext2DStrokeStyle(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 427 | { |
| 428 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DStrokeStyleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "strokeStyle" ); |
| 429 | } |
| 430 | |
| 431 | static inline bool setJSOffscreenCanvasRenderingContext2DStrokeStyleSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 432 | { |
| 433 | UNUSED_PARAM(throwScope); |
| 434 | auto& impl = thisObject.wrapped(); |
| 435 | auto nativeValue = convert<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, value); |
| 436 | RETURN_IF_EXCEPTION(throwScope, false); |
| 437 | AttributeSetter::call(state, throwScope, [&] { |
| 438 | return impl.setStrokeStyle(WTFMove(nativeValue)); |
| 439 | }); |
| 440 | return true; |
| 441 | } |
| 442 | |
| 443 | bool setJSOffscreenCanvasRenderingContext2DStrokeStyle(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 444 | { |
| 445 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DStrokeStyleSetter>(*state, thisValue, encodedValue, "strokeStyle" ); |
| 446 | } |
| 447 | |
| 448 | static inline JSValue jsOffscreenCanvasRenderingContext2DFillStyleGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 449 | { |
| 450 | UNUSED_PARAM(throwScope); |
| 451 | UNUSED_PARAM(state); |
| 452 | auto& impl = thisObject.wrapped(); |
| 453 | JSValue result = toJS<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, *thisObject.globalObject(), throwScope, impl.fillStyle()); |
| 454 | return result; |
| 455 | } |
| 456 | |
| 457 | EncodedJSValue jsOffscreenCanvasRenderingContext2DFillStyle(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 458 | { |
| 459 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DFillStyleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "fillStyle" ); |
| 460 | } |
| 461 | |
| 462 | static inline bool setJSOffscreenCanvasRenderingContext2DFillStyleSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 463 | { |
| 464 | UNUSED_PARAM(throwScope); |
| 465 | auto& impl = thisObject.wrapped(); |
| 466 | auto nativeValue = convert<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, value); |
| 467 | RETURN_IF_EXCEPTION(throwScope, false); |
| 468 | AttributeSetter::call(state, throwScope, [&] { |
| 469 | return impl.setFillStyle(WTFMove(nativeValue)); |
| 470 | }); |
| 471 | return true; |
| 472 | } |
| 473 | |
| 474 | bool setJSOffscreenCanvasRenderingContext2DFillStyle(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 475 | { |
| 476 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DFillStyleSetter>(*state, thisValue, encodedValue, "fillStyle" ); |
| 477 | } |
| 478 | |
| 479 | static inline JSValue jsOffscreenCanvasRenderingContext2DImageSmoothingEnabledGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 480 | { |
| 481 | UNUSED_PARAM(throwScope); |
| 482 | UNUSED_PARAM(state); |
| 483 | auto& impl = thisObject.wrapped(); |
| 484 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.imageSmoothingEnabled()); |
| 485 | return result; |
| 486 | } |
| 487 | |
| 488 | EncodedJSValue jsOffscreenCanvasRenderingContext2DImageSmoothingEnabled(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 489 | { |
| 490 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DImageSmoothingEnabledGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "imageSmoothingEnabled" ); |
| 491 | } |
| 492 | |
| 493 | static inline bool setJSOffscreenCanvasRenderingContext2DImageSmoothingEnabledSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 494 | { |
| 495 | UNUSED_PARAM(throwScope); |
| 496 | auto& impl = thisObject.wrapped(); |
| 497 | auto nativeValue = convert<IDLBoolean>(state, value); |
| 498 | RETURN_IF_EXCEPTION(throwScope, false); |
| 499 | AttributeSetter::call(state, throwScope, [&] { |
| 500 | return impl.setImageSmoothingEnabled(WTFMove(nativeValue)); |
| 501 | }); |
| 502 | return true; |
| 503 | } |
| 504 | |
| 505 | bool setJSOffscreenCanvasRenderingContext2DImageSmoothingEnabled(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 506 | { |
| 507 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DImageSmoothingEnabledSetter>(*state, thisValue, encodedValue, "imageSmoothingEnabled" ); |
| 508 | } |
| 509 | |
| 510 | static inline JSValue jsOffscreenCanvasRenderingContext2DImageSmoothingQualityGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 511 | { |
| 512 | UNUSED_PARAM(throwScope); |
| 513 | UNUSED_PARAM(state); |
| 514 | auto& impl = thisObject.wrapped(); |
| 515 | JSValue result = toJS<IDLEnumeration<ImageSmoothingQuality>>(state, throwScope, impl.imageSmoothingQuality()); |
| 516 | return result; |
| 517 | } |
| 518 | |
| 519 | EncodedJSValue jsOffscreenCanvasRenderingContext2DImageSmoothingQuality(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 520 | { |
| 521 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DImageSmoothingQualityGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "imageSmoothingQuality" ); |
| 522 | } |
| 523 | |
| 524 | static inline bool setJSOffscreenCanvasRenderingContext2DImageSmoothingQualitySetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 525 | { |
| 526 | UNUSED_PARAM(throwScope); |
| 527 | auto& impl = thisObject.wrapped(); |
| 528 | auto optionalNativeValue = parseEnumeration<ImageSmoothingQuality>(state, value); |
| 529 | RETURN_IF_EXCEPTION(throwScope, false); |
| 530 | if (UNLIKELY(!optionalNativeValue)) |
| 531 | return false; |
| 532 | auto nativeValue = optionalNativeValue.value(); |
| 533 | AttributeSetter::call(state, throwScope, [&] { |
| 534 | return impl.setImageSmoothingQuality(WTFMove(nativeValue)); |
| 535 | }); |
| 536 | return true; |
| 537 | } |
| 538 | |
| 539 | bool setJSOffscreenCanvasRenderingContext2DImageSmoothingQuality(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 540 | { |
| 541 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DImageSmoothingQualitySetter>(*state, thisValue, encodedValue, "imageSmoothingQuality" ); |
| 542 | } |
| 543 | |
| 544 | static inline JSValue jsOffscreenCanvasRenderingContext2DCurrentXGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 545 | { |
| 546 | UNUSED_PARAM(throwScope); |
| 547 | UNUSED_PARAM(state); |
| 548 | auto& impl = thisObject.wrapped(); |
| 549 | JSValue result = toJS<IDLFloat>(state, throwScope, impl.currentX()); |
| 550 | return result; |
| 551 | } |
| 552 | |
| 553 | EncodedJSValue jsOffscreenCanvasRenderingContext2DCurrentX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 554 | { |
| 555 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DCurrentXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "currentX" ); |
| 556 | } |
| 557 | |
| 558 | static inline JSValue jsOffscreenCanvasRenderingContext2DCurrentYGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 559 | { |
| 560 | UNUSED_PARAM(throwScope); |
| 561 | UNUSED_PARAM(state); |
| 562 | auto& impl = thisObject.wrapped(); |
| 563 | JSValue result = toJS<IDLFloat>(state, throwScope, impl.currentY()); |
| 564 | return result; |
| 565 | } |
| 566 | |
| 567 | EncodedJSValue jsOffscreenCanvasRenderingContext2DCurrentY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 568 | { |
| 569 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DCurrentYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "currentY" ); |
| 570 | } |
| 571 | |
| 572 | static inline JSValue jsOffscreenCanvasRenderingContext2DLineWidthGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 573 | { |
| 574 | UNUSED_PARAM(throwScope); |
| 575 | UNUSED_PARAM(state); |
| 576 | auto& impl = thisObject.wrapped(); |
| 577 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.lineWidth()); |
| 578 | return result; |
| 579 | } |
| 580 | |
| 581 | EncodedJSValue jsOffscreenCanvasRenderingContext2DLineWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 582 | { |
| 583 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DLineWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineWidth" ); |
| 584 | } |
| 585 | |
| 586 | static inline bool setJSOffscreenCanvasRenderingContext2DLineWidthSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 587 | { |
| 588 | UNUSED_PARAM(throwScope); |
| 589 | auto& impl = thisObject.wrapped(); |
| 590 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
| 591 | RETURN_IF_EXCEPTION(throwScope, false); |
| 592 | AttributeSetter::call(state, throwScope, [&] { |
| 593 | return impl.setLineWidth(WTFMove(nativeValue)); |
| 594 | }); |
| 595 | return true; |
| 596 | } |
| 597 | |
| 598 | bool setJSOffscreenCanvasRenderingContext2DLineWidth(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 599 | { |
| 600 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DLineWidthSetter>(*state, thisValue, encodedValue, "lineWidth" ); |
| 601 | } |
| 602 | |
| 603 | static inline JSValue jsOffscreenCanvasRenderingContext2DLineCapGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 604 | { |
| 605 | UNUSED_PARAM(throwScope); |
| 606 | UNUSED_PARAM(state); |
| 607 | auto& impl = thisObject.wrapped(); |
| 608 | JSValue result = toJS<IDLEnumeration<CanvasLineCap>>(state, throwScope, impl.lineCap()); |
| 609 | return result; |
| 610 | } |
| 611 | |
| 612 | EncodedJSValue jsOffscreenCanvasRenderingContext2DLineCap(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 613 | { |
| 614 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DLineCapGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineCap" ); |
| 615 | } |
| 616 | |
| 617 | static inline bool setJSOffscreenCanvasRenderingContext2DLineCapSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 618 | { |
| 619 | UNUSED_PARAM(throwScope); |
| 620 | auto& impl = thisObject.wrapped(); |
| 621 | auto optionalNativeValue = parseEnumeration<CanvasLineCap>(state, value); |
| 622 | RETURN_IF_EXCEPTION(throwScope, false); |
| 623 | if (UNLIKELY(!optionalNativeValue)) |
| 624 | return false; |
| 625 | auto nativeValue = optionalNativeValue.value(); |
| 626 | AttributeSetter::call(state, throwScope, [&] { |
| 627 | return impl.setLineCap(WTFMove(nativeValue)); |
| 628 | }); |
| 629 | return true; |
| 630 | } |
| 631 | |
| 632 | bool setJSOffscreenCanvasRenderingContext2DLineCap(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 633 | { |
| 634 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DLineCapSetter>(*state, thisValue, encodedValue, "lineCap" ); |
| 635 | } |
| 636 | |
| 637 | static inline JSValue jsOffscreenCanvasRenderingContext2DLineJoinGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 638 | { |
| 639 | UNUSED_PARAM(throwScope); |
| 640 | UNUSED_PARAM(state); |
| 641 | auto& impl = thisObject.wrapped(); |
| 642 | JSValue result = toJS<IDLEnumeration<CanvasLineJoin>>(state, throwScope, impl.lineJoin()); |
| 643 | return result; |
| 644 | } |
| 645 | |
| 646 | EncodedJSValue jsOffscreenCanvasRenderingContext2DLineJoin(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 647 | { |
| 648 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DLineJoinGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineJoin" ); |
| 649 | } |
| 650 | |
| 651 | static inline bool setJSOffscreenCanvasRenderingContext2DLineJoinSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 652 | { |
| 653 | UNUSED_PARAM(throwScope); |
| 654 | auto& impl = thisObject.wrapped(); |
| 655 | auto optionalNativeValue = parseEnumeration<CanvasLineJoin>(state, value); |
| 656 | RETURN_IF_EXCEPTION(throwScope, false); |
| 657 | if (UNLIKELY(!optionalNativeValue)) |
| 658 | return false; |
| 659 | auto nativeValue = optionalNativeValue.value(); |
| 660 | AttributeSetter::call(state, throwScope, [&] { |
| 661 | return impl.setLineJoin(WTFMove(nativeValue)); |
| 662 | }); |
| 663 | return true; |
| 664 | } |
| 665 | |
| 666 | bool setJSOffscreenCanvasRenderingContext2DLineJoin(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 667 | { |
| 668 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DLineJoinSetter>(*state, thisValue, encodedValue, "lineJoin" ); |
| 669 | } |
| 670 | |
| 671 | static inline JSValue jsOffscreenCanvasRenderingContext2DMiterLimitGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 672 | { |
| 673 | UNUSED_PARAM(throwScope); |
| 674 | UNUSED_PARAM(state); |
| 675 | auto& impl = thisObject.wrapped(); |
| 676 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.miterLimit()); |
| 677 | return result; |
| 678 | } |
| 679 | |
| 680 | EncodedJSValue jsOffscreenCanvasRenderingContext2DMiterLimit(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 681 | { |
| 682 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DMiterLimitGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "miterLimit" ); |
| 683 | } |
| 684 | |
| 685 | static inline bool setJSOffscreenCanvasRenderingContext2DMiterLimitSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 686 | { |
| 687 | UNUSED_PARAM(throwScope); |
| 688 | auto& impl = thisObject.wrapped(); |
| 689 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
| 690 | RETURN_IF_EXCEPTION(throwScope, false); |
| 691 | AttributeSetter::call(state, throwScope, [&] { |
| 692 | return impl.setMiterLimit(WTFMove(nativeValue)); |
| 693 | }); |
| 694 | return true; |
| 695 | } |
| 696 | |
| 697 | bool setJSOffscreenCanvasRenderingContext2DMiterLimit(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 698 | { |
| 699 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DMiterLimitSetter>(*state, thisValue, encodedValue, "miterLimit" ); |
| 700 | } |
| 701 | |
| 702 | static inline JSValue jsOffscreenCanvasRenderingContext2DLineDashOffsetGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 703 | { |
| 704 | UNUSED_PARAM(throwScope); |
| 705 | UNUSED_PARAM(state); |
| 706 | auto& impl = thisObject.wrapped(); |
| 707 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.lineDashOffset()); |
| 708 | return result; |
| 709 | } |
| 710 | |
| 711 | EncodedJSValue jsOffscreenCanvasRenderingContext2DLineDashOffset(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 712 | { |
| 713 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DLineDashOffsetGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineDashOffset" ); |
| 714 | } |
| 715 | |
| 716 | static inline bool setJSOffscreenCanvasRenderingContext2DLineDashOffsetSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 717 | { |
| 718 | UNUSED_PARAM(throwScope); |
| 719 | auto& impl = thisObject.wrapped(); |
| 720 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
| 721 | RETURN_IF_EXCEPTION(throwScope, false); |
| 722 | AttributeSetter::call(state, throwScope, [&] { |
| 723 | return impl.setLineDashOffset(WTFMove(nativeValue)); |
| 724 | }); |
| 725 | return true; |
| 726 | } |
| 727 | |
| 728 | bool setJSOffscreenCanvasRenderingContext2DLineDashOffset(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 729 | { |
| 730 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DLineDashOffsetSetter>(*state, thisValue, encodedValue, "lineDashOffset" ); |
| 731 | } |
| 732 | |
| 733 | static inline JSValue jsOffscreenCanvasRenderingContext2DShadowOffsetXGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 734 | { |
| 735 | UNUSED_PARAM(throwScope); |
| 736 | UNUSED_PARAM(state); |
| 737 | auto& impl = thisObject.wrapped(); |
| 738 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.shadowOffsetX()); |
| 739 | return result; |
| 740 | } |
| 741 | |
| 742 | EncodedJSValue jsOffscreenCanvasRenderingContext2DShadowOffsetX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 743 | { |
| 744 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DShadowOffsetXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowOffsetX" ); |
| 745 | } |
| 746 | |
| 747 | static inline bool setJSOffscreenCanvasRenderingContext2DShadowOffsetXSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 748 | { |
| 749 | UNUSED_PARAM(throwScope); |
| 750 | auto& impl = thisObject.wrapped(); |
| 751 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
| 752 | RETURN_IF_EXCEPTION(throwScope, false); |
| 753 | AttributeSetter::call(state, throwScope, [&] { |
| 754 | return impl.setShadowOffsetX(WTFMove(nativeValue)); |
| 755 | }); |
| 756 | return true; |
| 757 | } |
| 758 | |
| 759 | bool setJSOffscreenCanvasRenderingContext2DShadowOffsetX(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 760 | { |
| 761 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DShadowOffsetXSetter>(*state, thisValue, encodedValue, "shadowOffsetX" ); |
| 762 | } |
| 763 | |
| 764 | static inline JSValue jsOffscreenCanvasRenderingContext2DShadowOffsetYGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 765 | { |
| 766 | UNUSED_PARAM(throwScope); |
| 767 | UNUSED_PARAM(state); |
| 768 | auto& impl = thisObject.wrapped(); |
| 769 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.shadowOffsetY()); |
| 770 | return result; |
| 771 | } |
| 772 | |
| 773 | EncodedJSValue jsOffscreenCanvasRenderingContext2DShadowOffsetY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 774 | { |
| 775 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DShadowOffsetYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowOffsetY" ); |
| 776 | } |
| 777 | |
| 778 | static inline bool setJSOffscreenCanvasRenderingContext2DShadowOffsetYSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 779 | { |
| 780 | UNUSED_PARAM(throwScope); |
| 781 | auto& impl = thisObject.wrapped(); |
| 782 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
| 783 | RETURN_IF_EXCEPTION(throwScope, false); |
| 784 | AttributeSetter::call(state, throwScope, [&] { |
| 785 | return impl.setShadowOffsetY(WTFMove(nativeValue)); |
| 786 | }); |
| 787 | return true; |
| 788 | } |
| 789 | |
| 790 | bool setJSOffscreenCanvasRenderingContext2DShadowOffsetY(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 791 | { |
| 792 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DShadowOffsetYSetter>(*state, thisValue, encodedValue, "shadowOffsetY" ); |
| 793 | } |
| 794 | |
| 795 | static inline JSValue jsOffscreenCanvasRenderingContext2DShadowBlurGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 796 | { |
| 797 | UNUSED_PARAM(throwScope); |
| 798 | UNUSED_PARAM(state); |
| 799 | auto& impl = thisObject.wrapped(); |
| 800 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.shadowBlur()); |
| 801 | return result; |
| 802 | } |
| 803 | |
| 804 | EncodedJSValue jsOffscreenCanvasRenderingContext2DShadowBlur(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 805 | { |
| 806 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DShadowBlurGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowBlur" ); |
| 807 | } |
| 808 | |
| 809 | static inline bool setJSOffscreenCanvasRenderingContext2DShadowBlurSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 810 | { |
| 811 | UNUSED_PARAM(throwScope); |
| 812 | auto& impl = thisObject.wrapped(); |
| 813 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
| 814 | RETURN_IF_EXCEPTION(throwScope, false); |
| 815 | AttributeSetter::call(state, throwScope, [&] { |
| 816 | return impl.setShadowBlur(WTFMove(nativeValue)); |
| 817 | }); |
| 818 | return true; |
| 819 | } |
| 820 | |
| 821 | bool setJSOffscreenCanvasRenderingContext2DShadowBlur(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 822 | { |
| 823 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DShadowBlurSetter>(*state, thisValue, encodedValue, "shadowBlur" ); |
| 824 | } |
| 825 | |
| 826 | static inline JSValue jsOffscreenCanvasRenderingContext2DShadowColorGetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
| 827 | { |
| 828 | UNUSED_PARAM(throwScope); |
| 829 | UNUSED_PARAM(state); |
| 830 | auto& impl = thisObject.wrapped(); |
| 831 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.shadowColor()); |
| 832 | return result; |
| 833 | } |
| 834 | |
| 835 | EncodedJSValue jsOffscreenCanvasRenderingContext2DShadowColor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 836 | { |
| 837 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::get<jsOffscreenCanvasRenderingContext2DShadowColorGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowColor" ); |
| 838 | } |
| 839 | |
| 840 | static inline bool setJSOffscreenCanvasRenderingContext2DShadowColorSetter(ExecState& state, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
| 841 | { |
| 842 | UNUSED_PARAM(throwScope); |
| 843 | auto& impl = thisObject.wrapped(); |
| 844 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 845 | RETURN_IF_EXCEPTION(throwScope, false); |
| 846 | AttributeSetter::call(state, throwScope, [&] { |
| 847 | return impl.setShadowColor(WTFMove(nativeValue)); |
| 848 | }); |
| 849 | return true; |
| 850 | } |
| 851 | |
| 852 | bool setJSOffscreenCanvasRenderingContext2DShadowColor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 853 | { |
| 854 | return IDLAttribute<JSOffscreenCanvasRenderingContext2D>::set<setJSOffscreenCanvasRenderingContext2DShadowColorSetter>(*state, thisValue, encodedValue, "shadowColor" ); |
| 855 | } |
| 856 | |
| 857 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImage1Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 858 | { |
| 859 | UNUSED_PARAM(state); |
| 860 | UNUSED_PARAM(throwScope); |
| 861 | auto& impl = castedThis->wrapped(); |
| 862 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
| 863 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 864 | auto dx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 865 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 866 | auto dy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
| 867 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 868 | propagateException(*state, throwScope, impl.drawImage(WTFMove(image), WTFMove(dx), WTFMove(dy))); |
| 869 | return JSValue::encode(jsUndefined()); |
| 870 | } |
| 871 | |
| 872 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImage2Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 873 | { |
| 874 | UNUSED_PARAM(state); |
| 875 | UNUSED_PARAM(throwScope); |
| 876 | auto& impl = castedThis->wrapped(); |
| 877 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
| 878 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 879 | auto dx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 880 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 881 | auto dy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
| 882 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 883 | auto dw = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
| 884 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 885 | auto dh = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
| 886 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 887 | propagateException(*state, throwScope, impl.drawImage(WTFMove(image), WTFMove(dx), WTFMove(dy), WTFMove(dw), WTFMove(dh))); |
| 888 | return JSValue::encode(jsUndefined()); |
| 889 | } |
| 890 | |
| 891 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImage3Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 892 | { |
| 893 | UNUSED_PARAM(state); |
| 894 | UNUSED_PARAM(throwScope); |
| 895 | auto& impl = castedThis->wrapped(); |
| 896 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
| 897 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 898 | auto sx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 899 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 900 | auto sy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
| 901 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 902 | auto sw = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
| 903 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 904 | auto sh = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
| 905 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 906 | auto dx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(5)); |
| 907 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 908 | auto dy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(6)); |
| 909 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 910 | auto dw = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(7)); |
| 911 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 912 | auto dh = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(8)); |
| 913 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 914 | propagateException(*state, throwScope, impl.drawImage(WTFMove(image), WTFMove(sx), WTFMove(sy), WTFMove(sw), WTFMove(sh), WTFMove(dx), WTFMove(dy), WTFMove(dw), WTFMove(dh))); |
| 915 | return JSValue::encode(jsUndefined()); |
| 916 | } |
| 917 | |
| 918 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImageOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 919 | { |
| 920 | UNUSED_PARAM(state); |
| 921 | UNUSED_PARAM(throwScope); |
| 922 | VM& vm = state->vm(); |
| 923 | UNUSED_PARAM(vm); |
| 924 | size_t argsCount = std::min<size_t>(9, state->argumentCount()); |
| 925 | if (argsCount == 3) { |
| 926 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImage1Body(state, castedThis, throwScope); |
| 927 | } |
| 928 | if (argsCount == 5) { |
| 929 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImage2Body(state, castedThis, throwScope); |
| 930 | } |
| 931 | if (argsCount == 9) { |
| 932 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImage3Body(state, castedThis, throwScope); |
| 933 | } |
| 934 | return argsCount < 3 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
| 935 | } |
| 936 | |
| 937 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImage(ExecState* state) |
| 938 | { |
| 939 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionDrawImageOverloadDispatcher>(*state, "drawImage" ); |
| 940 | } |
| 941 | |
| 942 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionBeginPathBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 943 | { |
| 944 | UNUSED_PARAM(state); |
| 945 | UNUSED_PARAM(throwScope); |
| 946 | auto& impl = castedThis->wrapped(); |
| 947 | impl.beginPath(); |
| 948 | return JSValue::encode(jsUndefined()); |
| 949 | } |
| 950 | |
| 951 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionBeginPath(ExecState* state) |
| 952 | { |
| 953 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionBeginPathBody>(*state, "beginPath" ); |
| 954 | } |
| 955 | |
| 956 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill1Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 957 | { |
| 958 | UNUSED_PARAM(state); |
| 959 | UNUSED_PARAM(throwScope); |
| 960 | auto& impl = castedThis->wrapped(); |
| 961 | 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" , "OffscreenCanvasRenderingContext2D" , "fill" , expectedEnumerationValues<CanvasFillRule>()); }); |
| 962 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 963 | impl.fill(WTFMove(fillRule)); |
| 964 | return JSValue::encode(jsUndefined()); |
| 965 | } |
| 966 | |
| 967 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill2Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 968 | { |
| 969 | UNUSED_PARAM(state); |
| 970 | UNUSED_PARAM(throwScope); |
| 971 | auto& impl = castedThis->wrapped(); |
| 972 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "OffscreenCanvasRenderingContext2D" , "fill" , "Path2D" ); }); |
| 973 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 974 | 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" , "OffscreenCanvasRenderingContext2D" , "fill" , expectedEnumerationValues<CanvasFillRule>()); }); |
| 975 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 976 | impl.fill(*path, WTFMove(fillRule)); |
| 977 | return JSValue::encode(jsUndefined()); |
| 978 | } |
| 979 | |
| 980 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionFillOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 981 | { |
| 982 | UNUSED_PARAM(state); |
| 983 | UNUSED_PARAM(throwScope); |
| 984 | VM& vm = state->vm(); |
| 985 | UNUSED_PARAM(vm); |
| 986 | size_t argsCount = std::min<size_t>(2, state->argumentCount()); |
| 987 | if (argsCount == 0) { |
| 988 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill1Body(state, castedThis, throwScope); |
| 989 | } |
| 990 | if (argsCount == 1) { |
| 991 | JSValue distinguishingArg = state->uncheckedArgument(0); |
| 992 | if (distinguishingArg.isUndefined()) |
| 993 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill1Body(state, castedThis, throwScope); |
| 994 | if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSPath2D>(vm)) |
| 995 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill2Body(state, castedThis, throwScope); |
| 996 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill1Body(state, castedThis, throwScope); |
| 997 | } |
| 998 | if (argsCount == 2) { |
| 999 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill2Body(state, castedThis, throwScope); |
| 1000 | } |
| 1001 | return throwVMTypeError(state, throwScope); |
| 1002 | } |
| 1003 | |
| 1004 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionFill(ExecState* state) |
| 1005 | { |
| 1006 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionFillOverloadDispatcher>(*state, "fill" ); |
| 1007 | } |
| 1008 | |
| 1009 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionStroke1Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1010 | { |
| 1011 | UNUSED_PARAM(state); |
| 1012 | UNUSED_PARAM(throwScope); |
| 1013 | auto& impl = castedThis->wrapped(); |
| 1014 | impl.stroke(); |
| 1015 | return JSValue::encode(jsUndefined()); |
| 1016 | } |
| 1017 | |
| 1018 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionStroke2Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1019 | { |
| 1020 | UNUSED_PARAM(state); |
| 1021 | UNUSED_PARAM(throwScope); |
| 1022 | auto& impl = castedThis->wrapped(); |
| 1023 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "OffscreenCanvasRenderingContext2D" , "stroke" , "Path2D" ); }); |
| 1024 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1025 | impl.stroke(*path); |
| 1026 | return JSValue::encode(jsUndefined()); |
| 1027 | } |
| 1028 | |
| 1029 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionStrokeOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1030 | { |
| 1031 | UNUSED_PARAM(state); |
| 1032 | UNUSED_PARAM(throwScope); |
| 1033 | VM& vm = state->vm(); |
| 1034 | UNUSED_PARAM(vm); |
| 1035 | size_t argsCount = std::min<size_t>(1, state->argumentCount()); |
| 1036 | if (argsCount == 0) { |
| 1037 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionStroke1Body(state, castedThis, throwScope); |
| 1038 | } |
| 1039 | if (argsCount == 1) { |
| 1040 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionStroke2Body(state, castedThis, throwScope); |
| 1041 | } |
| 1042 | return throwVMTypeError(state, throwScope); |
| 1043 | } |
| 1044 | |
| 1045 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionStroke(ExecState* state) |
| 1046 | { |
| 1047 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionStrokeOverloadDispatcher>(*state, "stroke" ); |
| 1048 | } |
| 1049 | |
| 1050 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip1Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1051 | { |
| 1052 | UNUSED_PARAM(state); |
| 1053 | UNUSED_PARAM(throwScope); |
| 1054 | auto& impl = castedThis->wrapped(); |
| 1055 | 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" , "OffscreenCanvasRenderingContext2D" , "clip" , expectedEnumerationValues<CanvasFillRule>()); }); |
| 1056 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1057 | impl.clip(WTFMove(fillRule)); |
| 1058 | return JSValue::encode(jsUndefined()); |
| 1059 | } |
| 1060 | |
| 1061 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip2Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1062 | { |
| 1063 | UNUSED_PARAM(state); |
| 1064 | UNUSED_PARAM(throwScope); |
| 1065 | auto& impl = castedThis->wrapped(); |
| 1066 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "OffscreenCanvasRenderingContext2D" , "clip" , "Path2D" ); }); |
| 1067 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1068 | 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" , "OffscreenCanvasRenderingContext2D" , "clip" , expectedEnumerationValues<CanvasFillRule>()); }); |
| 1069 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1070 | impl.clip(*path, WTFMove(fillRule)); |
| 1071 | return JSValue::encode(jsUndefined()); |
| 1072 | } |
| 1073 | |
| 1074 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionClipOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1075 | { |
| 1076 | UNUSED_PARAM(state); |
| 1077 | UNUSED_PARAM(throwScope); |
| 1078 | VM& vm = state->vm(); |
| 1079 | UNUSED_PARAM(vm); |
| 1080 | size_t argsCount = std::min<size_t>(2, state->argumentCount()); |
| 1081 | if (argsCount == 0) { |
| 1082 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip1Body(state, castedThis, throwScope); |
| 1083 | } |
| 1084 | if (argsCount == 1) { |
| 1085 | JSValue distinguishingArg = state->uncheckedArgument(0); |
| 1086 | if (distinguishingArg.isUndefined()) |
| 1087 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip1Body(state, castedThis, throwScope); |
| 1088 | if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSPath2D>(vm)) |
| 1089 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip2Body(state, castedThis, throwScope); |
| 1090 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip1Body(state, castedThis, throwScope); |
| 1091 | } |
| 1092 | if (argsCount == 2) { |
| 1093 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip2Body(state, castedThis, throwScope); |
| 1094 | } |
| 1095 | return throwVMTypeError(state, throwScope); |
| 1096 | } |
| 1097 | |
| 1098 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionClip(ExecState* state) |
| 1099 | { |
| 1100 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionClipOverloadDispatcher>(*state, "clip" ); |
| 1101 | } |
| 1102 | |
| 1103 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath1Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1104 | { |
| 1105 | UNUSED_PARAM(state); |
| 1106 | UNUSED_PARAM(throwScope); |
| 1107 | auto& impl = castedThis->wrapped(); |
| 1108 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1109 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1110 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1111 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1112 | 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" , "OffscreenCanvasRenderingContext2D" , "isPointInPath" , expectedEnumerationValues<CanvasFillRule>()); }); |
| 1113 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1114 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInPath(WTFMove(x), WTFMove(y), WTFMove(fillRule)))); |
| 1115 | } |
| 1116 | |
| 1117 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath2Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1118 | { |
| 1119 | UNUSED_PARAM(state); |
| 1120 | UNUSED_PARAM(throwScope); |
| 1121 | auto& impl = castedThis->wrapped(); |
| 1122 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "OffscreenCanvasRenderingContext2D" , "isPointInPath" , "Path2D" ); }); |
| 1123 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1124 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1125 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1126 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
| 1127 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1128 | 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" , "OffscreenCanvasRenderingContext2D" , "isPointInPath" , expectedEnumerationValues<CanvasFillRule>()); }); |
| 1129 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1130 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInPath(*path, WTFMove(x), WTFMove(y), WTFMove(fillRule)))); |
| 1131 | } |
| 1132 | |
| 1133 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPathOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1134 | { |
| 1135 | UNUSED_PARAM(state); |
| 1136 | UNUSED_PARAM(throwScope); |
| 1137 | VM& vm = state->vm(); |
| 1138 | UNUSED_PARAM(vm); |
| 1139 | size_t argsCount = std::min<size_t>(4, state->argumentCount()); |
| 1140 | if (argsCount == 2) { |
| 1141 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath1Body(state, castedThis, throwScope); |
| 1142 | } |
| 1143 | if (argsCount == 3) { |
| 1144 | JSValue distinguishingArg = state->uncheckedArgument(0); |
| 1145 | if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSPath2D>(vm)) |
| 1146 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath2Body(state, castedThis, throwScope); |
| 1147 | if (distinguishingArg.isNumber()) |
| 1148 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath1Body(state, castedThis, throwScope); |
| 1149 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath1Body(state, castedThis, throwScope); |
| 1150 | } |
| 1151 | if (argsCount == 4) { |
| 1152 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath2Body(state, castedThis, throwScope); |
| 1153 | } |
| 1154 | return argsCount < 2 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
| 1155 | } |
| 1156 | |
| 1157 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPath(ExecState* state) |
| 1158 | { |
| 1159 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInPathOverloadDispatcher>(*state, "isPointInPath" ); |
| 1160 | } |
| 1161 | |
| 1162 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInStroke1Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1163 | { |
| 1164 | UNUSED_PARAM(state); |
| 1165 | UNUSED_PARAM(throwScope); |
| 1166 | auto& impl = castedThis->wrapped(); |
| 1167 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1168 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1169 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1170 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1171 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInStroke(WTFMove(x), WTFMove(y)))); |
| 1172 | } |
| 1173 | |
| 1174 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInStroke2Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1175 | { |
| 1176 | UNUSED_PARAM(state); |
| 1177 | UNUSED_PARAM(throwScope); |
| 1178 | auto& impl = castedThis->wrapped(); |
| 1179 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "OffscreenCanvasRenderingContext2D" , "isPointInStroke" , "Path2D" ); }); |
| 1180 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1181 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1182 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1183 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
| 1184 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1185 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInStroke(*path, WTFMove(x), WTFMove(y)))); |
| 1186 | } |
| 1187 | |
| 1188 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInStrokeOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1189 | { |
| 1190 | UNUSED_PARAM(state); |
| 1191 | UNUSED_PARAM(throwScope); |
| 1192 | VM& vm = state->vm(); |
| 1193 | UNUSED_PARAM(vm); |
| 1194 | size_t argsCount = std::min<size_t>(3, state->argumentCount()); |
| 1195 | if (argsCount == 2) { |
| 1196 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInStroke1Body(state, castedThis, throwScope); |
| 1197 | } |
| 1198 | if (argsCount == 3) { |
| 1199 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInStroke2Body(state, castedThis, throwScope); |
| 1200 | } |
| 1201 | return argsCount < 2 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
| 1202 | } |
| 1203 | |
| 1204 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInStroke(ExecState* state) |
| 1205 | { |
| 1206 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionIsPointInStrokeOverloadDispatcher>(*state, "isPointInStroke" ); |
| 1207 | } |
| 1208 | |
| 1209 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateLinearGradientBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1210 | { |
| 1211 | UNUSED_PARAM(state); |
| 1212 | UNUSED_PARAM(throwScope); |
| 1213 | auto& impl = castedThis->wrapped(); |
| 1214 | if (UNLIKELY(state->argumentCount() < 4)) |
| 1215 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1216 | auto x0 = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
| 1217 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1218 | auto y0 = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
| 1219 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1220 | auto x1 = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
| 1221 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1222 | auto y1 = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
| 1223 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1224 | return JSValue::encode(toJS<IDLInterface<CanvasGradient>>(*state, *castedThis->globalObject(), throwScope, impl.createLinearGradient(WTFMove(x0), WTFMove(y0), WTFMove(x1), WTFMove(y1)))); |
| 1225 | } |
| 1226 | |
| 1227 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateLinearGradient(ExecState* state) |
| 1228 | { |
| 1229 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateLinearGradientBody>(*state, "createLinearGradient" ); |
| 1230 | } |
| 1231 | |
| 1232 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateRadialGradientBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1233 | { |
| 1234 | UNUSED_PARAM(state); |
| 1235 | UNUSED_PARAM(throwScope); |
| 1236 | auto& impl = castedThis->wrapped(); |
| 1237 | if (UNLIKELY(state->argumentCount() < 6)) |
| 1238 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1239 | auto x0 = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
| 1240 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1241 | auto y0 = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
| 1242 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1243 | auto r0 = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
| 1244 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1245 | auto x1 = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
| 1246 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1247 | auto y1 = convert<IDLFloat>(*state, state->uncheckedArgument(4)); |
| 1248 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1249 | auto r1 = convert<IDLFloat>(*state, state->uncheckedArgument(5)); |
| 1250 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1251 | return JSValue::encode(toJS<IDLInterface<CanvasGradient>>(*state, *castedThis->globalObject(), throwScope, impl.createRadialGradient(WTFMove(x0), WTFMove(y0), WTFMove(r0), WTFMove(x1), WTFMove(y1), WTFMove(r1)))); |
| 1252 | } |
| 1253 | |
| 1254 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateRadialGradient(ExecState* state) |
| 1255 | { |
| 1256 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateRadialGradientBody>(*state, "createRadialGradient" ); |
| 1257 | } |
| 1258 | |
| 1259 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreatePatternBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1260 | { |
| 1261 | UNUSED_PARAM(state); |
| 1262 | UNUSED_PARAM(throwScope); |
| 1263 | auto& impl = castedThis->wrapped(); |
| 1264 | if (UNLIKELY(state->argumentCount() < 2)) |
| 1265 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1266 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
| 1267 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1268 | auto repetition = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(*state, state->uncheckedArgument(1)); |
| 1269 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1270 | return JSValue::encode(toJS<IDLNullable<IDLInterface<CanvasPattern>>>(*state, *castedThis->globalObject(), throwScope, impl.createPattern(WTFMove(image), WTFMove(repetition)))); |
| 1271 | } |
| 1272 | |
| 1273 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreatePattern(ExecState* state) |
| 1274 | { |
| 1275 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreatePatternBody>(*state, "createPattern" ); |
| 1276 | } |
| 1277 | |
| 1278 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateImageData1Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1279 | { |
| 1280 | UNUSED_PARAM(state); |
| 1281 | UNUSED_PARAM(throwScope); |
| 1282 | auto& impl = castedThis->wrapped(); |
| 1283 | auto sw = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
| 1284 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1285 | auto sh = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
| 1286 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1287 | return JSValue::encode(toJS<IDLInterface<ImageData>>(*state, *castedThis->globalObject(), throwScope, impl.createImageData(WTFMove(sw), WTFMove(sh)))); |
| 1288 | } |
| 1289 | |
| 1290 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateImageData2Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1291 | { |
| 1292 | UNUSED_PARAM(state); |
| 1293 | UNUSED_PARAM(throwScope); |
| 1294 | auto& impl = castedThis->wrapped(); |
| 1295 | auto imagedata = convert<IDLInterface<ImageData>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "imagedata" , "OffscreenCanvasRenderingContext2D" , "createImageData" , "ImageData" ); }); |
| 1296 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1297 | return JSValue::encode(toJS<IDLInterface<ImageData>>(*state, *castedThis->globalObject(), impl.createImageData(*imagedata))); |
| 1298 | } |
| 1299 | |
| 1300 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateImageDataOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1301 | { |
| 1302 | UNUSED_PARAM(state); |
| 1303 | UNUSED_PARAM(throwScope); |
| 1304 | VM& vm = state->vm(); |
| 1305 | UNUSED_PARAM(vm); |
| 1306 | size_t argsCount = std::min<size_t>(2, state->argumentCount()); |
| 1307 | if (argsCount == 1) { |
| 1308 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateImageData2Body(state, castedThis, throwScope); |
| 1309 | } |
| 1310 | if (argsCount == 2) { |
| 1311 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateImageData1Body(state, castedThis, throwScope); |
| 1312 | } |
| 1313 | return argsCount < 1 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
| 1314 | } |
| 1315 | |
| 1316 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateImageData(ExecState* state) |
| 1317 | { |
| 1318 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionCreateImageDataOverloadDispatcher>(*state, "createImageData" ); |
| 1319 | } |
| 1320 | |
| 1321 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetImageDataBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1322 | { |
| 1323 | UNUSED_PARAM(state); |
| 1324 | UNUSED_PARAM(throwScope); |
| 1325 | auto& impl = castedThis->wrapped(); |
| 1326 | if (UNLIKELY(state->argumentCount() < 4)) |
| 1327 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1328 | auto sx = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
| 1329 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1330 | auto sy = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
| 1331 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1332 | auto sw = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
| 1333 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1334 | auto sh = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
| 1335 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1336 | return JSValue::encode(toJS<IDLInterface<ImageData>>(*state, *castedThis->globalObject(), throwScope, impl.getImageData(WTFMove(sx), WTFMove(sy), WTFMove(sw), WTFMove(sh)))); |
| 1337 | } |
| 1338 | |
| 1339 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetImageData(ExecState* state) |
| 1340 | { |
| 1341 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetImageDataBody>(*state, "getImageData" ); |
| 1342 | } |
| 1343 | |
| 1344 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionPutImageData1Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1345 | { |
| 1346 | UNUSED_PARAM(state); |
| 1347 | UNUSED_PARAM(throwScope); |
| 1348 | auto& impl = castedThis->wrapped(); |
| 1349 | auto imagedata = convert<IDLInterface<ImageData>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "imagedata" , "OffscreenCanvasRenderingContext2D" , "putImageData" , "ImageData" ); }); |
| 1350 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1351 | auto dx = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
| 1352 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1353 | auto dy = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
| 1354 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1355 | impl.putImageData(*imagedata, WTFMove(dx), WTFMove(dy)); |
| 1356 | return JSValue::encode(jsUndefined()); |
| 1357 | } |
| 1358 | |
| 1359 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionPutImageData2Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1360 | { |
| 1361 | UNUSED_PARAM(state); |
| 1362 | UNUSED_PARAM(throwScope); |
| 1363 | auto& impl = castedThis->wrapped(); |
| 1364 | auto imagedata = convert<IDLInterface<ImageData>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "imagedata" , "OffscreenCanvasRenderingContext2D" , "putImageData" , "ImageData" ); }); |
| 1365 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1366 | auto dx = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
| 1367 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1368 | auto dy = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
| 1369 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1370 | auto dirtyX = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
| 1371 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1372 | auto dirtyY = convert<IDLFloat>(*state, state->uncheckedArgument(4)); |
| 1373 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1374 | auto dirtyWidth = convert<IDLFloat>(*state, state->uncheckedArgument(5)); |
| 1375 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1376 | auto dirtyHeight = convert<IDLFloat>(*state, state->uncheckedArgument(6)); |
| 1377 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1378 | impl.putImageData(*imagedata, WTFMove(dx), WTFMove(dy), WTFMove(dirtyX), WTFMove(dirtyY), WTFMove(dirtyWidth), WTFMove(dirtyHeight)); |
| 1379 | return JSValue::encode(jsUndefined()); |
| 1380 | } |
| 1381 | |
| 1382 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionPutImageDataOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1383 | { |
| 1384 | UNUSED_PARAM(state); |
| 1385 | UNUSED_PARAM(throwScope); |
| 1386 | VM& vm = state->vm(); |
| 1387 | UNUSED_PARAM(vm); |
| 1388 | size_t argsCount = std::min<size_t>(7, state->argumentCount()); |
| 1389 | if (argsCount == 3) { |
| 1390 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionPutImageData1Body(state, castedThis, throwScope); |
| 1391 | } |
| 1392 | if (argsCount == 7) { |
| 1393 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionPutImageData2Body(state, castedThis, throwScope); |
| 1394 | } |
| 1395 | return argsCount < 3 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
| 1396 | } |
| 1397 | |
| 1398 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionPutImageData(ExecState* state) |
| 1399 | { |
| 1400 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionPutImageDataOverloadDispatcher>(*state, "putImageData" ); |
| 1401 | } |
| 1402 | |
| 1403 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionClosePathBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1404 | { |
| 1405 | UNUSED_PARAM(state); |
| 1406 | UNUSED_PARAM(throwScope); |
| 1407 | auto& impl = castedThis->wrapped(); |
| 1408 | impl.closePath(); |
| 1409 | return JSValue::encode(jsUndefined()); |
| 1410 | } |
| 1411 | |
| 1412 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionClosePath(ExecState* state) |
| 1413 | { |
| 1414 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionClosePathBody>(*state, "closePath" ); |
| 1415 | } |
| 1416 | |
| 1417 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionMoveToBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1418 | { |
| 1419 | UNUSED_PARAM(state); |
| 1420 | UNUSED_PARAM(throwScope); |
| 1421 | auto& impl = castedThis->wrapped(); |
| 1422 | if (UNLIKELY(state->argumentCount() < 2)) |
| 1423 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1424 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
| 1425 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1426 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 1427 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1428 | impl.moveTo(WTFMove(x), WTFMove(y)); |
| 1429 | return JSValue::encode(jsUndefined()); |
| 1430 | } |
| 1431 | |
| 1432 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionMoveTo(ExecState* state) |
| 1433 | { |
| 1434 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionMoveToBody>(*state, "moveTo" ); |
| 1435 | } |
| 1436 | |
| 1437 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionLineToBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1438 | { |
| 1439 | UNUSED_PARAM(state); |
| 1440 | UNUSED_PARAM(throwScope); |
| 1441 | auto& impl = castedThis->wrapped(); |
| 1442 | if (UNLIKELY(state->argumentCount() < 2)) |
| 1443 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1444 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
| 1445 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1446 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 1447 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1448 | impl.lineTo(WTFMove(x), WTFMove(y)); |
| 1449 | return JSValue::encode(jsUndefined()); |
| 1450 | } |
| 1451 | |
| 1452 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionLineTo(ExecState* state) |
| 1453 | { |
| 1454 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionLineToBody>(*state, "lineTo" ); |
| 1455 | } |
| 1456 | |
| 1457 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionQuadraticCurveToBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1458 | { |
| 1459 | UNUSED_PARAM(state); |
| 1460 | UNUSED_PARAM(throwScope); |
| 1461 | auto& impl = castedThis->wrapped(); |
| 1462 | if (UNLIKELY(state->argumentCount() < 4)) |
| 1463 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1464 | auto cpx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
| 1465 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1466 | auto cpy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 1467 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1468 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
| 1469 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1470 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
| 1471 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1472 | impl.quadraticCurveTo(WTFMove(cpx), WTFMove(cpy), WTFMove(x), WTFMove(y)); |
| 1473 | return JSValue::encode(jsUndefined()); |
| 1474 | } |
| 1475 | |
| 1476 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionQuadraticCurveTo(ExecState* state) |
| 1477 | { |
| 1478 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionQuadraticCurveToBody>(*state, "quadraticCurveTo" ); |
| 1479 | } |
| 1480 | |
| 1481 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionBezierCurveToBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1482 | { |
| 1483 | UNUSED_PARAM(state); |
| 1484 | UNUSED_PARAM(throwScope); |
| 1485 | auto& impl = castedThis->wrapped(); |
| 1486 | if (UNLIKELY(state->argumentCount() < 6)) |
| 1487 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1488 | auto cp1x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
| 1489 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1490 | auto cp1y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 1491 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1492 | auto cp2x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
| 1493 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1494 | auto cp2y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
| 1495 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1496 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
| 1497 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1498 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(5)); |
| 1499 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1500 | impl.bezierCurveTo(WTFMove(cp1x), WTFMove(cp1y), WTFMove(cp2x), WTFMove(cp2y), WTFMove(x), WTFMove(y)); |
| 1501 | return JSValue::encode(jsUndefined()); |
| 1502 | } |
| 1503 | |
| 1504 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionBezierCurveTo(ExecState* state) |
| 1505 | { |
| 1506 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionBezierCurveToBody>(*state, "bezierCurveTo" ); |
| 1507 | } |
| 1508 | |
| 1509 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionArcToBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1510 | { |
| 1511 | UNUSED_PARAM(state); |
| 1512 | UNUSED_PARAM(throwScope); |
| 1513 | auto& impl = castedThis->wrapped(); |
| 1514 | if (UNLIKELY(state->argumentCount() < 5)) |
| 1515 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1516 | auto x1 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
| 1517 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1518 | auto y1 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 1519 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1520 | auto x2 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
| 1521 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1522 | auto y2 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
| 1523 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1524 | auto radius = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
| 1525 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1526 | propagateException(*state, throwScope, impl.arcTo(WTFMove(x1), WTFMove(y1), WTFMove(x2), WTFMove(y2), WTFMove(radius))); |
| 1527 | return JSValue::encode(jsUndefined()); |
| 1528 | } |
| 1529 | |
| 1530 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionArcTo(ExecState* state) |
| 1531 | { |
| 1532 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionArcToBody>(*state, "arcTo" ); |
| 1533 | } |
| 1534 | |
| 1535 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionRectBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1536 | { |
| 1537 | UNUSED_PARAM(state); |
| 1538 | UNUSED_PARAM(throwScope); |
| 1539 | auto& impl = castedThis->wrapped(); |
| 1540 | if (UNLIKELY(state->argumentCount() < 4)) |
| 1541 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1542 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
| 1543 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1544 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 1545 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1546 | auto w = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
| 1547 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1548 | auto h = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
| 1549 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1550 | impl.rect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
| 1551 | return JSValue::encode(jsUndefined()); |
| 1552 | } |
| 1553 | |
| 1554 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionRect(ExecState* state) |
| 1555 | { |
| 1556 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionRectBody>(*state, "rect" ); |
| 1557 | } |
| 1558 | |
| 1559 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionArcBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1560 | { |
| 1561 | UNUSED_PARAM(state); |
| 1562 | UNUSED_PARAM(throwScope); |
| 1563 | auto& impl = castedThis->wrapped(); |
| 1564 | if (UNLIKELY(state->argumentCount() < 5)) |
| 1565 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1566 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
| 1567 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1568 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 1569 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1570 | auto radius = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
| 1571 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1572 | auto startAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
| 1573 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1574 | auto endAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
| 1575 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1576 | auto anticlockwise = convert<IDLBoolean>(*state, state->argument(5)); |
| 1577 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1578 | propagateException(*state, throwScope, impl.arc(WTFMove(x), WTFMove(y), WTFMove(radius), WTFMove(startAngle), WTFMove(endAngle), WTFMove(anticlockwise))); |
| 1579 | return JSValue::encode(jsUndefined()); |
| 1580 | } |
| 1581 | |
| 1582 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionArc(ExecState* state) |
| 1583 | { |
| 1584 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionArcBody>(*state, "arc" ); |
| 1585 | } |
| 1586 | |
| 1587 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionEllipseBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1588 | { |
| 1589 | UNUSED_PARAM(state); |
| 1590 | UNUSED_PARAM(throwScope); |
| 1591 | auto& impl = castedThis->wrapped(); |
| 1592 | if (UNLIKELY(state->argumentCount() < 7)) |
| 1593 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1594 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
| 1595 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1596 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
| 1597 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1598 | auto radiusX = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
| 1599 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1600 | auto radiusY = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
| 1601 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1602 | auto rotation = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
| 1603 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1604 | auto startAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(5)); |
| 1605 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1606 | auto endAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(6)); |
| 1607 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1608 | auto anticlockwise = convert<IDLBoolean>(*state, state->argument(7)); |
| 1609 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1610 | propagateException(*state, throwScope, impl.ellipse(WTFMove(x), WTFMove(y), WTFMove(radiusX), WTFMove(radiusY), WTFMove(rotation), WTFMove(startAngle), WTFMove(endAngle), WTFMove(anticlockwise))); |
| 1611 | return JSValue::encode(jsUndefined()); |
| 1612 | } |
| 1613 | |
| 1614 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionEllipse(ExecState* state) |
| 1615 | { |
| 1616 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionEllipseBody>(*state, "ellipse" ); |
| 1617 | } |
| 1618 | |
| 1619 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetLineDashBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1620 | { |
| 1621 | UNUSED_PARAM(state); |
| 1622 | UNUSED_PARAM(throwScope); |
| 1623 | auto& impl = castedThis->wrapped(); |
| 1624 | if (UNLIKELY(state->argumentCount() < 1)) |
| 1625 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1626 | auto segments = convert<IDLSequence<IDLUnrestrictedFloat>>(*state, state->uncheckedArgument(0)); |
| 1627 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1628 | impl.setLineDash(WTFMove(segments)); |
| 1629 | return JSValue::encode(jsUndefined()); |
| 1630 | } |
| 1631 | |
| 1632 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetLineDash(ExecState* state) |
| 1633 | { |
| 1634 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetLineDashBody>(*state, "setLineDash" ); |
| 1635 | } |
| 1636 | |
| 1637 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetLineDashBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1638 | { |
| 1639 | UNUSED_PARAM(state); |
| 1640 | UNUSED_PARAM(throwScope); |
| 1641 | auto& impl = castedThis->wrapped(); |
| 1642 | return JSValue::encode(toJS<IDLSequence<IDLUnrestrictedFloat>>(*state, *castedThis->globalObject(), impl.getLineDash())); |
| 1643 | } |
| 1644 | |
| 1645 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetLineDash(ExecState* state) |
| 1646 | { |
| 1647 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetLineDashBody>(*state, "getLineDash" ); |
| 1648 | } |
| 1649 | |
| 1650 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionClearRectBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1651 | { |
| 1652 | UNUSED_PARAM(state); |
| 1653 | UNUSED_PARAM(throwScope); |
| 1654 | auto& impl = castedThis->wrapped(); |
| 1655 | if (UNLIKELY(state->argumentCount() < 4)) |
| 1656 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1657 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1658 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1659 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1660 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1661 | auto w = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
| 1662 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1663 | auto h = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
| 1664 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1665 | impl.clearRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
| 1666 | return JSValue::encode(jsUndefined()); |
| 1667 | } |
| 1668 | |
| 1669 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionClearRect(ExecState* state) |
| 1670 | { |
| 1671 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionClearRectBody>(*state, "clearRect" ); |
| 1672 | } |
| 1673 | |
| 1674 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionFillRectBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1675 | { |
| 1676 | UNUSED_PARAM(state); |
| 1677 | UNUSED_PARAM(throwScope); |
| 1678 | auto& impl = castedThis->wrapped(); |
| 1679 | if (UNLIKELY(state->argumentCount() < 4)) |
| 1680 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1681 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1682 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1683 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1684 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1685 | auto w = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
| 1686 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1687 | auto h = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
| 1688 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1689 | impl.fillRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
| 1690 | return JSValue::encode(jsUndefined()); |
| 1691 | } |
| 1692 | |
| 1693 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionFillRect(ExecState* state) |
| 1694 | { |
| 1695 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionFillRectBody>(*state, "fillRect" ); |
| 1696 | } |
| 1697 | |
| 1698 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionStrokeRectBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1699 | { |
| 1700 | UNUSED_PARAM(state); |
| 1701 | UNUSED_PARAM(throwScope); |
| 1702 | auto& impl = castedThis->wrapped(); |
| 1703 | if (UNLIKELY(state->argumentCount() < 4)) |
| 1704 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1705 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1706 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1707 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1708 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1709 | auto w = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
| 1710 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1711 | auto h = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
| 1712 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1713 | impl.strokeRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
| 1714 | return JSValue::encode(jsUndefined()); |
| 1715 | } |
| 1716 | |
| 1717 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionStrokeRect(ExecState* state) |
| 1718 | { |
| 1719 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionStrokeRectBody>(*state, "strokeRect" ); |
| 1720 | } |
| 1721 | |
| 1722 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionSaveBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1723 | { |
| 1724 | UNUSED_PARAM(state); |
| 1725 | UNUSED_PARAM(throwScope); |
| 1726 | auto& impl = castedThis->wrapped(); |
| 1727 | impl.save(); |
| 1728 | return JSValue::encode(jsUndefined()); |
| 1729 | } |
| 1730 | |
| 1731 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionSave(ExecState* state) |
| 1732 | { |
| 1733 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionSaveBody>(*state, "save" ); |
| 1734 | } |
| 1735 | |
| 1736 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionRestoreBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1737 | { |
| 1738 | UNUSED_PARAM(state); |
| 1739 | UNUSED_PARAM(throwScope); |
| 1740 | auto& impl = castedThis->wrapped(); |
| 1741 | impl.restore(); |
| 1742 | return JSValue::encode(jsUndefined()); |
| 1743 | } |
| 1744 | |
| 1745 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionRestore(ExecState* state) |
| 1746 | { |
| 1747 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionRestoreBody>(*state, "restore" ); |
| 1748 | } |
| 1749 | |
| 1750 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionScaleBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1751 | { |
| 1752 | UNUSED_PARAM(state); |
| 1753 | UNUSED_PARAM(throwScope); |
| 1754 | auto& impl = castedThis->wrapped(); |
| 1755 | if (UNLIKELY(state->argumentCount() < 2)) |
| 1756 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1757 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1758 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1759 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1760 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1761 | impl.scale(WTFMove(x), WTFMove(y)); |
| 1762 | return JSValue::encode(jsUndefined()); |
| 1763 | } |
| 1764 | |
| 1765 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionScale(ExecState* state) |
| 1766 | { |
| 1767 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionScaleBody>(*state, "scale" ); |
| 1768 | } |
| 1769 | |
| 1770 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionRotateBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1771 | { |
| 1772 | UNUSED_PARAM(state); |
| 1773 | UNUSED_PARAM(throwScope); |
| 1774 | auto& impl = castedThis->wrapped(); |
| 1775 | if (UNLIKELY(state->argumentCount() < 1)) |
| 1776 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1777 | auto angle = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1778 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1779 | impl.rotate(WTFMove(angle)); |
| 1780 | return JSValue::encode(jsUndefined()); |
| 1781 | } |
| 1782 | |
| 1783 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionRotate(ExecState* state) |
| 1784 | { |
| 1785 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionRotateBody>(*state, "rotate" ); |
| 1786 | } |
| 1787 | |
| 1788 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionTranslateBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1789 | { |
| 1790 | UNUSED_PARAM(state); |
| 1791 | UNUSED_PARAM(throwScope); |
| 1792 | auto& impl = castedThis->wrapped(); |
| 1793 | if (UNLIKELY(state->argumentCount() < 2)) |
| 1794 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1795 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1796 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1797 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1798 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1799 | impl.translate(WTFMove(x), WTFMove(y)); |
| 1800 | return JSValue::encode(jsUndefined()); |
| 1801 | } |
| 1802 | |
| 1803 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionTranslate(ExecState* state) |
| 1804 | { |
| 1805 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionTranslateBody>(*state, "translate" ); |
| 1806 | } |
| 1807 | |
| 1808 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionTransformBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1809 | { |
| 1810 | UNUSED_PARAM(state); |
| 1811 | UNUSED_PARAM(throwScope); |
| 1812 | auto& impl = castedThis->wrapped(); |
| 1813 | if (UNLIKELY(state->argumentCount() < 6)) |
| 1814 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 1815 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1816 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1817 | auto b = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1818 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1819 | auto c = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
| 1820 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1821 | auto d = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
| 1822 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1823 | auto e = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
| 1824 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1825 | auto f = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(5)); |
| 1826 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1827 | impl.transform(WTFMove(a), WTFMove(b), WTFMove(c), WTFMove(d), WTFMove(e), WTFMove(f)); |
| 1828 | return JSValue::encode(jsUndefined()); |
| 1829 | } |
| 1830 | |
| 1831 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionTransform(ExecState* state) |
| 1832 | { |
| 1833 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionTransformBody>(*state, "transform" ); |
| 1834 | } |
| 1835 | |
| 1836 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetTransformBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1837 | { |
| 1838 | UNUSED_PARAM(state); |
| 1839 | UNUSED_PARAM(throwScope); |
| 1840 | auto& impl = castedThis->wrapped(); |
| 1841 | return JSValue::encode(toJSNewlyCreated<IDLInterface<DOMMatrix>>(*state, *castedThis->globalObject(), impl.getTransform())); |
| 1842 | } |
| 1843 | |
| 1844 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetTransform(ExecState* state) |
| 1845 | { |
| 1846 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionGetTransformBody>(*state, "getTransform" ); |
| 1847 | } |
| 1848 | |
| 1849 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransform1Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1850 | { |
| 1851 | UNUSED_PARAM(state); |
| 1852 | UNUSED_PARAM(throwScope); |
| 1853 | auto& impl = castedThis->wrapped(); |
| 1854 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
| 1855 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1856 | auto b = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
| 1857 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1858 | auto c = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
| 1859 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1860 | auto d = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
| 1861 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1862 | auto e = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
| 1863 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1864 | auto f = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(5)); |
| 1865 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1866 | impl.setTransform(WTFMove(a), WTFMove(b), WTFMove(c), WTFMove(d), WTFMove(e), WTFMove(f)); |
| 1867 | return JSValue::encode(jsUndefined()); |
| 1868 | } |
| 1869 | |
| 1870 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransform2Body(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1871 | { |
| 1872 | UNUSED_PARAM(state); |
| 1873 | UNUSED_PARAM(throwScope); |
| 1874 | auto& impl = castedThis->wrapped(); |
| 1875 | auto transform = convert<IDLDictionary<DOMMatrix2DInit>>(*state, state->argument(0)); |
| 1876 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 1877 | propagateException(*state, throwScope, impl.setTransform(WTFMove(transform))); |
| 1878 | return JSValue::encode(jsUndefined()); |
| 1879 | } |
| 1880 | |
| 1881 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransformOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1882 | { |
| 1883 | UNUSED_PARAM(state); |
| 1884 | UNUSED_PARAM(throwScope); |
| 1885 | VM& vm = state->vm(); |
| 1886 | UNUSED_PARAM(vm); |
| 1887 | size_t argsCount = std::min<size_t>(6, state->argumentCount()); |
| 1888 | if (argsCount == 0) { |
| 1889 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransform2Body(state, castedThis, throwScope); |
| 1890 | } |
| 1891 | if (argsCount == 1) { |
| 1892 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransform2Body(state, castedThis, throwScope); |
| 1893 | } |
| 1894 | if (argsCount == 6) { |
| 1895 | return jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransform1Body(state, castedThis, throwScope); |
| 1896 | } |
| 1897 | return throwVMTypeError(state, throwScope); |
| 1898 | } |
| 1899 | |
| 1900 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransform(ExecState* state) |
| 1901 | { |
| 1902 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionSetTransformOverloadDispatcher>(*state, "setTransform" ); |
| 1903 | } |
| 1904 | |
| 1905 | static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunctionResetTransformBody(JSC::ExecState* state, typename IDLOperation<JSOffscreenCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 1906 | { |
| 1907 | UNUSED_PARAM(state); |
| 1908 | UNUSED_PARAM(throwScope); |
| 1909 | auto& impl = castedThis->wrapped(); |
| 1910 | impl.resetTransform(); |
| 1911 | return JSValue::encode(jsUndefined()); |
| 1912 | } |
| 1913 | |
| 1914 | EncodedJSValue JSC_HOST_CALL jsOffscreenCanvasRenderingContext2DPrototypeFunctionResetTransform(ExecState* state) |
| 1915 | { |
| 1916 | return IDLOperation<JSOffscreenCanvasRenderingContext2D>::call<jsOffscreenCanvasRenderingContext2DPrototypeFunctionResetTransformBody>(*state, "resetTransform" ); |
| 1917 | } |
| 1918 | |
| 1919 | void JSOffscreenCanvasRenderingContext2D::visitChildren(JSCell* cell, SlotVisitor& visitor) |
| 1920 | { |
| 1921 | auto* thisObject = jsCast<JSOffscreenCanvasRenderingContext2D*>(cell); |
| 1922 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| 1923 | Base::visitChildren(thisObject, visitor); |
| 1924 | thisObject->visitAdditionalChildren(visitor); |
| 1925 | } |
| 1926 | |
| 1927 | void JSOffscreenCanvasRenderingContext2D::visitOutputConstraints(JSCell* cell, SlotVisitor& visitor) |
| 1928 | { |
| 1929 | auto* thisObject = jsCast<JSOffscreenCanvasRenderingContext2D*>(cell); |
| 1930 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| 1931 | Base::visitOutputConstraints(thisObject, visitor); |
| 1932 | thisObject->visitAdditionalChildren(visitor); |
| 1933 | } |
| 1934 | |
| 1935 | void JSOffscreenCanvasRenderingContext2D::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
| 1936 | { |
| 1937 | auto* thisObject = jsCast<JSOffscreenCanvasRenderingContext2D*>(cell); |
| 1938 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
| 1939 | if (thisObject->scriptExecutionContext()) |
| 1940 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
| 1941 | Base::heapSnapshot(cell, builder); |
| 1942 | } |
| 1943 | |
| 1944 | void JSOffscreenCanvasRenderingContext2DOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| 1945 | { |
| 1946 | auto* jsOffscreenCanvasRenderingContext2D = static_cast<JSOffscreenCanvasRenderingContext2D*>(handle.slot()->asCell()); |
| 1947 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
| 1948 | uncacheWrapper(world, &jsOffscreenCanvasRenderingContext2D->wrapped(), jsOffscreenCanvasRenderingContext2D); |
| 1949 | } |
| 1950 | |
| 1951 | #if ENABLE(BINDING_INTEGRITY) |
| 1952 | #if PLATFORM(WIN) |
| 1953 | #pragma warning(disable: 4483) |
| 1954 | extern "C" { extern void (*const __identifier("??_7OffscreenCanvasRenderingContext2D@WebCore@@6B@" )[])(); } |
| 1955 | #else |
| 1956 | extern "C" { extern void* _ZTVN7WebCore33OffscreenCanvasRenderingContext2DE[]; } |
| 1957 | #endif |
| 1958 | #endif |
| 1959 | |
| 1960 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<OffscreenCanvasRenderingContext2D>&& impl) |
| 1961 | { |
| 1962 | |
| 1963 | #if ENABLE(BINDING_INTEGRITY) |
| 1964 | void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr())); |
| 1965 | #if PLATFORM(WIN) |
| 1966 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7OffscreenCanvasRenderingContext2D@WebCore@@6B@" )); |
| 1967 | #else |
| 1968 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore33OffscreenCanvasRenderingContext2DE[2]); |
| 1969 | #endif |
| 1970 | |
| 1971 | // If this fails OffscreenCanvasRenderingContext2D does not have a vtable, so you need to add the |
| 1972 | // ImplementationLacksVTable attribute to the interface definition |
| 1973 | static_assert(std::is_polymorphic<OffscreenCanvasRenderingContext2D>::value, "OffscreenCanvasRenderingContext2D is not polymorphic" ); |
| 1974 | |
| 1975 | // If you hit this assertion you either have a use after free bug, or |
| 1976 | // OffscreenCanvasRenderingContext2D has subclasses. If OffscreenCanvasRenderingContext2D has subclasses that get passed |
| 1977 | // to toJS() we currently require OffscreenCanvasRenderingContext2D you to opt out of binding hardening |
| 1978 | // by adding the SkipVTableValidation attribute to the interface IDL definition |
| 1979 | RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
| 1980 | #endif |
| 1981 | return createWrapper<OffscreenCanvasRenderingContext2D>(globalObject, WTFMove(impl)); |
| 1982 | } |
| 1983 | |
| 1984 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, OffscreenCanvasRenderingContext2D& impl) |
| 1985 | { |
| 1986 | return wrap(state, globalObject, impl); |
| 1987 | } |
| 1988 | |
| 1989 | OffscreenCanvasRenderingContext2D* JSOffscreenCanvasRenderingContext2D::toWrapped(JSC::VM& vm, JSC::JSValue value) |
| 1990 | { |
| 1991 | if (auto* wrapper = jsDynamicCast<JSOffscreenCanvasRenderingContext2D*>(vm, value)) |
| 1992 | return &wrapper->wrapped(); |
| 1993 | return nullptr; |
| 1994 | } |
| 1995 | |
| 1996 | } |
| 1997 | |