| 1 | /* |
| 2 | This file is part of the WebKit open source project. |
| 3 | This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Library General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Library General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Library General Public License |
| 16 | along with this library; see the file COPYING.LIB. If not, write to |
| 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | Boston, MA 02110-1301, USA. |
| 19 | */ |
| 20 | |
| 21 | #include "config.h" |
| 22 | |
| 23 | #if ENABLE(SVG_FONTS) |
| 24 | |
| 25 | #include "JSSVGGlyphRefElement.h" |
| 26 | |
| 27 | #include "JSDOMAttribute.h" |
| 28 | #include "JSDOMBinding.h" |
| 29 | #include "JSDOMConstructorNotConstructable.h" |
| 30 | #include "JSDOMConvertInterface.h" |
| 31 | #include "JSDOMConvertNumbers.h" |
| 32 | #include "JSDOMConvertStrings.h" |
| 33 | #include "JSDOMExceptionHandling.h" |
| 34 | #include "JSDOMGlobalObject.h" |
| 35 | #include "JSDOMWrapperCache.h" |
| 36 | #include "JSSVGAnimatedString.h" |
| 37 | #include "SVGNames.h" |
| 38 | #include "ScriptExecutionContext.h" |
| 39 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
| 40 | #include <JavaScriptCore/JSCInlines.h> |
| 41 | #include <wtf/GetPtr.h> |
| 42 | #include <wtf/PointerPreparations.h> |
| 43 | #include <wtf/URL.h> |
| 44 | |
| 45 | |
| 46 | namespace WebCore { |
| 47 | using namespace JSC; |
| 48 | |
| 49 | // Attributes |
| 50 | |
| 51 | JSC::EncodedJSValue jsSVGGlyphRefElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 52 | bool setJSSVGGlyphRefElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 53 | JSC::EncodedJSValue jsSVGGlyphRefElementGlyphRef(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 54 | bool setJSSVGGlyphRefElementGlyphRef(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 55 | JSC::EncodedJSValue jsSVGGlyphRefElementFormat(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 56 | bool setJSSVGGlyphRefElementFormat(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 57 | JSC::EncodedJSValue jsSVGGlyphRefElementX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 58 | bool setJSSVGGlyphRefElementX(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 59 | JSC::EncodedJSValue jsSVGGlyphRefElementY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 60 | bool setJSSVGGlyphRefElementY(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 61 | JSC::EncodedJSValue jsSVGGlyphRefElementDx(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 62 | bool setJSSVGGlyphRefElementDx(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 63 | JSC::EncodedJSValue jsSVGGlyphRefElementDy(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 64 | bool setJSSVGGlyphRefElementDy(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 65 | JSC::EncodedJSValue jsSVGGlyphRefElementHref(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 66 | |
| 67 | class JSSVGGlyphRefElementPrototype : public JSC::JSNonFinalObject { |
| 68 | public: |
| 69 | using Base = JSC::JSNonFinalObject; |
| 70 | static JSSVGGlyphRefElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| 71 | { |
| 72 | JSSVGGlyphRefElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGGlyphRefElementPrototype>(vm.heap)) JSSVGGlyphRefElementPrototype(vm, globalObject, structure); |
| 73 | ptr->finishCreation(vm); |
| 74 | return ptr; |
| 75 | } |
| 76 | |
| 77 | DECLARE_INFO; |
| 78 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| 79 | { |
| 80 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| 81 | } |
| 82 | |
| 83 | private: |
| 84 | JSSVGGlyphRefElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| 85 | : JSC::JSNonFinalObject(vm, structure) |
| 86 | { |
| 87 | } |
| 88 | |
| 89 | void finishCreation(JSC::VM&); |
| 90 | }; |
| 91 | |
| 92 | using JSSVGGlyphRefElementConstructor = JSDOMConstructorNotConstructable<JSSVGGlyphRefElement>; |
| 93 | |
| 94 | template<> JSValue JSSVGGlyphRefElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| 95 | { |
| 96 | return JSSVGElement::getConstructor(vm, &globalObject); |
| 97 | } |
| 98 | |
| 99 | template<> void JSSVGGlyphRefElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| 100 | { |
| 101 | putDirect(vm, vm.propertyNames->prototype, JSSVGGlyphRefElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 102 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGGlyphRefElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 103 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 104 | } |
| 105 | |
| 106 | template<> const ClassInfo JSSVGGlyphRefElementConstructor::s_info = { "SVGGlyphRefElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGGlyphRefElementConstructor) }; |
| 107 | |
| 108 | /* Hash table for prototype */ |
| 109 | |
| 110 | static const HashTableValue JSSVGGlyphRefElementPrototypeTableValues[] = |
| 111 | { |
| 112 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGlyphRefElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGGlyphRefElementConstructor) } }, |
| 113 | { "glyphRef" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGlyphRefElementGlyphRef), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGGlyphRefElementGlyphRef) } }, |
| 114 | { "format" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGlyphRefElementFormat), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGGlyphRefElementFormat) } }, |
| 115 | { "x" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGlyphRefElementX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGGlyphRefElementX) } }, |
| 116 | { "y" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGlyphRefElementY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGGlyphRefElementY) } }, |
| 117 | { "dx" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGlyphRefElementDx), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGGlyphRefElementDx) } }, |
| 118 | { "dy" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGlyphRefElementDy), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGGlyphRefElementDy) } }, |
| 119 | { "href" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGlyphRefElementHref), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 120 | }; |
| 121 | |
| 122 | const ClassInfo JSSVGGlyphRefElementPrototype::s_info = { "SVGGlyphRefElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGGlyphRefElementPrototype) }; |
| 123 | |
| 124 | void JSSVGGlyphRefElementPrototype::finishCreation(VM& vm) |
| 125 | { |
| 126 | Base::finishCreation(vm); |
| 127 | reifyStaticProperties(vm, JSSVGGlyphRefElement::info(), JSSVGGlyphRefElementPrototypeTableValues, *this); |
| 128 | } |
| 129 | |
| 130 | const ClassInfo JSSVGGlyphRefElement::s_info = { "SVGGlyphRefElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGGlyphRefElement) }; |
| 131 | |
| 132 | JSSVGGlyphRefElement::JSSVGGlyphRefElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGGlyphRefElement>&& impl) |
| 133 | : JSSVGElement(structure, globalObject, WTFMove(impl)) |
| 134 | { |
| 135 | } |
| 136 | |
| 137 | void JSSVGGlyphRefElement::finishCreation(VM& vm) |
| 138 | { |
| 139 | Base::finishCreation(vm); |
| 140 | ASSERT(inherits(vm, info())); |
| 141 | |
| 142 | } |
| 143 | |
| 144 | JSObject* JSSVGGlyphRefElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 145 | { |
| 146 | return JSSVGGlyphRefElementPrototype::create(vm, &globalObject, JSSVGGlyphRefElementPrototype::createStructure(vm, &globalObject, JSSVGElement::prototype(vm, globalObject))); |
| 147 | } |
| 148 | |
| 149 | JSObject* JSSVGGlyphRefElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 150 | { |
| 151 | return getDOMPrototype<JSSVGGlyphRefElement>(vm, globalObject); |
| 152 | } |
| 153 | |
| 154 | JSValue JSSVGGlyphRefElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| 155 | { |
| 156 | return getDOMConstructor<JSSVGGlyphRefElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| 157 | } |
| 158 | |
| 159 | template<> inline JSSVGGlyphRefElement* IDLAttribute<JSSVGGlyphRefElement>::cast(ExecState& state, EncodedJSValue thisValue) |
| 160 | { |
| 161 | return jsDynamicCast<JSSVGGlyphRefElement*>(state.vm(), JSValue::decode(thisValue)); |
| 162 | } |
| 163 | |
| 164 | EncodedJSValue jsSVGGlyphRefElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 165 | { |
| 166 | VM& vm = state->vm(); |
| 167 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 168 | auto* prototype = jsDynamicCast<JSSVGGlyphRefElementPrototype*>(vm, JSValue::decode(thisValue)); |
| 169 | if (UNLIKELY(!prototype)) |
| 170 | return throwVMTypeError(state, throwScope); |
| 171 | return JSValue::encode(JSSVGGlyphRefElement::getConstructor(state->vm(), prototype->globalObject())); |
| 172 | } |
| 173 | |
| 174 | bool setJSSVGGlyphRefElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 175 | { |
| 176 | VM& vm = state->vm(); |
| 177 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 178 | auto* prototype = jsDynamicCast<JSSVGGlyphRefElementPrototype*>(vm, JSValue::decode(thisValue)); |
| 179 | if (UNLIKELY(!prototype)) { |
| 180 | throwVMTypeError(state, throwScope); |
| 181 | return false; |
| 182 | } |
| 183 | // Shadowing a built-in constructor |
| 184 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
| 185 | } |
| 186 | |
| 187 | static inline JSValue jsSVGGlyphRefElementGlyphRefGetter(ExecState& state, JSSVGGlyphRefElement& thisObject, ThrowScope& throwScope) |
| 188 | { |
| 189 | UNUSED_PARAM(throwScope); |
| 190 | UNUSED_PARAM(state); |
| 191 | auto& impl = thisObject.wrapped(); |
| 192 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::SVGNames::glyphRefAttr)); |
| 193 | return result; |
| 194 | } |
| 195 | |
| 196 | EncodedJSValue jsSVGGlyphRefElementGlyphRef(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 197 | { |
| 198 | return IDLAttribute<JSSVGGlyphRefElement>::get<jsSVGGlyphRefElementGlyphRefGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "glyphRef" ); |
| 199 | } |
| 200 | |
| 201 | static inline bool setJSSVGGlyphRefElementGlyphRefSetter(ExecState& state, JSSVGGlyphRefElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 202 | { |
| 203 | UNUSED_PARAM(throwScope); |
| 204 | auto& impl = thisObject.wrapped(); |
| 205 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 206 | RETURN_IF_EXCEPTION(throwScope, false); |
| 207 | AttributeSetter::call(state, throwScope, [&] { |
| 208 | return impl.setAttributeWithoutSynchronization(WebCore::SVGNames::glyphRefAttr, WTFMove(nativeValue)); |
| 209 | }); |
| 210 | return true; |
| 211 | } |
| 212 | |
| 213 | bool setJSSVGGlyphRefElementGlyphRef(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 214 | { |
| 215 | return IDLAttribute<JSSVGGlyphRefElement>::set<setJSSVGGlyphRefElementGlyphRefSetter>(*state, thisValue, encodedValue, "glyphRef" ); |
| 216 | } |
| 217 | |
| 218 | static inline JSValue jsSVGGlyphRefElementFormatGetter(ExecState& state, JSSVGGlyphRefElement& thisObject, ThrowScope& throwScope) |
| 219 | { |
| 220 | UNUSED_PARAM(throwScope); |
| 221 | UNUSED_PARAM(state); |
| 222 | auto& impl = thisObject.wrapped(); |
| 223 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::SVGNames::formatAttr)); |
| 224 | return result; |
| 225 | } |
| 226 | |
| 227 | EncodedJSValue jsSVGGlyphRefElementFormat(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 228 | { |
| 229 | return IDLAttribute<JSSVGGlyphRefElement>::get<jsSVGGlyphRefElementFormatGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "format" ); |
| 230 | } |
| 231 | |
| 232 | static inline bool setJSSVGGlyphRefElementFormatSetter(ExecState& state, JSSVGGlyphRefElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 233 | { |
| 234 | UNUSED_PARAM(throwScope); |
| 235 | auto& impl = thisObject.wrapped(); |
| 236 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 237 | RETURN_IF_EXCEPTION(throwScope, false); |
| 238 | AttributeSetter::call(state, throwScope, [&] { |
| 239 | return impl.setAttributeWithoutSynchronization(WebCore::SVGNames::formatAttr, WTFMove(nativeValue)); |
| 240 | }); |
| 241 | return true; |
| 242 | } |
| 243 | |
| 244 | bool setJSSVGGlyphRefElementFormat(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 245 | { |
| 246 | return IDLAttribute<JSSVGGlyphRefElement>::set<setJSSVGGlyphRefElementFormatSetter>(*state, thisValue, encodedValue, "format" ); |
| 247 | } |
| 248 | |
| 249 | static inline JSValue jsSVGGlyphRefElementXGetter(ExecState& state, JSSVGGlyphRefElement& thisObject, ThrowScope& throwScope) |
| 250 | { |
| 251 | UNUSED_PARAM(throwScope); |
| 252 | UNUSED_PARAM(state); |
| 253 | auto& impl = thisObject.wrapped(); |
| 254 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.x()); |
| 255 | return result; |
| 256 | } |
| 257 | |
| 258 | EncodedJSValue jsSVGGlyphRefElementX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 259 | { |
| 260 | return IDLAttribute<JSSVGGlyphRefElement>::get<jsSVGGlyphRefElementXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x" ); |
| 261 | } |
| 262 | |
| 263 | static inline bool setJSSVGGlyphRefElementXSetter(ExecState& state, JSSVGGlyphRefElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 264 | { |
| 265 | UNUSED_PARAM(throwScope); |
| 266 | auto& impl = thisObject.wrapped(); |
| 267 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
| 268 | RETURN_IF_EXCEPTION(throwScope, false); |
| 269 | AttributeSetter::call(state, throwScope, [&] { |
| 270 | return impl.setX(WTFMove(nativeValue)); |
| 271 | }); |
| 272 | return true; |
| 273 | } |
| 274 | |
| 275 | bool setJSSVGGlyphRefElementX(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 276 | { |
| 277 | return IDLAttribute<JSSVGGlyphRefElement>::set<setJSSVGGlyphRefElementXSetter>(*state, thisValue, encodedValue, "x" ); |
| 278 | } |
| 279 | |
| 280 | static inline JSValue jsSVGGlyphRefElementYGetter(ExecState& state, JSSVGGlyphRefElement& thisObject, ThrowScope& throwScope) |
| 281 | { |
| 282 | UNUSED_PARAM(throwScope); |
| 283 | UNUSED_PARAM(state); |
| 284 | auto& impl = thisObject.wrapped(); |
| 285 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.y()); |
| 286 | return result; |
| 287 | } |
| 288 | |
| 289 | EncodedJSValue jsSVGGlyphRefElementY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 290 | { |
| 291 | return IDLAttribute<JSSVGGlyphRefElement>::get<jsSVGGlyphRefElementYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y" ); |
| 292 | } |
| 293 | |
| 294 | static inline bool setJSSVGGlyphRefElementYSetter(ExecState& state, JSSVGGlyphRefElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 295 | { |
| 296 | UNUSED_PARAM(throwScope); |
| 297 | auto& impl = thisObject.wrapped(); |
| 298 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
| 299 | RETURN_IF_EXCEPTION(throwScope, false); |
| 300 | AttributeSetter::call(state, throwScope, [&] { |
| 301 | return impl.setY(WTFMove(nativeValue)); |
| 302 | }); |
| 303 | return true; |
| 304 | } |
| 305 | |
| 306 | bool setJSSVGGlyphRefElementY(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 307 | { |
| 308 | return IDLAttribute<JSSVGGlyphRefElement>::set<setJSSVGGlyphRefElementYSetter>(*state, thisValue, encodedValue, "y" ); |
| 309 | } |
| 310 | |
| 311 | static inline JSValue jsSVGGlyphRefElementDxGetter(ExecState& state, JSSVGGlyphRefElement& thisObject, ThrowScope& throwScope) |
| 312 | { |
| 313 | UNUSED_PARAM(throwScope); |
| 314 | UNUSED_PARAM(state); |
| 315 | auto& impl = thisObject.wrapped(); |
| 316 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.dx()); |
| 317 | return result; |
| 318 | } |
| 319 | |
| 320 | EncodedJSValue jsSVGGlyphRefElementDx(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 321 | { |
| 322 | return IDLAttribute<JSSVGGlyphRefElement>::get<jsSVGGlyphRefElementDxGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "dx" ); |
| 323 | } |
| 324 | |
| 325 | static inline bool setJSSVGGlyphRefElementDxSetter(ExecState& state, JSSVGGlyphRefElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 326 | { |
| 327 | UNUSED_PARAM(throwScope); |
| 328 | auto& impl = thisObject.wrapped(); |
| 329 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
| 330 | RETURN_IF_EXCEPTION(throwScope, false); |
| 331 | AttributeSetter::call(state, throwScope, [&] { |
| 332 | return impl.setDx(WTFMove(nativeValue)); |
| 333 | }); |
| 334 | return true; |
| 335 | } |
| 336 | |
| 337 | bool setJSSVGGlyphRefElementDx(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 338 | { |
| 339 | return IDLAttribute<JSSVGGlyphRefElement>::set<setJSSVGGlyphRefElementDxSetter>(*state, thisValue, encodedValue, "dx" ); |
| 340 | } |
| 341 | |
| 342 | static inline JSValue jsSVGGlyphRefElementDyGetter(ExecState& state, JSSVGGlyphRefElement& thisObject, ThrowScope& throwScope) |
| 343 | { |
| 344 | UNUSED_PARAM(throwScope); |
| 345 | UNUSED_PARAM(state); |
| 346 | auto& impl = thisObject.wrapped(); |
| 347 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.dy()); |
| 348 | return result; |
| 349 | } |
| 350 | |
| 351 | EncodedJSValue jsSVGGlyphRefElementDy(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 352 | { |
| 353 | return IDLAttribute<JSSVGGlyphRefElement>::get<jsSVGGlyphRefElementDyGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "dy" ); |
| 354 | } |
| 355 | |
| 356 | static inline bool setJSSVGGlyphRefElementDySetter(ExecState& state, JSSVGGlyphRefElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 357 | { |
| 358 | UNUSED_PARAM(throwScope); |
| 359 | auto& impl = thisObject.wrapped(); |
| 360 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
| 361 | RETURN_IF_EXCEPTION(throwScope, false); |
| 362 | AttributeSetter::call(state, throwScope, [&] { |
| 363 | return impl.setDy(WTFMove(nativeValue)); |
| 364 | }); |
| 365 | return true; |
| 366 | } |
| 367 | |
| 368 | bool setJSSVGGlyphRefElementDy(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 369 | { |
| 370 | return IDLAttribute<JSSVGGlyphRefElement>::set<setJSSVGGlyphRefElementDySetter>(*state, thisValue, encodedValue, "dy" ); |
| 371 | } |
| 372 | |
| 373 | static inline JSValue jsSVGGlyphRefElementHrefGetter(ExecState& state, JSSVGGlyphRefElement& thisObject, ThrowScope& throwScope) |
| 374 | { |
| 375 | UNUSED_PARAM(throwScope); |
| 376 | UNUSED_PARAM(state); |
| 377 | auto& impl = thisObject.wrapped(); |
| 378 | JSValue result = toJS<IDLInterface<SVGAnimatedString>>(state, *thisObject.globalObject(), throwScope, impl.hrefAnimated()); |
| 379 | return result; |
| 380 | } |
| 381 | |
| 382 | EncodedJSValue jsSVGGlyphRefElementHref(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 383 | { |
| 384 | return IDLAttribute<JSSVGGlyphRefElement>::get<jsSVGGlyphRefElementHrefGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "href" ); |
| 385 | } |
| 386 | |
| 387 | void JSSVGGlyphRefElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
| 388 | { |
| 389 | auto* thisObject = jsCast<JSSVGGlyphRefElement*>(cell); |
| 390 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
| 391 | if (thisObject->scriptExecutionContext()) |
| 392 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
| 393 | Base::heapSnapshot(cell, builder); |
| 394 | } |
| 395 | |
| 396 | |
| 397 | } |
| 398 | |
| 399 | #endif // ENABLE(SVG_FONTS) |
| 400 | |