| /* |
| This file is part of the WebKit open source project. |
| This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| |
| This library is free software; you can redistribute it and/or |
| modify it under the terms of the GNU Library General Public |
| License as published by the Free Software Foundation; either |
| version 2 of the License, or (at your option) any later version. |
| |
| This library is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| Library General Public License for more details. |
| |
| You should have received a copy of the GNU Library General Public License |
| along with this library; see the file COPYING.LIB. If not, write to |
| the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| Boston, MA 02110-1301, USA. |
| */ |
| |
| #include "config.h" |
| #include "JSInternals.h" |
| |
| #include "CSSStyleDeclaration.h" |
| #include "ClientRect.h" |
| #include "ClientRectList.h" |
| #include "DOMWindow.h" |
| #include "ExceptionCode.h" |
| #include "File.h" |
| #include "GCObservation.h" |
| #include "JSCSSStyleDeclaration.h" |
| #include "JSClientRect.h" |
| #include "JSClientRectList.h" |
| #include "JSDOMBinding.h" |
| #include "JSDOMConvert.h" |
| #include "JSDOMURL.h" |
| #include "JSDOMWindow.h" |
| #include "JSDocument.h" |
| #include "JSElement.h" |
| #include "JSFile.h" |
| #include "JSGCObservation.h" |
| #include "JSHTMLImageElement.h" |
| #include "JSHTMLInputElement.h" |
| #include "JSHTMLLinkElement.h" |
| #include "JSHTMLSelectElement.h" |
| #include "JSInternalSettings.h" |
| #include "JSMallocStatistics.h" |
| #include "JSMemoryInfo.h" |
| #include "JSMockPageOverlay.h" |
| #include "JSNode.h" |
| #include "JSNodeList.h" |
| #include "JSRange.h" |
| #include "JSTypeConversions.h" |
| #include "JSXMLHttpRequest.h" |
| #include "MallocStatistics.h" |
| #include "MemoryInfo.h" |
| #include "MockPageOverlay.h" |
| #include "NameNodeList.h" |
| #include "Node.h" |
| #include "NodeList.h" |
| #include "Range.h" |
| #include "SerializedScriptValue.h" |
| #include "StyleProperties.h" |
| #include "TimeRanges.h" |
| #include "TypeConversions.h" |
| #include "URL.h" |
| #include <runtime/Error.h> |
| #include <runtime/JSArray.h> |
| #include <runtime/JSString.h> |
| #include <wtf/GetPtr.h> |
| |
| #if ENABLE(CONTENT_FILTERING) |
| #include "JSMockContentFilterSettings.h" |
| #endif |
| |
| #if ENABLE(MEDIA_SESSION) |
| #include "JSMediaSession.h" |
| #endif |
| |
| #if ENABLE(MEDIA_SESSION) || ENABLE(VIDEO) |
| #include "JSHTMLMediaElement.h" |
| #endif |
| |
| #if ENABLE(MEDIA_SOURCE) |
| #include "JSSourceBuffer.h" |
| #endif |
| |
| #if ENABLE(VIDEO) |
| #include "JSTimeRanges.h" |
| #endif |
| |
| #if ENABLE(WEB_AUDIO) |
| #include "JSAudioContext.h" |
| #endif |
| |
| using namespace JSC; |
| |
| namespace WebCore { |
| |
| template<typename T> Optional<T> parse(ExecState&, JSValue); |
| template<typename T> const char* expectedEnumerationValues(); |
| |
| JSString* jsStringWithCache(ExecState*, Internals::PageOverlayType); |
| |
| JSString* jsStringWithCache(ExecState* state, Internals::PageOverlayType enumerationValue) |
| { |
| static NeverDestroyed<const String> values[] = { |
| ASCIILiteral("view"), |
| ASCIILiteral("document"), |
| }; |
| static_assert(static_cast<size_t>(Internals::PageOverlayType::View) == 0, "Internals::PageOverlayType::View is not 0 as expected"); |
| static_assert(static_cast<size_t>(Internals::PageOverlayType::Document) == 1, "Internals::PageOverlayType::Document is not 1 as expected"); |
| ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)); |
| return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]); |
| } |
| |
| template<> struct JSValueTraits<Internals::PageOverlayType> { |
| static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, Internals::PageOverlayType value) { return jsStringWithCache(state, value); } |
| }; |
| |
| template<> Optional<Internals::PageOverlayType> parse<Internals::PageOverlayType>(ExecState& state, JSValue value) |
| { |
| auto stringValue = value.toWTFString(&state); |
| if (stringValue == "view") |
| return Internals::PageOverlayType::View; |
| if (stringValue == "document") |
| return Internals::PageOverlayType::Document; |
| return Nullopt; |
| } |
| |
| template<> Internals::PageOverlayType convert<Internals::PageOverlayType>(ExecState& state, JSValue value) |
| { |
| VM& vm = state.vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto result = parse<Internals::PageOverlayType>(state, value); |
| if (UNLIKELY(!result)) { |
| throwTypeError(&state, throwScope); |
| return { }; |
| } |
| return result.value(); |
| } |
| |
| template<> inline const char* expectedEnumerationValues<Internals::PageOverlayType>() |
| { |
| return "\"view\", \"document\""; |
| } |
| |
| JSString* jsStringWithCache(ExecState*, Internals::CachePolicy); |
| |
| JSString* jsStringWithCache(ExecState* state, Internals::CachePolicy enumerationValue) |
| { |
| static NeverDestroyed<const String> values[] = { |
| ASCIILiteral("UseProtocolCachePolicy"), |
| ASCIILiteral("ReloadIgnoringCacheData"), |
| ASCIILiteral("ReturnCacheDataElseLoad"), |
| ASCIILiteral("ReturnCacheDataDontLoad"), |
| }; |
| static_assert(static_cast<size_t>(Internals::CachePolicy::UseProtocolCachePolicy) == 0, "Internals::CachePolicy::UseProtocolCachePolicy is not 0 as expected"); |
| static_assert(static_cast<size_t>(Internals::CachePolicy::ReloadIgnoringCacheData) == 1, "Internals::CachePolicy::ReloadIgnoringCacheData is not 1 as expected"); |
| static_assert(static_cast<size_t>(Internals::CachePolicy::ReturnCacheDataElseLoad) == 2, "Internals::CachePolicy::ReturnCacheDataElseLoad is not 2 as expected"); |
| static_assert(static_cast<size_t>(Internals::CachePolicy::ReturnCacheDataDontLoad) == 3, "Internals::CachePolicy::ReturnCacheDataDontLoad is not 3 as expected"); |
| ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)); |
| return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]); |
| } |
| |
| template<> struct JSValueTraits<Internals::CachePolicy> { |
| static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, Internals::CachePolicy value) { return jsStringWithCache(state, value); } |
| }; |
| |
| template<> Optional<Internals::CachePolicy> parse<Internals::CachePolicy>(ExecState& state, JSValue value) |
| { |
| auto stringValue = value.toWTFString(&state); |
| if (stringValue == "UseProtocolCachePolicy") |
| return Internals::CachePolicy::UseProtocolCachePolicy; |
| if (stringValue == "ReloadIgnoringCacheData") |
| return Internals::CachePolicy::ReloadIgnoringCacheData; |
| if (stringValue == "ReturnCacheDataElseLoad") |
| return Internals::CachePolicy::ReturnCacheDataElseLoad; |
| if (stringValue == "ReturnCacheDataDontLoad") |
| return Internals::CachePolicy::ReturnCacheDataDontLoad; |
| return Nullopt; |
| } |
| |
| template<> Internals::CachePolicy convert<Internals::CachePolicy>(ExecState& state, JSValue value) |
| { |
| VM& vm = state.vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto result = parse<Internals::CachePolicy>(state, value); |
| if (UNLIKELY(!result)) { |
| throwTypeError(&state, throwScope); |
| return { }; |
| } |
| return result.value(); |
| } |
| |
| template<> inline const char* expectedEnumerationValues<Internals::CachePolicy>() |
| { |
| return "\"UseProtocolCachePolicy\", \"ReloadIgnoringCacheData\", \"ReturnCacheDataElseLoad\", \"ReturnCacheDataDontLoad\""; |
| } |
| |
| JSString* jsStringWithCache(ExecState*, Internals::ResourceLoadPriority); |
| |
| JSString* jsStringWithCache(ExecState* state, Internals::ResourceLoadPriority enumerationValue) |
| { |
| static NeverDestroyed<const String> values[] = { |
| ASCIILiteral("ResourceLoadPriorityVeryLow"), |
| ASCIILiteral("ResourceLoadPriorityLow"), |
| ASCIILiteral("ResourceLoadPriorityMedium"), |
| ASCIILiteral("ResourceLoadPriorityHigh"), |
| ASCIILiteral("ResourceLoadPriorityVeryHigh"), |
| }; |
| static_assert(static_cast<size_t>(Internals::ResourceLoadPriority::ResourceLoadPriorityVeryLow) == 0, "Internals::ResourceLoadPriority::ResourceLoadPriorityVeryLow is not 0 as expected"); |
| static_assert(static_cast<size_t>(Internals::ResourceLoadPriority::ResourceLoadPriorityLow) == 1, "Internals::ResourceLoadPriority::ResourceLoadPriorityLow is not 1 as expected"); |
| static_assert(static_cast<size_t>(Internals::ResourceLoadPriority::ResourceLoadPriorityMedium) == 2, "Internals::ResourceLoadPriority::ResourceLoadPriorityMedium is not 2 as expected"); |
| static_assert(static_cast<size_t>(Internals::ResourceLoadPriority::ResourceLoadPriorityHigh) == 3, "Internals::ResourceLoadPriority::ResourceLoadPriorityHigh is not 3 as expected"); |
| static_assert(static_cast<size_t>(Internals::ResourceLoadPriority::ResourceLoadPriorityVeryHigh) == 4, "Internals::ResourceLoadPriority::ResourceLoadPriorityVeryHigh is not 4 as expected"); |
| ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)); |
| return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]); |
| } |
| |
| template<> struct JSValueTraits<Internals::ResourceLoadPriority> { |
| static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, Internals::ResourceLoadPriority value) { return jsStringWithCache(state, value); } |
| }; |
| |
| template<> Optional<Internals::ResourceLoadPriority> parse<Internals::ResourceLoadPriority>(ExecState& state, JSValue value) |
| { |
| auto stringValue = value.toWTFString(&state); |
| if (stringValue == "ResourceLoadPriorityVeryLow") |
| return Internals::ResourceLoadPriority::ResourceLoadPriorityVeryLow; |
| if (stringValue == "ResourceLoadPriorityLow") |
| return Internals::ResourceLoadPriority::ResourceLoadPriorityLow; |
| if (stringValue == "ResourceLoadPriorityMedium") |
| return Internals::ResourceLoadPriority::ResourceLoadPriorityMedium; |
| if (stringValue == "ResourceLoadPriorityHigh") |
| return Internals::ResourceLoadPriority::ResourceLoadPriorityHigh; |
| if (stringValue == "ResourceLoadPriorityVeryHigh") |
| return Internals::ResourceLoadPriority::ResourceLoadPriorityVeryHigh; |
| return Nullopt; |
| } |
| |
| template<> Internals::ResourceLoadPriority convert<Internals::ResourceLoadPriority>(ExecState& state, JSValue value) |
| { |
| VM& vm = state.vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto result = parse<Internals::ResourceLoadPriority>(state, value); |
| if (UNLIKELY(!result)) { |
| throwTypeError(&state, throwScope); |
| return { }; |
| } |
| return result.value(); |
| } |
| |
| template<> inline const char* expectedEnumerationValues<Internals::ResourceLoadPriority>() |
| { |
| return "\"ResourceLoadPriorityVeryLow\", \"ResourceLoadPriorityLow\", \"ResourceLoadPriorityMedium\", \"ResourceLoadPriorityHigh\", \"ResourceLoadPriorityVeryHigh\""; |
| } |
| |
| #if ENABLE(MEDIA_SESSION) |
| |
| JSString* jsStringWithCache(ExecState*, Internals::MediaSessionInterruptingCategory); |
| |
| JSString* jsStringWithCache(ExecState* state, Internals::MediaSessionInterruptingCategory enumerationValue) |
| { |
| static NeverDestroyed<const String> values[] = { |
| ASCIILiteral("content"), |
| ASCIILiteral("transient"), |
| ASCIILiteral("transient-solo"), |
| }; |
| static_assert(static_cast<size_t>(Internals::MediaSessionInterruptingCategory::Content) == 0, "Internals::MediaSessionInterruptingCategory::Content is not 0 as expected"); |
| static_assert(static_cast<size_t>(Internals::MediaSessionInterruptingCategory::Transient) == 1, "Internals::MediaSessionInterruptingCategory::Transient is not 1 as expected"); |
| static_assert(static_cast<size_t>(Internals::MediaSessionInterruptingCategory::TransientSolo) == 2, "Internals::MediaSessionInterruptingCategory::TransientSolo is not 2 as expected"); |
| ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)); |
| return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]); |
| } |
| |
| template<> struct JSValueTraits<Internals::MediaSessionInterruptingCategory> { |
| static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, Internals::MediaSessionInterruptingCategory value) { return jsStringWithCache(state, value); } |
| }; |
| |
| template<> Optional<Internals::MediaSessionInterruptingCategory> parse<Internals::MediaSessionInterruptingCategory>(ExecState& state, JSValue value) |
| { |
| auto stringValue = value.toWTFString(&state); |
| if (stringValue == "content") |
| return Internals::MediaSessionInterruptingCategory::Content; |
| if (stringValue == "transient") |
| return Internals::MediaSessionInterruptingCategory::Transient; |
| if (stringValue == "transient-solo") |
| return Internals::MediaSessionInterruptingCategory::TransientSolo; |
| return Nullopt; |
| } |
| |
| template<> Internals::MediaSessionInterruptingCategory convert<Internals::MediaSessionInterruptingCategory>(ExecState& state, JSValue value) |
| { |
| VM& vm = state.vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto result = parse<Internals::MediaSessionInterruptingCategory>(state, value); |
| if (UNLIKELY(!result)) { |
| throwTypeError(&state, throwScope); |
| return { }; |
| } |
| return result.value(); |
| } |
| |
| template<> inline const char* expectedEnumerationValues<Internals::MediaSessionInterruptingCategory>() |
| { |
| return "\"content\", \"transient\", \"transient-solo\""; |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_SESSION) |
| |
| JSString* jsStringWithCache(ExecState*, Internals::MediaControlEvent); |
| |
| JSString* jsStringWithCache(ExecState* state, Internals::MediaControlEvent enumerationValue) |
| { |
| static NeverDestroyed<const String> values[] = { |
| ASCIILiteral("play-pause"), |
| ASCIILiteral("next-track"), |
| ASCIILiteral("previous-track"), |
| }; |
| static_assert(static_cast<size_t>(Internals::MediaControlEvent::PlayPause) == 0, "Internals::MediaControlEvent::PlayPause is not 0 as expected"); |
| static_assert(static_cast<size_t>(Internals::MediaControlEvent::NextTrack) == 1, "Internals::MediaControlEvent::NextTrack is not 1 as expected"); |
| static_assert(static_cast<size_t>(Internals::MediaControlEvent::PreviousTrack) == 2, "Internals::MediaControlEvent::PreviousTrack is not 2 as expected"); |
| ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)); |
| return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]); |
| } |
| |
| template<> struct JSValueTraits<Internals::MediaControlEvent> { |
| static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, Internals::MediaControlEvent value) { return jsStringWithCache(state, value); } |
| }; |
| |
| template<> Optional<Internals::MediaControlEvent> parse<Internals::MediaControlEvent>(ExecState& state, JSValue value) |
| { |
| auto stringValue = value.toWTFString(&state); |
| if (stringValue == "play-pause") |
| return Internals::MediaControlEvent::PlayPause; |
| if (stringValue == "next-track") |
| return Internals::MediaControlEvent::NextTrack; |
| if (stringValue == "previous-track") |
| return Internals::MediaControlEvent::PreviousTrack; |
| return Nullopt; |
| } |
| |
| template<> Internals::MediaControlEvent convert<Internals::MediaControlEvent>(ExecState& state, JSValue value) |
| { |
| VM& vm = state.vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto result = parse<Internals::MediaControlEvent>(state, value); |
| if (UNLIKELY(!result)) { |
| throwTypeError(&state, throwScope); |
| return { }; |
| } |
| return result.value(); |
| } |
| |
| template<> inline const char* expectedEnumerationValues<Internals::MediaControlEvent>() |
| { |
| return "\"play-pause\", \"next-track\", \"previous-track\""; |
| } |
| |
| #endif |
| |
| JSString* jsStringWithCache(ExecState*, Internals::AutoFillButtonType); |
| |
| JSString* jsStringWithCache(ExecState* state, Internals::AutoFillButtonType enumerationValue) |
| { |
| static NeverDestroyed<const String> values[] = { |
| ASCIILiteral("AutoFillButtonTypeNone"), |
| ASCIILiteral("AutoFillButtonTypeContacts"), |
| ASCIILiteral("AutoFillButtonTypeCredentials"), |
| }; |
| static_assert(static_cast<size_t>(Internals::AutoFillButtonType::AutoFillButtonTypeNone) == 0, "Internals::AutoFillButtonType::AutoFillButtonTypeNone is not 0 as expected"); |
| static_assert(static_cast<size_t>(Internals::AutoFillButtonType::AutoFillButtonTypeContacts) == 1, "Internals::AutoFillButtonType::AutoFillButtonTypeContacts is not 1 as expected"); |
| static_assert(static_cast<size_t>(Internals::AutoFillButtonType::AutoFillButtonTypeCredentials) == 2, "Internals::AutoFillButtonType::AutoFillButtonTypeCredentials is not 2 as expected"); |
| ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)); |
| return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]); |
| } |
| |
| template<> struct JSValueTraits<Internals::AutoFillButtonType> { |
| static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, Internals::AutoFillButtonType value) { return jsStringWithCache(state, value); } |
| }; |
| |
| template<> Optional<Internals::AutoFillButtonType> parse<Internals::AutoFillButtonType>(ExecState& state, JSValue value) |
| { |
| auto stringValue = value.toWTFString(&state); |
| if (stringValue == "AutoFillButtonTypeNone") |
| return Internals::AutoFillButtonType::AutoFillButtonTypeNone; |
| if (stringValue == "AutoFillButtonTypeContacts") |
| return Internals::AutoFillButtonType::AutoFillButtonTypeContacts; |
| if (stringValue == "AutoFillButtonTypeCredentials") |
| return Internals::AutoFillButtonType::AutoFillButtonTypeCredentials; |
| return Nullopt; |
| } |
| |
| template<> Internals::AutoFillButtonType convert<Internals::AutoFillButtonType>(ExecState& state, JSValue value) |
| { |
| VM& vm = state.vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto result = parse<Internals::AutoFillButtonType>(state, value); |
| if (UNLIKELY(!result)) { |
| throwTypeError(&state, throwScope); |
| return { }; |
| } |
| return result.value(); |
| } |
| |
| template<> inline const char* expectedEnumerationValues<Internals::AutoFillButtonType>() |
| { |
| return "\"AutoFillButtonTypeNone\", \"AutoFillButtonTypeContacts\", \"AutoFillButtonTypeCredentials\""; |
| } |
| |
| JSString* jsStringWithCache(ExecState*, Internals::UserInterfaceLayoutDirection); |
| |
| JSString* jsStringWithCache(ExecState* state, Internals::UserInterfaceLayoutDirection enumerationValue) |
| { |
| static NeverDestroyed<const String> values[] = { |
| ASCIILiteral("LTR"), |
| ASCIILiteral("RTL"), |
| }; |
| static_assert(static_cast<size_t>(Internals::UserInterfaceLayoutDirection::LTR) == 0, "Internals::UserInterfaceLayoutDirection::LTR is not 0 as expected"); |
| static_assert(static_cast<size_t>(Internals::UserInterfaceLayoutDirection::RTL) == 1, "Internals::UserInterfaceLayoutDirection::RTL is not 1 as expected"); |
| ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)); |
| return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]); |
| } |
| |
| template<> struct JSValueTraits<Internals::UserInterfaceLayoutDirection> { |
| static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, Internals::UserInterfaceLayoutDirection value) { return jsStringWithCache(state, value); } |
| }; |
| |
| template<> Optional<Internals::UserInterfaceLayoutDirection> parse<Internals::UserInterfaceLayoutDirection>(ExecState& state, JSValue value) |
| { |
| auto stringValue = value.toWTFString(&state); |
| if (stringValue == "LTR") |
| return Internals::UserInterfaceLayoutDirection::LTR; |
| if (stringValue == "RTL") |
| return Internals::UserInterfaceLayoutDirection::RTL; |
| return Nullopt; |
| } |
| |
| template<> Internals::UserInterfaceLayoutDirection convert<Internals::UserInterfaceLayoutDirection>(ExecState& state, JSValue value) |
| { |
| VM& vm = state.vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto result = parse<Internals::UserInterfaceLayoutDirection>(state, value); |
| if (UNLIKELY(!result)) { |
| throwTypeError(&state, throwScope); |
| return { }; |
| } |
| return result.value(); |
| } |
| |
| template<> inline const char* expectedEnumerationValues<Internals::UserInterfaceLayoutDirection>() |
| { |
| return "\"LTR\", \"RTL\""; |
| } |
| |
| // Functions |
| |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAddress(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNodeNeedsStyleRecalc(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStyleChangeType(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionDescription(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHasPausedImageAnimations(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionElementRenderTreeAsText(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPreloaded(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsLoadingFromMemoryCache(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionXhrResponseSource(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsSharingStyleSheetContents(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsStyleSheetLoadingSubresources(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionClearMemoryCache(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPruneMemoryCacheToSize(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMemoryCacheSize(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetOverrideCachePolicy(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetOverrideResourceLoadPriority(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetStrictRawResourceValidationPolicyDisabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionClearPageCache(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageCacheSize(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionComputedStyleIncludingVisitedInfo(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnsureShadowRoot(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnsureUserAgentShadowRoot(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCreateShadowRoot(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionShadowRoot(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionShadowRootType(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionShadowPseudoId(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetShadowPseudoId(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionTreeScopeRootNode(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionParentTreeScope(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLastSpatialNavigationCandidateCount(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfActiveAnimations(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSuspendAnimations(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionResumeAnimations(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAnimationsAreSuspended(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPauseAnimationAtTimeOnElement(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPauseAnimationAtTimeOnPseudoElement(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPauseTransitionAtTimeOnElement(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPauseTransitionAtTimeOnPseudoElement(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionVisiblePlaceholder(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSelectColorInColorChooser(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionFormControlStateOfPreviousHistoryItem(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetFormControlStateOfPreviousHistoryItem(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAbsoluteCaretBounds(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionBoundingBox(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInspectorHighlightRects(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInspectorHighlightObject(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMarkerCountForNode(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMarkerRangeForNode(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMarkerDescriptionForNode(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionDumpMarkerRects(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAddTextMatchMarker(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMarkedTextMatchesAreHighlighted(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInvalidateFontCache(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetScrollViewPosition(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetViewBaseBackgroundColor(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPagination(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPaginationLineGridEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionConfigurationForViewport(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionWasLastChangeUserEdit(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionElementShouldAutoComplete(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetEditingValue(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutofilled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetShowAutoFillButton(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCountMatchesForText(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCountFindMatches(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAutofillFieldName(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPaintControlTints(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionScrollElementToRect(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRangeFromLocationAndLength(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLocationFromRange(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLengthFromRange(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRangeAsText(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSubrange(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRangeForDictionaryLookupAtLocation(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetDelegatesScrolling(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLastSpellCheckRequestSequence(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLastSpellCheckProcessedSequence(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUserPreferredLanguages(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUserPreferredLanguages(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUserPreferredAudioCharacteristics(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUserPreferredAudioCharacteristic(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionWheelEventHandlerCount(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionTouchEventHandlerCount(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNodesFromRect(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionParserMetaData(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUpdateEditorUINowIfScheduled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHasSpellingMarker(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHasGrammarMarker(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHasAutocorrectedMarker(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetContinuousSpellCheckingEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticQuoteSubstitutionEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticLinkDetectionEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticDashSubstitutionEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticTextReplacementEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticSpellingCorrectionEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHandleAcceptedCandidate(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsOverwriteModeEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionToggleOverwriteModeEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfScrollableAreas(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPageBoxVisible(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionImageFrameIndex(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLayerTreeAsText(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionScrollingStateTreeAsText(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMainThreadScrollingReasons(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNonFastScrollableRects(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRepaintRectsAsText(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetElementUsesDisplayListDrawing(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetElementTracksDisplayListReplay(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionDisplayListForElement(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionReplayDisplayListForElement(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGarbageCollectDocumentResources(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInsertAuthorCSS(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInsertUserCSS(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionBeginSimulatedMemoryPressure(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEndSimulatedMemoryPressure(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfLiveNodes(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfLiveDocuments(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionOpenDummyInspectorFrontend(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCloseDummyInspectorFrontend(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetInspectorIsUnderTest(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCounterValue(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageNumber(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionShortcutIconURLs(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfPages(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageProperty(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageSizeAndMarginsInPixels(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPageScaleFactor(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPageZoomFactor(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetTextZoomFactor(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUseFixedLayout(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetFixedLayoutSize(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetViewExposedRect(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetHeaderHeight(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetFooterHeight(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetTopContentInset(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetApplicationCacheOriginQuota(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRegisterURLSchemeAsBypassingContentSecurityPolicy(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRemoveURLSchemeRegisteredAsBypassingContentSecurityPolicy(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMallocStatistics(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionTypeConversions(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMemoryInfo(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGetReferencedFilePaths(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStartTrackingRepaints(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStopTrackingRepaints(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStartTrackingLayerFlushes(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLayerFlushCount(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsTimerThrottled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsRequestAnimationFrameThrottled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAreTimersThrottled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStartTrackingStyleRecalcs(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStyleRecalcCount(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStartTrackingCompositingUpdates(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCompositingUpdateCount(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUpdateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGetCurrentCursorInfo(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMarkerTextForListItem(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionToolTipFromElement(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionDeserializeBuffer(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSerializeObject(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsFromCurrentWorld(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUsesOverlayScrollbars(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUsesMockScrollAnimator(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionForceReload(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnableAutoSizeMode(JSC::ExecState*); |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSimulateAudioInterruption(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMediaElementHasCharacteristic(JSC::ExecState*); |
| #endif |
| #if ENABLE(ENCRYPTED_MEDIA_V2) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInitializeMockCDM(JSC::ExecState*); |
| #endif |
| #if ENABLE(SPEECH_SYNTHESIS) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnableMockSpeechSynthesizer(JSC::ExecState*); |
| #endif |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGetImageSourceURL(JSC::ExecState*); |
| #if ENABLE(VIDEO_TRACK) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCaptionsStyleSheetOverride(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO_TRACK) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetCaptionsStyleSheetOverride(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO_TRACK) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPrimaryAudioTrackLanguageOverride(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO_TRACK) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetCaptionDisplayMode(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCreateTimeRanges(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionClosestTimeToTimeRanges(JSC::ExecState*); |
| #endif |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsSelectPopupVisible(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPluginUnavailabilityIndicatorObscured(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPluginSnapshotted(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSelectionBounds(JSC::ExecState*); |
| #if ENABLE(MEDIA_SOURCE) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInitializeMockMediaSource(JSC::ExecState*); |
| #endif |
| #if ENABLE(MEDIA_SOURCE) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionBufferedSamplesForTrackID(JSC::ExecState*); |
| #endif |
| #if ENABLE(MEDIA_SOURCE) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnqueuedSamplesForTrackID(JSC::ExecState*); |
| #endif |
| #if ENABLE(MEDIA_SOURCE) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetShouldGenerateTimestamps(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionBeginMediaSessionInterruption(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEndMediaSessionInterruption(JSC::ExecState*); |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSendMediaSessionStartOfInterruptionNotification(JSC::ExecState*); |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSendMediaSessionEndOfInterruptionNotification(JSC::ExecState*); |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMediaSessionCurrentState(JSC::ExecState*); |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMediaElementPlayerVolume(JSC::ExecState*); |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSendMediaControlEvent(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionApplicationDidEnterForeground(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionApplicationWillEnterBackground(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMediaSessionRestrictions(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMediaElementRestrictions(JSC::ExecState*); |
| #endif |
| #if ENABLE(WEB_AUDIO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAudioContextRestrictions(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPostRemoteControlCommand(JSC::ExecState*); |
| #endif |
| #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMockMediaPlaybackTargetPickerEnabled(JSC::ExecState*); |
| #endif |
| #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMockMediaPlaybackTargetPickerState(JSC::ExecState*); |
| #endif |
| #if ENABLE(MEDIA_STREAM) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMockMediaCaptureDevicesEnabled(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSimulateSystemSleep(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSimulateSystemWake(JSC::ExecState*); |
| #endif |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionElementIsBlockingDisplaySleep(JSC::ExecState*); |
| #endif |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInstallMockPageOverlay(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageOverlayLayerTreeAsText(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPageMuted(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPagePlayingAudio(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPageDefersLoading(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCreateFile(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionQueueMicroTask(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionTestPreloaderSettingViewport(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPathStringWithShrinkWrappedRects(JSC::ExecState*); |
| #if ENABLE(VIDEO) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGetCurrentMediaControlsStatusForElement(JSC::ExecState*); |
| #endif |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUserVisibleString(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetShowAllPlugins(JSC::ExecState*); |
| #if ENABLE(READABLE_STREAM_API) |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsReadableStreamDisturbed(JSC::ExecState*); |
| #endif |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionResourceLoadStatisticsForOrigin(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetResourceLoadStatisticsEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetCanShowModalDialogOverride(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionComposedTreeAsText(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetLinkPreloadSupport(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetCSSGridLayoutEnabled(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetResourceTimingSupport(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsProcessingUserGesture(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionObserveGC(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUserInterfaceLayoutDirection(JSC::ExecState*); |
| |
| // Attributes |
| |
| JSC::EncodedJSValue jsInternalsSettings(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsInternalsWorkerThreadCount(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsInternalsIsUnderMemoryPressure(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsInternalsLayoutCount(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| #if ENABLE(CONTENT_FILTERING) |
| JSC::EncodedJSValue jsInternalsMockContentFilterSettings(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| #endif |
| bool setJSInternalsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| |
| class JSInternalsPrototype : public JSC::JSNonFinalObject { |
| public: |
| typedef JSC::JSNonFinalObject Base; |
| static JSInternalsPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSInternalsPrototype* ptr = new (NotNull, JSC::allocateCell<JSInternalsPrototype>(vm.heap)) JSInternalsPrototype(vm, globalObject, structure); |
| ptr->finishCreation(vm); |
| return ptr; |
| } |
| |
| DECLARE_INFO; |
| static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| { |
| return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| } |
| |
| private: |
| JSInternalsPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| : JSC::JSNonFinalObject(vm, structure) |
| { |
| } |
| |
| void finishCreation(JSC::VM&); |
| }; |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSInternalsPrototypeTableValues[] = |
| { |
| { "settings", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsInternalsSettings), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "workerThreadCount", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsInternalsWorkerThreadCount), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "isUnderMemoryPressure", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsInternalsIsUnderMemoryPressure), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "layoutCount", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsInternalsLayoutCount), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #if ENABLE(CONTENT_FILTERING) |
| { "mockContentFilterSettings", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsInternalsMockContentFilterSettings), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| { "address", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionAddress), (intptr_t) (1) } }, |
| { "nodeNeedsStyleRecalc", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionNodeNeedsStyleRecalc), (intptr_t) (1) } }, |
| { "styleChangeType", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionStyleChangeType), (intptr_t) (1) } }, |
| { "description", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionDescription), (intptr_t) (1) } }, |
| { "hasPausedImageAnimations", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionHasPausedImageAnimations), (intptr_t) (1) } }, |
| { "elementRenderTreeAsText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionElementRenderTreeAsText), (intptr_t) (1) } }, |
| { "isPreloaded", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsPreloaded), (intptr_t) (1) } }, |
| { "isLoadingFromMemoryCache", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsLoadingFromMemoryCache), (intptr_t) (1) } }, |
| { "xhrResponseSource", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionXhrResponseSource), (intptr_t) (1) } }, |
| { "isSharingStyleSheetContents", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsSharingStyleSheetContents), (intptr_t) (2) } }, |
| { "isStyleSheetLoadingSubresources", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsStyleSheetLoadingSubresources), (intptr_t) (1) } }, |
| { "clearMemoryCache", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionClearMemoryCache), (intptr_t) (0) } }, |
| { "pruneMemoryCacheToSize", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPruneMemoryCacheToSize), (intptr_t) (1) } }, |
| { "memoryCacheSize", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMemoryCacheSize), (intptr_t) (0) } }, |
| { "setOverrideCachePolicy", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetOverrideCachePolicy), (intptr_t) (1) } }, |
| { "setOverrideResourceLoadPriority", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetOverrideResourceLoadPriority), (intptr_t) (1) } }, |
| { "setStrictRawResourceValidationPolicyDisabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetStrictRawResourceValidationPolicyDisabled), (intptr_t) (1) } }, |
| { "clearPageCache", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionClearPageCache), (intptr_t) (0) } }, |
| { "pageCacheSize", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPageCacheSize), (intptr_t) (0) } }, |
| { "computedStyleIncludingVisitedInfo", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionComputedStyleIncludingVisitedInfo), (intptr_t) (1) } }, |
| { "ensureShadowRoot", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionEnsureShadowRoot), (intptr_t) (1) } }, |
| { "ensureUserAgentShadowRoot", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionEnsureUserAgentShadowRoot), (intptr_t) (1) } }, |
| { "createShadowRoot", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionCreateShadowRoot), (intptr_t) (1) } }, |
| { "shadowRoot", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionShadowRoot), (intptr_t) (1) } }, |
| { "shadowRootType", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionShadowRootType), (intptr_t) (1) } }, |
| { "shadowPseudoId", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionShadowPseudoId), (intptr_t) (1) } }, |
| { "setShadowPseudoId", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetShadowPseudoId), (intptr_t) (2) } }, |
| { "treeScopeRootNode", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionTreeScopeRootNode), (intptr_t) (1) } }, |
| { "parentTreeScope", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionParentTreeScope), (intptr_t) (1) } }, |
| { "lastSpatialNavigationCandidateCount", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionLastSpatialNavigationCandidateCount), (intptr_t) (0) } }, |
| { "numberOfActiveAnimations", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionNumberOfActiveAnimations), (intptr_t) (0) } }, |
| { "suspendAnimations", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSuspendAnimations), (intptr_t) (0) } }, |
| { "resumeAnimations", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionResumeAnimations), (intptr_t) (0) } }, |
| { "animationsAreSuspended", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionAnimationsAreSuspended), (intptr_t) (0) } }, |
| { "pauseAnimationAtTimeOnElement", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPauseAnimationAtTimeOnElement), (intptr_t) (3) } }, |
| { "pauseAnimationAtTimeOnPseudoElement", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPauseAnimationAtTimeOnPseudoElement), (intptr_t) (4) } }, |
| { "pauseTransitionAtTimeOnElement", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPauseTransitionAtTimeOnElement), (intptr_t) (3) } }, |
| { "pauseTransitionAtTimeOnPseudoElement", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPauseTransitionAtTimeOnPseudoElement), (intptr_t) (4) } }, |
| { "visiblePlaceholder", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionVisiblePlaceholder), (intptr_t) (1) } }, |
| { "selectColorInColorChooser", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSelectColorInColorChooser), (intptr_t) (2) } }, |
| { "formControlStateOfPreviousHistoryItem", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionFormControlStateOfPreviousHistoryItem), (intptr_t) (0) } }, |
| { "setFormControlStateOfPreviousHistoryItem", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetFormControlStateOfPreviousHistoryItem), (intptr_t) (1) } }, |
| { "absoluteCaretBounds", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionAbsoluteCaretBounds), (intptr_t) (0) } }, |
| { "boundingBox", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionBoundingBox), (intptr_t) (1) } }, |
| { "inspectorHighlightRects", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionInspectorHighlightRects), (intptr_t) (0) } }, |
| { "inspectorHighlightObject", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionInspectorHighlightObject), (intptr_t) (0) } }, |
| { "markerCountForNode", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMarkerCountForNode), (intptr_t) (2) } }, |
| { "markerRangeForNode", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMarkerRangeForNode), (intptr_t) (3) } }, |
| { "markerDescriptionForNode", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMarkerDescriptionForNode), (intptr_t) (3) } }, |
| { "dumpMarkerRects", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionDumpMarkerRects), (intptr_t) (1) } }, |
| { "addTextMatchMarker", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionAddTextMatchMarker), (intptr_t) (2) } }, |
| { "setMarkedTextMatchesAreHighlighted", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetMarkedTextMatchesAreHighlighted), (intptr_t) (1) } }, |
| { "invalidateFontCache", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionInvalidateFontCache), (intptr_t) (0) } }, |
| { "setScrollViewPosition", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetScrollViewPosition), (intptr_t) (2) } }, |
| { "setViewBaseBackgroundColor", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetViewBaseBackgroundColor), (intptr_t) (1) } }, |
| { "setPagination", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetPagination), (intptr_t) (2) } }, |
| { "setPaginationLineGridEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetPaginationLineGridEnabled), (intptr_t) (1) } }, |
| { "configurationForViewport", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionConfigurationForViewport), (intptr_t) (5) } }, |
| { "wasLastChangeUserEdit", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionWasLastChangeUserEdit), (intptr_t) (1) } }, |
| { "elementShouldAutoComplete", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionElementShouldAutoComplete), (intptr_t) (1) } }, |
| { "setEditingValue", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetEditingValue), (intptr_t) (2) } }, |
| { "setAutofilled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetAutofilled), (intptr_t) (2) } }, |
| { "setShowAutoFillButton", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetShowAutoFillButton), (intptr_t) (2) } }, |
| { "countMatchesForText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionCountMatchesForText), (intptr_t) (3) } }, |
| { "countFindMatches", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionCountFindMatches), (intptr_t) (2) } }, |
| { "autofillFieldName", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionAutofillFieldName), (intptr_t) (1) } }, |
| { "paintControlTints", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPaintControlTints), (intptr_t) (0) } }, |
| { "scrollElementToRect", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionScrollElementToRect), (intptr_t) (5) } }, |
| { "rangeFromLocationAndLength", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionRangeFromLocationAndLength), (intptr_t) (3) } }, |
| { "locationFromRange", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionLocationFromRange), (intptr_t) (2) } }, |
| { "lengthFromRange", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionLengthFromRange), (intptr_t) (2) } }, |
| { "rangeAsText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionRangeAsText), (intptr_t) (1) } }, |
| { "subrange", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSubrange), (intptr_t) (3) } }, |
| { "rangeForDictionaryLookupAtLocation", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionRangeForDictionaryLookupAtLocation), (intptr_t) (2) } }, |
| { "setDelegatesScrolling", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetDelegatesScrolling), (intptr_t) (1) } }, |
| { "lastSpellCheckRequestSequence", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionLastSpellCheckRequestSequence), (intptr_t) (0) } }, |
| { "lastSpellCheckProcessedSequence", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionLastSpellCheckProcessedSequence), (intptr_t) (0) } }, |
| { "userPreferredLanguages", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionUserPreferredLanguages), (intptr_t) (0) } }, |
| { "setUserPreferredLanguages", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetUserPreferredLanguages), (intptr_t) (1) } }, |
| { "userPreferredAudioCharacteristics", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionUserPreferredAudioCharacteristics), (intptr_t) (0) } }, |
| { "setUserPreferredAudioCharacteristic", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetUserPreferredAudioCharacteristic), (intptr_t) (1) } }, |
| { "wheelEventHandlerCount", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionWheelEventHandlerCount), (intptr_t) (0) } }, |
| { "touchEventHandlerCount", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionTouchEventHandlerCount), (intptr_t) (0) } }, |
| { "nodesFromRect", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionNodesFromRect), (intptr_t) (10) } }, |
| { "parserMetaData", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionParserMetaData), (intptr_t) (0) } }, |
| { "updateEditorUINowIfScheduled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionUpdateEditorUINowIfScheduled), (intptr_t) (0) } }, |
| { "hasSpellingMarker", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionHasSpellingMarker), (intptr_t) (2) } }, |
| { "hasGrammarMarker", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionHasGrammarMarker), (intptr_t) (2) } }, |
| { "hasAutocorrectedMarker", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionHasAutocorrectedMarker), (intptr_t) (2) } }, |
| { "setContinuousSpellCheckingEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetContinuousSpellCheckingEnabled), (intptr_t) (1) } }, |
| { "setAutomaticQuoteSubstitutionEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetAutomaticQuoteSubstitutionEnabled), (intptr_t) (1) } }, |
| { "setAutomaticLinkDetectionEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetAutomaticLinkDetectionEnabled), (intptr_t) (1) } }, |
| { "setAutomaticDashSubstitutionEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetAutomaticDashSubstitutionEnabled), (intptr_t) (1) } }, |
| { "setAutomaticTextReplacementEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetAutomaticTextReplacementEnabled), (intptr_t) (1) } }, |
| { "setAutomaticSpellingCorrectionEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetAutomaticSpellingCorrectionEnabled), (intptr_t) (1) } }, |
| { "handleAcceptedCandidate", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionHandleAcceptedCandidate), (intptr_t) (3) } }, |
| { "isOverwriteModeEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsOverwriteModeEnabled), (intptr_t) (0) } }, |
| { "toggleOverwriteModeEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionToggleOverwriteModeEnabled), (intptr_t) (0) } }, |
| { "numberOfScrollableAreas", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionNumberOfScrollableAreas), (intptr_t) (0) } }, |
| { "isPageBoxVisible", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsPageBoxVisible), (intptr_t) (1) } }, |
| { "imageFrameIndex", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionImageFrameIndex), (intptr_t) (1) } }, |
| { "layerTreeAsText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionLayerTreeAsText), (intptr_t) (1) } }, |
| { "scrollingStateTreeAsText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionScrollingStateTreeAsText), (intptr_t) (0) } }, |
| { "mainThreadScrollingReasons", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMainThreadScrollingReasons), (intptr_t) (0) } }, |
| { "nonFastScrollableRects", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionNonFastScrollableRects), (intptr_t) (0) } }, |
| { "repaintRectsAsText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionRepaintRectsAsText), (intptr_t) (0) } }, |
| { "setElementUsesDisplayListDrawing", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetElementUsesDisplayListDrawing), (intptr_t) (2) } }, |
| { "setElementTracksDisplayListReplay", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetElementTracksDisplayListReplay), (intptr_t) (2) } }, |
| { "displayListForElement", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionDisplayListForElement), (intptr_t) (1) } }, |
| { "replayDisplayListForElement", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionReplayDisplayListForElement), (intptr_t) (1) } }, |
| { "garbageCollectDocumentResources", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionGarbageCollectDocumentResources), (intptr_t) (0) } }, |
| { "insertAuthorCSS", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionInsertAuthorCSS), (intptr_t) (1) } }, |
| { "insertUserCSS", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionInsertUserCSS), (intptr_t) (1) } }, |
| { "beginSimulatedMemoryPressure", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionBeginSimulatedMemoryPressure), (intptr_t) (0) } }, |
| { "endSimulatedMemoryPressure", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionEndSimulatedMemoryPressure), (intptr_t) (0) } }, |
| { "numberOfLiveNodes", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionNumberOfLiveNodes), (intptr_t) (0) } }, |
| { "numberOfLiveDocuments", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionNumberOfLiveDocuments), (intptr_t) (0) } }, |
| { "openDummyInspectorFrontend", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionOpenDummyInspectorFrontend), (intptr_t) (1) } }, |
| { "closeDummyInspectorFrontend", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionCloseDummyInspectorFrontend), (intptr_t) (0) } }, |
| { "setInspectorIsUnderTest", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetInspectorIsUnderTest), (intptr_t) (1) } }, |
| { "counterValue", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionCounterValue), (intptr_t) (1) } }, |
| { "pageNumber", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPageNumber), (intptr_t) (1) } }, |
| { "shortcutIconURLs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionShortcutIconURLs), (intptr_t) (0) } }, |
| { "numberOfPages", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionNumberOfPages), (intptr_t) (0) } }, |
| { "pageProperty", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPageProperty), (intptr_t) (2) } }, |
| { "pageSizeAndMarginsInPixels", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPageSizeAndMarginsInPixels), (intptr_t) (7) } }, |
| { "setPageScaleFactor", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetPageScaleFactor), (intptr_t) (3) } }, |
| { "setPageZoomFactor", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetPageZoomFactor), (intptr_t) (1) } }, |
| { "setTextZoomFactor", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetTextZoomFactor), (intptr_t) (1) } }, |
| { "setUseFixedLayout", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetUseFixedLayout), (intptr_t) (1) } }, |
| { "setFixedLayoutSize", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetFixedLayoutSize), (intptr_t) (2) } }, |
| { "setViewExposedRect", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetViewExposedRect), (intptr_t) (4) } }, |
| { "setHeaderHeight", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetHeaderHeight), (intptr_t) (1) } }, |
| { "setFooterHeight", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetFooterHeight), (intptr_t) (1) } }, |
| { "setTopContentInset", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetTopContentInset), (intptr_t) (1) } }, |
| { "setApplicationCacheOriginQuota", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetApplicationCacheOriginQuota), (intptr_t) (1) } }, |
| { "registerURLSchemeAsBypassingContentSecurityPolicy", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionRegisterURLSchemeAsBypassingContentSecurityPolicy), (intptr_t) (1) } }, |
| { "removeURLSchemeRegisteredAsBypassingContentSecurityPolicy", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionRemoveURLSchemeRegisteredAsBypassingContentSecurityPolicy), (intptr_t) (1) } }, |
| { "mallocStatistics", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMallocStatistics), (intptr_t) (0) } }, |
| { "typeConversions", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionTypeConversions), (intptr_t) (0) } }, |
| { "memoryInfo", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMemoryInfo), (intptr_t) (0) } }, |
| { "getReferencedFilePaths", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionGetReferencedFilePaths), (intptr_t) (0) } }, |
| { "startTrackingRepaints", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionStartTrackingRepaints), (intptr_t) (0) } }, |
| { "stopTrackingRepaints", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionStopTrackingRepaints), (intptr_t) (0) } }, |
| { "startTrackingLayerFlushes", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionStartTrackingLayerFlushes), (intptr_t) (0) } }, |
| { "layerFlushCount", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionLayerFlushCount), (intptr_t) (0) } }, |
| { "isTimerThrottled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsTimerThrottled), (intptr_t) (1) } }, |
| { "isRequestAnimationFrameThrottled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsRequestAnimationFrameThrottled), (intptr_t) (0) } }, |
| { "areTimersThrottled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionAreTimersThrottled), (intptr_t) (0) } }, |
| { "startTrackingStyleRecalcs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionStartTrackingStyleRecalcs), (intptr_t) (0) } }, |
| { "styleRecalcCount", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionStyleRecalcCount), (intptr_t) (0) } }, |
| { "startTrackingCompositingUpdates", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionStartTrackingCompositingUpdates), (intptr_t) (0) } }, |
| { "compositingUpdateCount", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionCompositingUpdateCount), (intptr_t) (0) } }, |
| { "updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionUpdateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks), (intptr_t) (0) } }, |
| { "getCurrentCursorInfo", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionGetCurrentCursorInfo), (intptr_t) (0) } }, |
| { "markerTextForListItem", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMarkerTextForListItem), (intptr_t) (1) } }, |
| { "toolTipFromElement", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionToolTipFromElement), (intptr_t) (1) } }, |
| { "deserializeBuffer", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionDeserializeBuffer), (intptr_t) (1) } }, |
| { "serializeObject", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSerializeObject), (intptr_t) (1) } }, |
| { "isFromCurrentWorld", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsFromCurrentWorld), (intptr_t) (1) } }, |
| { "setUsesOverlayScrollbars", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetUsesOverlayScrollbars), (intptr_t) (1) } }, |
| { "setUsesMockScrollAnimator", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetUsesMockScrollAnimator), (intptr_t) (1) } }, |
| { "forceReload", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionForceReload), (intptr_t) (1) } }, |
| { "enableAutoSizeMode", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionEnableAutoSizeMode), (intptr_t) (5) } }, |
| #if ENABLE(VIDEO) |
| { "simulateAudioInterruption", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSimulateAudioInterruption), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "mediaElementHasCharacteristic", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMediaElementHasCharacteristic), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(ENCRYPTED_MEDIA_V2) |
| { "initializeMockCDM", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionInitializeMockCDM), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(SPEECH_SYNTHESIS) |
| { "enableMockSpeechSynthesizer", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionEnableMockSpeechSynthesizer), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| { "getImageSourceURL", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionGetImageSourceURL), (intptr_t) (1) } }, |
| #if ENABLE(VIDEO_TRACK) |
| { "captionsStyleSheetOverride", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionCaptionsStyleSheetOverride), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO_TRACK) |
| { "setCaptionsStyleSheetOverride", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetCaptionsStyleSheetOverride), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO_TRACK) |
| { "setPrimaryAudioTrackLanguageOverride", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetPrimaryAudioTrackLanguageOverride), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO_TRACK) |
| { "setCaptionDisplayMode", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetCaptionDisplayMode), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "createTimeRanges", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionCreateTimeRanges), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "closestTimeToTimeRanges", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionClosestTimeToTimeRanges), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| { "isSelectPopupVisible", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsSelectPopupVisible), (intptr_t) (1) } }, |
| { "isPluginUnavailabilityIndicatorObscured", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsPluginUnavailabilityIndicatorObscured), (intptr_t) (1) } }, |
| { "isPluginSnapshotted", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsPluginSnapshotted), (intptr_t) (1) } }, |
| { "selectionBounds", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSelectionBounds), (intptr_t) (0) } }, |
| #if ENABLE(MEDIA_SOURCE) |
| { "initializeMockMediaSource", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionInitializeMockMediaSource), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(MEDIA_SOURCE) |
| { "bufferedSamplesForTrackID", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionBufferedSamplesForTrackID), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(MEDIA_SOURCE) |
| { "enqueuedSamplesForTrackID", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionEnqueuedSamplesForTrackID), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(MEDIA_SOURCE) |
| { "setShouldGenerateTimestamps", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetShouldGenerateTimestamps), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "beginMediaSessionInterruption", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionBeginMediaSessionInterruption), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "endMediaSessionInterruption", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionEndMediaSessionInterruption), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| { "sendMediaSessionStartOfInterruptionNotification", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSendMediaSessionStartOfInterruptionNotification), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| { "sendMediaSessionEndOfInterruptionNotification", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSendMediaSessionEndOfInterruptionNotification), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| { "mediaSessionCurrentState", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMediaSessionCurrentState), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| { "mediaElementPlayerVolume", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionMediaElementPlayerVolume), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(MEDIA_SESSION) |
| { "sendMediaControlEvent", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSendMediaControlEvent), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "applicationDidEnterForeground", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionApplicationDidEnterForeground), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "applicationWillEnterBackground", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionApplicationWillEnterBackground), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "setMediaSessionRestrictions", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetMediaSessionRestrictions), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "setMediaElementRestrictions", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetMediaElementRestrictions), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(WEB_AUDIO) |
| { "setAudioContextRestrictions", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetAudioContextRestrictions), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "postRemoteControlCommand", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPostRemoteControlCommand), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| { "setMockMediaPlaybackTargetPickerEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetMockMediaPlaybackTargetPickerEnabled), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| { "setMockMediaPlaybackTargetPickerState", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetMockMediaPlaybackTargetPickerState), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(MEDIA_STREAM) |
| { "setMockMediaCaptureDevicesEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetMockMediaCaptureDevicesEnabled), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "simulateSystemSleep", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSimulateSystemSleep), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "simulateSystemWake", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSimulateSystemWake), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(VIDEO) |
| { "elementIsBlockingDisplaySleep", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionElementIsBlockingDisplaySleep), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| { "installMockPageOverlay", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionInstallMockPageOverlay), (intptr_t) (1) } }, |
| { "pageOverlayLayerTreeAsText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPageOverlayLayerTreeAsText), (intptr_t) (0) } }, |
| { "setPageMuted", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetPageMuted), (intptr_t) (1) } }, |
| { "isPagePlayingAudio", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsPagePlayingAudio), (intptr_t) (0) } }, |
| { "setPageDefersLoading", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetPageDefersLoading), (intptr_t) (1) } }, |
| { "createFile", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionCreateFile), (intptr_t) (1) } }, |
| { "queueMicroTask", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionQueueMicroTask), (intptr_t) (1) } }, |
| { "testPreloaderSettingViewport", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionTestPreloaderSettingViewport), (intptr_t) (0) } }, |
| { "pathStringWithShrinkWrappedRects", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionPathStringWithShrinkWrappedRects), (intptr_t) (2) } }, |
| #if ENABLE(VIDEO) |
| { "getCurrentMediaControlsStatusForElement", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionGetCurrentMediaControlsStatusForElement), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| { "userVisibleString", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionUserVisibleString), (intptr_t) (1) } }, |
| { "setShowAllPlugins", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetShowAllPlugins), (intptr_t) (1) } }, |
| #if ENABLE(READABLE_STREAM_API) |
| { "isReadableStreamDisturbed", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsReadableStreamDisturbed), (intptr_t) (1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| { "resourceLoadStatisticsForOrigin", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionResourceLoadStatisticsForOrigin), (intptr_t) (1) } }, |
| { "setResourceLoadStatisticsEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetResourceLoadStatisticsEnabled), (intptr_t) (1) } }, |
| { "setCanShowModalDialogOverride", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetCanShowModalDialogOverride), (intptr_t) (1) } }, |
| { "composedTreeAsText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionComposedTreeAsText), (intptr_t) (1) } }, |
| { "setLinkPreloadSupport", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetLinkPreloadSupport), (intptr_t) (1) } }, |
| { "setCSSGridLayoutEnabled", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetCSSGridLayoutEnabled), (intptr_t) (1) } }, |
| { "setResourceTimingSupport", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetResourceTimingSupport), (intptr_t) (1) } }, |
| { "isProcessingUserGesture", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionIsProcessingUserGesture), (intptr_t) (0) } }, |
| { "observeGC", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionObserveGC), (intptr_t) (1) } }, |
| { "setUserInterfaceLayoutDirection", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInternalsPrototypeFunctionSetUserInterfaceLayoutDirection), (intptr_t) (1) } }, |
| { "LAYER_TREE_INCLUDES_VISIBLE_RECTS", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| { "LAYER_TREE_INCLUDES_TILE_CACHES", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| { "LAYER_TREE_INCLUDES_REPAINT_RECTS", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } }, |
| { "LAYER_TREE_INCLUDES_PAINTING_PHASES", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(8) } }, |
| { "LAYER_TREE_INCLUDES_CONTENT_LAYERS", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(16) } }, |
| { "DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| }; |
| |
| const ClassInfo JSInternalsPrototype::s_info = { "InternalsPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSInternalsPrototype) }; |
| |
| void JSInternalsPrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSInternalsPrototypeTableValues, *this); |
| } |
| |
| const ClassInfo JSInternals::s_info = { "Internals", &Base::s_info, 0, CREATE_METHOD_TABLE(JSInternals) }; |
| |
| JSInternals::JSInternals(Structure* structure, JSDOMGlobalObject& globalObject, Ref<Internals>&& impl) |
| : JSDOMWrapper<Internals>(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| JSObject* JSInternals::createPrototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return JSInternalsPrototype::create(vm, globalObject, JSInternalsPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); |
| } |
| |
| JSObject* JSInternals::prototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSInternals>(vm, globalObject); |
| } |
| |
| void JSInternals::destroy(JSC::JSCell* cell) |
| { |
| JSInternals* thisObject = static_cast<JSInternals*>(cell); |
| thisObject->JSInternals::~JSInternals(); |
| } |
| |
| EncodedJSValue jsInternalsSettings(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSInternals*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "Internals", "settings"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.settings()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsInternalsWorkerThreadCount(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSInternals*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "Internals", "workerThreadCount"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsNumber(impl.workerThreadCount()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsInternalsIsUnderMemoryPressure(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSInternals*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "Internals", "isUnderMemoryPressure"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsBoolean(impl.isUnderMemoryPressure()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsInternalsLayoutCount(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSInternals*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "Internals", "layoutCount"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsNumber(impl.layoutCount()); |
| return JSValue::encode(result); |
| } |
| |
| |
| #if ENABLE(CONTENT_FILTERING) |
| EncodedJSValue jsInternalsMockContentFilterSettings(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSInternals*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "Internals", "mockContentFilterSettings"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.mockContentFilterSettings()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| bool setJSInternalsConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSValue value = JSValue::decode(encodedValue); |
| JSInternalsPrototype* domObject = jsDynamicCast<JSInternalsPrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) { |
| throwVMTypeError(state, throwScope); |
| return false; |
| } |
| // Shadowing a built-in constructor |
| return domObject->putDirect(state->vm(), state->propertyNames().constructor, value); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAddress(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "address"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto node = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!node)) |
| return throwArgumentTypeError(*state, throwScope, 0, "node", "Internals", "address", "Node"); |
| JSValue result = jsStringWithCache(state, impl.address(*node)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNodeNeedsStyleRecalc(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "nodeNeedsStyleRecalc"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto node = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!node)) |
| return throwArgumentTypeError(*state, throwScope, 0, "node", "Internals", "nodeNeedsStyleRecalc", "Node"); |
| JSValue result = jsBoolean(impl.nodeNeedsStyleRecalc(*node)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStyleChangeType(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "styleChangeType"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto node = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!node)) |
| return throwArgumentTypeError(*state, throwScope, 0, "node", "Internals", "styleChangeType", "Node"); |
| JSValue result = jsStringWithCache(state, impl.styleChangeType(*node)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionDescription(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "description"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto value = state->uncheckedArgument(0); |
| JSValue result = jsStringWithCache(state, impl.description(WTFMove(value))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHasPausedImageAnimations(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "hasPausedImageAnimations"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "hasPausedImageAnimations", "Element"); |
| JSValue result = jsBoolean(impl.hasPausedImageAnimations(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionElementRenderTreeAsText(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "elementRenderTreeAsText"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "elementRenderTreeAsText", "Element"); |
| JSValue result = jsStringWithCache(state, impl.elementRenderTreeAsText(*element, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPreloaded(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isPreloaded"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto url = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.isPreloaded(WTFMove(url))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsLoadingFromMemoryCache(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isLoadingFromMemoryCache"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto url = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.isLoadingFromMemoryCache(WTFMove(url))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionXhrResponseSource(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "xhrResponseSource"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto xhr = JSXMLHttpRequest::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!xhr)) |
| return throwArgumentTypeError(*state, throwScope, 0, "xhr", "Internals", "xhrResponseSource", "XMLHttpRequest"); |
| JSValue result = jsStringWithCache(state, impl.xhrResponseSource(*xhr)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsSharingStyleSheetContents(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isSharingStyleSheetContents"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto a = JSHTMLLinkElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!a)) |
| return throwArgumentTypeError(*state, throwScope, 0, "a", "Internals", "isSharingStyleSheetContents", "HTMLLinkElement"); |
| auto b = JSHTMLLinkElement::toWrapped(state->uncheckedArgument(1)); |
| if (UNLIKELY(!b)) |
| return throwArgumentTypeError(*state, throwScope, 1, "b", "Internals", "isSharingStyleSheetContents", "HTMLLinkElement"); |
| JSValue result = jsBoolean(impl.isSharingStyleSheetContents(*a, *b)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsStyleSheetLoadingSubresources(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isStyleSheetLoadingSubresources"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto link = JSHTMLLinkElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!link)) |
| return throwArgumentTypeError(*state, throwScope, 0, "link", "Internals", "isStyleSheetLoadingSubresources", "HTMLLinkElement"); |
| JSValue result = jsBoolean(impl.isStyleSheetLoadingSubresources(*link)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionClearMemoryCache(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "clearMemoryCache"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.clearMemoryCache(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPruneMemoryCacheToSize(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pruneMemoryCacheToSize"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto size = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.pruneMemoryCacheToSize(WTFMove(size)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMemoryCacheSize(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "memoryCacheSize"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsNumber(impl.memoryCacheSize()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetOverrideCachePolicy(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setOverrideCachePolicy"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto policyValue = state->uncheckedArgument(0); |
| Internals::CachePolicy policy; |
| auto optionalValue = parse<Internals::CachePolicy>(*state, policyValue); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!optionalValue)) |
| return throwArgumentMustBeEnumError(*state, throwScope, 0, "policy", "Internals", "setOverrideCachePolicy", expectedEnumerationValues<Internals::CachePolicy>()); |
| policy = optionalValue.value(); |
| impl.setOverrideCachePolicy(policy); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetOverrideResourceLoadPriority(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setOverrideResourceLoadPriority"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto priorityValue = state->uncheckedArgument(0); |
| Internals::ResourceLoadPriority priority; |
| auto optionalValue = parse<Internals::ResourceLoadPriority>(*state, priorityValue); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!optionalValue)) |
| return throwArgumentMustBeEnumError(*state, throwScope, 0, "priority", "Internals", "setOverrideResourceLoadPriority", expectedEnumerationValues<Internals::ResourceLoadPriority>()); |
| priority = optionalValue.value(); |
| impl.setOverrideResourceLoadPriority(priority); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetStrictRawResourceValidationPolicyDisabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setStrictRawResourceValidationPolicyDisabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto disabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setStrictRawResourceValidationPolicyDisabled(WTFMove(disabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionClearPageCache(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "clearPageCache"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.clearPageCache(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageCacheSize(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pageCacheSize"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsNumber(impl.pageCacheSize()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionComputedStyleIncludingVisitedInfo(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "computedStyleIncludingVisitedInfo"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "computedStyleIncludingVisitedInfo", "Element"); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.computedStyleIncludingVisitedInfo(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnsureShadowRoot(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "ensureShadowRoot"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto host = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!host)) |
| return throwArgumentTypeError(*state, throwScope, 0, "host", "Internals", "ensureShadowRoot", "Element"); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.ensureShadowRoot(*host, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnsureUserAgentShadowRoot(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "ensureUserAgentShadowRoot"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto host = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!host)) |
| return throwArgumentTypeError(*state, throwScope, 0, "host", "Internals", "ensureUserAgentShadowRoot", "Element"); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.ensureUserAgentShadowRoot(*host)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCreateShadowRoot(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "createShadowRoot"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto host = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!host)) |
| return throwArgumentTypeError(*state, throwScope, 0, "host", "Internals", "createShadowRoot", "Element"); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.createShadowRoot(*host, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionShadowRoot(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "shadowRoot"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto host = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!host)) |
| return throwArgumentTypeError(*state, throwScope, 0, "host", "Internals", "shadowRoot", "Element"); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.shadowRoot(*host)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionShadowRootType(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "shadowRootType"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto root = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!root)) |
| return throwArgumentTypeError(*state, throwScope, 0, "root", "Internals", "shadowRootType", "Node"); |
| JSValue result = jsStringWithCache(state, impl.shadowRootType(*root, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionShadowPseudoId(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "shadowPseudoId"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "shadowPseudoId", "Element"); |
| JSValue result = jsStringWithCache(state, impl.shadowPseudoId(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetShadowPseudoId(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setShadowPseudoId"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "setShadowPseudoId", "Element"); |
| auto id = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setShadowPseudoId(*element, WTFMove(id)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionTreeScopeRootNode(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "treeScopeRootNode"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto node = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!node)) |
| return throwArgumentTypeError(*state, throwScope, 0, "node", "Internals", "treeScopeRootNode", "Node"); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.treeScopeRootNode(*node)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionParentTreeScope(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "parentTreeScope"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto node = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!node)) |
| return throwArgumentTypeError(*state, throwScope, 0, "node", "Internals", "parentTreeScope", "Node"); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.parentTreeScope(*node)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLastSpatialNavigationCandidateCount(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "lastSpatialNavigationCandidateCount"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsNumber(impl.lastSpatialNavigationCandidateCount(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfActiveAnimations(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "numberOfActiveAnimations"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsNumber(impl.numberOfActiveAnimations()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSuspendAnimations(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "suspendAnimations"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.suspendAnimations(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionResumeAnimations(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "resumeAnimations"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.resumeAnimations(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAnimationsAreSuspended(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "animationsAreSuspended"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsBoolean(impl.animationsAreSuspended(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPauseAnimationAtTimeOnElement(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pauseAnimationAtTimeOnElement"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 3)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto animationName = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto pauseTime = convert<double>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(2)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 2, "element", "Internals", "pauseAnimationAtTimeOnElement", "Element"); |
| JSValue result = jsBoolean(impl.pauseAnimationAtTimeOnElement(WTFMove(animationName), WTFMove(pauseTime), *element, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPauseAnimationAtTimeOnPseudoElement(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pauseAnimationAtTimeOnPseudoElement"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 4)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto animationName = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto pauseTime = convert<double>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(2)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 2, "element", "Internals", "pauseAnimationAtTimeOnPseudoElement", "Element"); |
| auto pseudoId = state->uncheckedArgument(3).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.pauseAnimationAtTimeOnPseudoElement(WTFMove(animationName), WTFMove(pauseTime), *element, WTFMove(pseudoId), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPauseTransitionAtTimeOnElement(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pauseTransitionAtTimeOnElement"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 3)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto propertyName = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto pauseTime = convert<double>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(2)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 2, "element", "Internals", "pauseTransitionAtTimeOnElement", "Element"); |
| JSValue result = jsBoolean(impl.pauseTransitionAtTimeOnElement(WTFMove(propertyName), WTFMove(pauseTime), *element, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPauseTransitionAtTimeOnPseudoElement(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pauseTransitionAtTimeOnPseudoElement"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 4)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto property = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto pauseTime = convert<double>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(2)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 2, "element", "Internals", "pauseTransitionAtTimeOnPseudoElement", "Element"); |
| auto pseudoId = state->uncheckedArgument(3).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.pauseTransitionAtTimeOnPseudoElement(WTFMove(property), WTFMove(pauseTime), *element, WTFMove(pseudoId), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionVisiblePlaceholder(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "visiblePlaceholder"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "visiblePlaceholder", "Element"); |
| JSValue result = jsStringWithCache(state, impl.visiblePlaceholder(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSelectColorInColorChooser(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "selectColorInColorChooser"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSHTMLInputElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "selectColorInColorChooser", "HTMLInputElement"); |
| auto colorValue = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.selectColorInColorChooser(*element, WTFMove(colorValue)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionFormControlStateOfPreviousHistoryItem(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "formControlStateOfPreviousHistoryItem"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsArray(state, castedThis->globalObject(), impl.formControlStateOfPreviousHistoryItem(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetFormControlStateOfPreviousHistoryItem(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setFormControlStateOfPreviousHistoryItem"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto values = toNativeArray<String>(*state, state->uncheckedArgument(0)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setFormControlStateOfPreviousHistoryItem(WTFMove(values), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAbsoluteCaretBounds(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "absoluteCaretBounds"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = toJS(state, castedThis->globalObject(), impl.absoluteCaretBounds(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionBoundingBox(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "boundingBox"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "boundingBox", "Element"); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.boundingBox(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInspectorHighlightRects(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "inspectorHighlightRects"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = toJS(state, castedThis->globalObject(), impl.inspectorHighlightRects(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInspectorHighlightObject(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "inspectorHighlightObject"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsStringWithCache(state, impl.inspectorHighlightObject(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMarkerCountForNode(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "markerCountForNode"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto node = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!node)) |
| return throwArgumentTypeError(*state, throwScope, 0, "node", "Internals", "markerCountForNode", "Node"); |
| auto markerType = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsNumber(impl.markerCountForNode(*node, WTFMove(markerType), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMarkerRangeForNode(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "markerRangeForNode"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 3)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto node = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!node)) |
| return throwArgumentTypeError(*state, throwScope, 0, "node", "Internals", "markerRangeForNode", "Node"); |
| auto markerType = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto index = convert<uint32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.markerRangeForNode(*node, WTFMove(markerType), WTFMove(index), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMarkerDescriptionForNode(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "markerDescriptionForNode"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 3)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto node = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!node)) |
| return throwArgumentTypeError(*state, throwScope, 0, "node", "Internals", "markerDescriptionForNode", "Node"); |
| auto markerType = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto index = convert<uint32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.markerDescriptionForNode(*node, WTFMove(markerType), WTFMove(index), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionDumpMarkerRects(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "dumpMarkerRects"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto markerType = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.dumpMarkerRects(WTFMove(markerType), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAddTextMatchMarker(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "addTextMatchMarker"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto range = JSRange::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!range)) |
| return throwArgumentTypeError(*state, throwScope, 0, "range", "Internals", "addTextMatchMarker", "Range"); |
| auto isActive = state->uncheckedArgument(1).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.addTextMatchMarker(*range, WTFMove(isActive)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMarkedTextMatchesAreHighlighted(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setMarkedTextMatchesAreHighlighted"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto flag = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setMarkedTextMatchesAreHighlighted(WTFMove(flag), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInvalidateFontCache(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "invalidateFontCache"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.invalidateFontCache(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetScrollViewPosition(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setScrollViewPosition"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto x = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto y = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setScrollViewPosition(WTFMove(x), WTFMove(y), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetViewBaseBackgroundColor(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setViewBaseBackgroundColor"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto colorValue = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setViewBaseBackgroundColor(WTFMove(colorValue), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPagination(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setPagination"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto mode = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto gap = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto pageLength = convert<int32_t>(*state, state->argument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setPagination(WTFMove(mode), WTFMove(gap), WTFMove(pageLength), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPaginationLineGridEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setPaginationLineGridEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setPaginationLineGridEnabled(WTFMove(enabled), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionConfigurationForViewport(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "configurationForViewport"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 5)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto devicePixelRatio = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto deviceWidth = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto deviceHeight = convert<int32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto availableWidth = convert<int32_t>(*state, state->uncheckedArgument(3), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto availableHeight = convert<int32_t>(*state, state->uncheckedArgument(4), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.configurationForViewport(WTFMove(devicePixelRatio), WTFMove(deviceWidth), WTFMove(deviceHeight), WTFMove(availableWidth), WTFMove(availableHeight), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionWasLastChangeUserEdit(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "wasLastChangeUserEdit"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto textField = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!textField)) |
| return throwArgumentTypeError(*state, throwScope, 0, "textField", "Internals", "wasLastChangeUserEdit", "Element"); |
| JSValue result = jsBoolean(impl.wasLastChangeUserEdit(*textField, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionElementShouldAutoComplete(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "elementShouldAutoComplete"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto inputElement = JSHTMLInputElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!inputElement)) |
| return throwArgumentTypeError(*state, throwScope, 0, "inputElement", "Internals", "elementShouldAutoComplete", "HTMLInputElement"); |
| JSValue result = jsBoolean(impl.elementShouldAutoComplete(*inputElement)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetEditingValue(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setEditingValue"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto inputElement = JSHTMLInputElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!inputElement)) |
| return throwArgumentTypeError(*state, throwScope, 0, "inputElement", "Internals", "setEditingValue", "HTMLInputElement"); |
| auto value = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setEditingValue(*inputElement, WTFMove(value)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutofilled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setAutofilled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto inputElement = JSHTMLInputElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!inputElement)) |
| return throwArgumentTypeError(*state, throwScope, 0, "inputElement", "Internals", "setAutofilled", "HTMLInputElement"); |
| auto enabled = state->uncheckedArgument(1).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setAutofilled(*inputElement, WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetShowAutoFillButton(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setShowAutoFillButton"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto inputElement = JSHTMLInputElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!inputElement)) |
| return throwArgumentTypeError(*state, throwScope, 0, "inputElement", "Internals", "setShowAutoFillButton", "HTMLInputElement"); |
| auto autoFillButtonTypeValue = state->uncheckedArgument(1); |
| Internals::AutoFillButtonType autoFillButtonType; |
| auto optionalValue = parse<Internals::AutoFillButtonType>(*state, autoFillButtonTypeValue); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!optionalValue)) |
| return throwArgumentMustBeEnumError(*state, throwScope, 1, "autoFillButtonType", "Internals", "setShowAutoFillButton", expectedEnumerationValues<Internals::AutoFillButtonType>()); |
| autoFillButtonType = optionalValue.value(); |
| impl.setShowAutoFillButton(*inputElement, autoFillButtonType); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCountMatchesForText(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "countMatchesForText"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 3)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto text = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto findOptions = convert<uint32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto markMatches = state->uncheckedArgument(2).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsNumber(impl.countMatchesForText(WTFMove(text), WTFMove(findOptions), WTFMove(markMatches), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCountFindMatches(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "countFindMatches"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto text = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto findOptions = convert<uint32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsNumber(impl.countFindMatches(WTFMove(text), WTFMove(findOptions), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAutofillFieldName(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "autofillFieldName"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto formControlElement = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!formControlElement)) |
| return throwArgumentTypeError(*state, throwScope, 0, "formControlElement", "Internals", "autofillFieldName", "Element"); |
| JSValue result = jsStringWithCache(state, impl.autofillFieldName(*formControlElement, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPaintControlTints(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "paintControlTints"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.paintControlTints(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionScrollElementToRect(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "scrollElementToRect"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 5)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "scrollElementToRect", "Element"); |
| auto x = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto y = convert<int32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto w = convert<int32_t>(*state, state->uncheckedArgument(3), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto h = convert<int32_t>(*state, state->uncheckedArgument(4), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.scrollElementToRect(*element, WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRangeFromLocationAndLength(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "rangeFromLocationAndLength"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 3)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto scope = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!scope)) |
| return throwArgumentTypeError(*state, throwScope, 0, "scope", "Internals", "rangeFromLocationAndLength", "Element"); |
| auto rangeLocation = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto rangeLength = convert<int32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.rangeFromLocationAndLength(*scope, WTFMove(rangeLocation), WTFMove(rangeLength))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLocationFromRange(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "locationFromRange"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto scope = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!scope)) |
| return throwArgumentTypeError(*state, throwScope, 0, "scope", "Internals", "locationFromRange", "Element"); |
| auto range = JSRange::toWrapped(state->uncheckedArgument(1)); |
| if (UNLIKELY(!range)) |
| return throwArgumentTypeError(*state, throwScope, 1, "range", "Internals", "locationFromRange", "Range"); |
| JSValue result = jsNumber(impl.locationFromRange(*scope, *range)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLengthFromRange(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "lengthFromRange"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto scope = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!scope)) |
| return throwArgumentTypeError(*state, throwScope, 0, "scope", "Internals", "lengthFromRange", "Element"); |
| auto range = JSRange::toWrapped(state->uncheckedArgument(1)); |
| if (UNLIKELY(!range)) |
| return throwArgumentTypeError(*state, throwScope, 1, "range", "Internals", "lengthFromRange", "Range"); |
| JSValue result = jsNumber(impl.lengthFromRange(*scope, *range)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRangeAsText(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "rangeAsText"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto range = JSRange::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!range)) |
| return throwArgumentTypeError(*state, throwScope, 0, "range", "Internals", "rangeAsText", "Range"); |
| JSValue result = jsStringWithCache(state, impl.rangeAsText(*range)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSubrange(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "subrange"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 3)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto range = JSRange::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!range)) |
| return throwArgumentTypeError(*state, throwScope, 0, "range", "Internals", "subrange", "Range"); |
| auto rangeLocation = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto rangeLength = convert<int32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.subrange(*range, WTFMove(rangeLocation), WTFMove(rangeLength))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRangeForDictionaryLookupAtLocation(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "rangeForDictionaryLookupAtLocation"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto x = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto y = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.rangeForDictionaryLookupAtLocation(WTFMove(x), WTFMove(y), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetDelegatesScrolling(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setDelegatesScrolling"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setDelegatesScrolling(WTFMove(enabled), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLastSpellCheckRequestSequence(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "lastSpellCheckRequestSequence"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsNumber(impl.lastSpellCheckRequestSequence(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLastSpellCheckProcessedSequence(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "lastSpellCheckProcessedSequence"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsNumber(impl.lastSpellCheckProcessedSequence(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUserPreferredLanguages(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "userPreferredLanguages"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsArray(state, castedThis->globalObject(), impl.userPreferredLanguages()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUserPreferredLanguages(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setUserPreferredLanguages"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto languages = toNativeArray<String>(*state, state->uncheckedArgument(0)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setUserPreferredLanguages(WTFMove(languages)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUserPreferredAudioCharacteristics(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "userPreferredAudioCharacteristics"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsArray(state, castedThis->globalObject(), impl.userPreferredAudioCharacteristics()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUserPreferredAudioCharacteristic(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setUserPreferredAudioCharacteristic"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto characteristic = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setUserPreferredAudioCharacteristic(WTFMove(characteristic)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionWheelEventHandlerCount(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "wheelEventHandlerCount"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsNumber(impl.wheelEventHandlerCount(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionTouchEventHandlerCount(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "touchEventHandlerCount"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsNumber(impl.touchEventHandlerCount(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNodesFromRect(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "nodesFromRect"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 10)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto document = JSDocument::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!document)) |
| return throwArgumentTypeError(*state, throwScope, 0, "document", "Internals", "nodesFromRect", "Document"); |
| auto x = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto y = convert<int32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto topPadding = convert<uint32_t>(*state, state->uncheckedArgument(3), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto rightPadding = convert<uint32_t>(*state, state->uncheckedArgument(4), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto bottomPadding = convert<uint32_t>(*state, state->uncheckedArgument(5), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto leftPadding = convert<uint32_t>(*state, state->uncheckedArgument(6), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto ignoreClipping = state->uncheckedArgument(7).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto allowShadowContent = state->uncheckedArgument(8).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto allowChildFrameContent = state->uncheckedArgument(9).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.nodesFromRect(*document, WTFMove(x), WTFMove(y), WTFMove(topPadding), WTFMove(rightPadding), WTFMove(bottomPadding), WTFMove(leftPadding), WTFMove(ignoreClipping), WTFMove(allowShadowContent), WTFMove(allowChildFrameContent), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionParserMetaData(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "parserMetaData"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| auto func = state->argument(0); |
| JSValue result = jsStringWithCache(state, impl.parserMetaData(WTFMove(func))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUpdateEditorUINowIfScheduled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "updateEditorUINowIfScheduled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.updateEditorUINowIfScheduled(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHasSpellingMarker(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "hasSpellingMarker"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto from = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto length = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.hasSpellingMarker(WTFMove(from), WTFMove(length), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHasGrammarMarker(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "hasGrammarMarker"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto from = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto length = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.hasGrammarMarker(WTFMove(from), WTFMove(length), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHasAutocorrectedMarker(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "hasAutocorrectedMarker"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto from = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto length = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.hasAutocorrectedMarker(WTFMove(from), WTFMove(length), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetContinuousSpellCheckingEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setContinuousSpellCheckingEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setContinuousSpellCheckingEnabled(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticQuoteSubstitutionEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setAutomaticQuoteSubstitutionEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setAutomaticQuoteSubstitutionEnabled(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticLinkDetectionEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setAutomaticLinkDetectionEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setAutomaticLinkDetectionEnabled(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticDashSubstitutionEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setAutomaticDashSubstitutionEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setAutomaticDashSubstitutionEnabled(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticTextReplacementEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setAutomaticTextReplacementEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setAutomaticTextReplacementEnabled(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAutomaticSpellingCorrectionEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setAutomaticSpellingCorrectionEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setAutomaticSpellingCorrectionEnabled(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionHandleAcceptedCandidate(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "handleAcceptedCandidate"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 3)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto candidate = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto location = convert<uint32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto length = convert<uint32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.handleAcceptedCandidate(WTFMove(candidate), WTFMove(location), WTFMove(length), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsOverwriteModeEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isOverwriteModeEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsBoolean(impl.isOverwriteModeEnabled(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionToggleOverwriteModeEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "toggleOverwriteModeEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.toggleOverwriteModeEnabled(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfScrollableAreas(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "numberOfScrollableAreas"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsNumber(impl.numberOfScrollableAreas(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPageBoxVisible(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isPageBoxVisible"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto pageNumber = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.isPageBoxVisible(WTFMove(pageNumber), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionImageFrameIndex(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "imageFrameIndex"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSHTMLImageElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "imageFrameIndex", "HTMLImageElement"); |
| JSValue result = jsNumber(impl.imageFrameIndex(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLayerTreeAsText(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "layerTreeAsText"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto document = JSDocument::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!document)) |
| return throwArgumentTypeError(*state, throwScope, 0, "document", "Internals", "layerTreeAsText", "Document"); |
| auto flags = convert<uint16_t>(*state, state->argument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.layerTreeAsText(*document, WTFMove(flags), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionScrollingStateTreeAsText(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "scrollingStateTreeAsText"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsStringWithCache(state, impl.scrollingStateTreeAsText(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMainThreadScrollingReasons(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "mainThreadScrollingReasons"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsStringWithCache(state, impl.mainThreadScrollingReasons(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNonFastScrollableRects(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "nonFastScrollableRects"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = toJS(state, castedThis->globalObject(), impl.nonFastScrollableRects(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRepaintRectsAsText(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "repaintRectsAsText"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsStringWithCache(state, impl.repaintRectsAsText(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetElementUsesDisplayListDrawing(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setElementUsesDisplayListDrawing"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "setElementUsesDisplayListDrawing", "Element"); |
| auto usesDisplayListDrawing = state->uncheckedArgument(1).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setElementUsesDisplayListDrawing(*element, WTFMove(usesDisplayListDrawing), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetElementTracksDisplayListReplay(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setElementTracksDisplayListReplay"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "setElementTracksDisplayListReplay", "Element"); |
| auto trackReplay = state->uncheckedArgument(1).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setElementTracksDisplayListReplay(*element, WTFMove(trackReplay), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionDisplayListForElement(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "displayListForElement"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "displayListForElement", "Element"); |
| auto flags = convert<uint16_t>(*state, state->argument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.displayListForElement(*element, WTFMove(flags), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionReplayDisplayListForElement(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "replayDisplayListForElement"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "replayDisplayListForElement", "Element"); |
| auto flags = convert<uint16_t>(*state, state->argument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.replayDisplayListForElement(*element, WTFMove(flags), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGarbageCollectDocumentResources(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "garbageCollectDocumentResources"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.garbageCollectDocumentResources(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInsertAuthorCSS(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "insertAuthorCSS"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto css = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.insertAuthorCSS(WTFMove(css), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInsertUserCSS(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "insertUserCSS"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto css = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.insertUserCSS(WTFMove(css), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionBeginSimulatedMemoryPressure(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "beginSimulatedMemoryPressure"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.beginSimulatedMemoryPressure(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEndSimulatedMemoryPressure(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "endSimulatedMemoryPressure"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.endSimulatedMemoryPressure(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfLiveNodes(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "numberOfLiveNodes"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsNumber(impl.numberOfLiveNodes()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfLiveDocuments(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "numberOfLiveDocuments"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsNumber(impl.numberOfLiveDocuments()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionOpenDummyInspectorFrontend(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "openDummyInspectorFrontend"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto url = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.openDummyInspectorFrontend(WTFMove(url))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCloseDummyInspectorFrontend(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "closeDummyInspectorFrontend"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.closeDummyInspectorFrontend(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetInspectorIsUnderTest(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setInspectorIsUnderTest"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto isUnderTest = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setInspectorIsUnderTest(WTFMove(isUnderTest), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCounterValue(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "counterValue"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "counterValue", "Element"); |
| JSValue result = jsStringWithCache(state, impl.counterValue(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageNumber(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pageNumber"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "pageNumber", "Element"); |
| auto pageWidth = state->argument(1).isUndefined() ? 800 : convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto pageHeight = state->argument(2).isUndefined() ? 600 : convert<float>(*state, state->uncheckedArgument(2), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsNumber(impl.pageNumber(*element, WTFMove(pageWidth), WTFMove(pageHeight))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionShortcutIconURLs(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "shortcutIconURLs"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsArray(state, castedThis->globalObject(), impl.shortcutIconURLs()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionNumberOfPages(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "numberOfPages"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| auto pageWidthInPixels = state->argument(0).isUndefined() ? 800 : convert<double>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto pageHeightInPixels = state->argument(1).isUndefined() ? 600 : convert<double>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsNumber(impl.numberOfPages(WTFMove(pageWidthInPixels), WTFMove(pageHeightInPixels))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageProperty(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pageProperty"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto propertyName = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto pageNumber = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.pageProperty(WTFMove(propertyName), WTFMove(pageNumber), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageSizeAndMarginsInPixels(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pageSizeAndMarginsInPixels"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 7)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto pageIndex = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto width = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto height = convert<int32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto marginTop = convert<int32_t>(*state, state->uncheckedArgument(3), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto marginRight = convert<int32_t>(*state, state->uncheckedArgument(4), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto marginBottom = convert<int32_t>(*state, state->uncheckedArgument(5), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto marginLeft = convert<int32_t>(*state, state->uncheckedArgument(6), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.pageSizeAndMarginsInPixels(WTFMove(pageIndex), WTFMove(width), WTFMove(height), WTFMove(marginTop), WTFMove(marginRight), WTFMove(marginBottom), WTFMove(marginLeft), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPageScaleFactor(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setPageScaleFactor"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 3)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto scaleFactor = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto x = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto y = convert<int32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setPageScaleFactor(WTFMove(scaleFactor), WTFMove(x), WTFMove(y), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPageZoomFactor(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setPageZoomFactor"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto zoomFactor = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setPageZoomFactor(WTFMove(zoomFactor), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetTextZoomFactor(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setTextZoomFactor"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto zoomFactor = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setTextZoomFactor(WTFMove(zoomFactor), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUseFixedLayout(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setUseFixedLayout"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto useFixedLayout = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setUseFixedLayout(WTFMove(useFixedLayout), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetFixedLayoutSize(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setFixedLayoutSize"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto width = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto height = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setFixedLayoutSize(WTFMove(width), WTFMove(height), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetViewExposedRect(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setViewExposedRect"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 4)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto x = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto y = convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto width = convert<float>(*state, state->uncheckedArgument(2), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto height = convert<float>(*state, state->uncheckedArgument(3), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setViewExposedRect(WTFMove(x), WTFMove(y), WTFMove(width), WTFMove(height), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetHeaderHeight(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setHeaderHeight"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto height = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setHeaderHeight(WTFMove(height)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetFooterHeight(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setFooterHeight"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto height = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setFooterHeight(WTFMove(height)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetTopContentInset(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setTopContentInset"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto contentInset = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setTopContentInset(WTFMove(contentInset)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetApplicationCacheOriginQuota(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setApplicationCacheOriginQuota"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto quota = convert<uint64_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setApplicationCacheOriginQuota(WTFMove(quota)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRegisterURLSchemeAsBypassingContentSecurityPolicy(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "registerURLSchemeAsBypassingContentSecurityPolicy"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto scheme = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.registerURLSchemeAsBypassingContentSecurityPolicy(WTFMove(scheme)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionRemoveURLSchemeRegisteredAsBypassingContentSecurityPolicy(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "removeURLSchemeRegisteredAsBypassingContentSecurityPolicy"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto scheme = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(WTFMove(scheme)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMallocStatistics(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "mallocStatistics"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.mallocStatistics()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionTypeConversions(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "typeConversions"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.typeConversions()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMemoryInfo(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "memoryInfo"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.memoryInfo()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGetReferencedFilePaths(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "getReferencedFilePaths"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsArray(state, castedThis->globalObject(), impl.getReferencedFilePaths()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStartTrackingRepaints(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "startTrackingRepaints"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.startTrackingRepaints(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStopTrackingRepaints(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "stopTrackingRepaints"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.stopTrackingRepaints(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStartTrackingLayerFlushes(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "startTrackingLayerFlushes"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.startTrackingLayerFlushes(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionLayerFlushCount(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "layerFlushCount"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsNumber(impl.layerFlushCount(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsTimerThrottled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isTimerThrottled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto timerHandle = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.isTimerThrottled(WTFMove(timerHandle), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsRequestAnimationFrameThrottled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isRequestAnimationFrameThrottled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsBoolean(impl.isRequestAnimationFrameThrottled()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionAreTimersThrottled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "areTimersThrottled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsBoolean(impl.areTimersThrottled()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStartTrackingStyleRecalcs(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "startTrackingStyleRecalcs"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.startTrackingStyleRecalcs(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStyleRecalcCount(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "styleRecalcCount"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsNumber(impl.styleRecalcCount(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionStartTrackingCompositingUpdates(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "startTrackingCompositingUpdates"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| impl.startTrackingCompositingUpdates(ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCompositingUpdateCount(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "compositingUpdateCount"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsNumber(impl.compositingUpdateCount(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUpdateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| Node* node = nullptr; |
| if (!state->argument(0).isUndefinedOrNull()) { |
| node = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!node)) |
| return throwArgumentTypeError(*state, throwScope, 0, "node", "Internals", "updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks", "Node"); |
| } |
| impl.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(WTFMove(node), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGetCurrentCursorInfo(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "getCurrentCursorInfo"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsStringWithCache(state, impl.getCurrentCursorInfo(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMarkerTextForListItem(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "markerTextForListItem"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "markerTextForListItem", "Element"); |
| JSValue result = jsStringWithCache(state, impl.markerTextForListItem(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionToolTipFromElement(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "toolTipFromElement"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "toolTipFromElement", "Element"); |
| JSValue result = jsStringWithCache(state, impl.toolTipFromElement(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionDeserializeBuffer(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "deserializeBuffer"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto buffer = toArrayBuffer(state->uncheckedArgument(0)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!buffer)) |
| return throwArgumentTypeError(*state, throwScope, 0, "buffer", "Internals", "deserializeBuffer", "ArrayBuffer"); |
| JSValue result = impl.deserializeBuffer(*buffer) ? impl.deserializeBuffer(*buffer)->deserialize(state, castedThis->globalObject(), 0) : jsNull(); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSerializeObject(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "serializeObject"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto obj = SerializedScriptValue::create(state, state->uncheckedArgument(0), 0, 0); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.serializeObject(WTFMove(obj))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsFromCurrentWorld(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isFromCurrentWorld"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto obj = state->uncheckedArgument(0); |
| JSValue result = jsBoolean(impl.isFromCurrentWorld(WTFMove(obj))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUsesOverlayScrollbars(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setUsesOverlayScrollbars"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setUsesOverlayScrollbars(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUsesMockScrollAnimator(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setUsesMockScrollAnimator"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setUsesMockScrollAnimator(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionForceReload(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "forceReload"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto endToEnd = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.forceReload(WTFMove(endToEnd)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnableAutoSizeMode(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "enableAutoSizeMode"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 5)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto minimumWidth = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto minimumHeight = convert<int32_t>(*state, state->uncheckedArgument(2), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto maximumWidth = convert<int32_t>(*state, state->uncheckedArgument(3), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto maximumHeight = convert<int32_t>(*state, state->uncheckedArgument(4), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.enableAutoSizeMode(WTFMove(enabled), WTFMove(minimumWidth), WTFMove(minimumHeight), WTFMove(maximumWidth), WTFMove(maximumHeight)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSimulateAudioInterruption(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "simulateAudioInterruption"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSHTMLMediaElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "simulateAudioInterruption", "HTMLMediaElement"); |
| impl.simulateAudioInterruption(*element); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMediaElementHasCharacteristic(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "mediaElementHasCharacteristic"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto element = JSHTMLMediaElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "mediaElementHasCharacteristic", "HTMLMediaElement"); |
| auto characteristic = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsBoolean(impl.mediaElementHasCharacteristic(*element, WTFMove(characteristic), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(ENCRYPTED_MEDIA_V2) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInitializeMockCDM(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "initializeMockCDM"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.initializeMockCDM(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(SPEECH_SYNTHESIS) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnableMockSpeechSynthesizer(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "enableMockSpeechSynthesizer"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.enableMockSpeechSynthesizer(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGetImageSourceURL(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "getImageSourceURL"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "getImageSourceURL", "Element"); |
| JSValue result = jsStringWithCache(state, impl.getImageSourceURL(*element)); |
| return JSValue::encode(result); |
| } |
| |
| #if ENABLE(VIDEO_TRACK) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCaptionsStyleSheetOverride(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "captionsStyleSheetOverride"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsStringWithCache(state, impl.captionsStyleSheetOverride(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO_TRACK) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetCaptionsStyleSheetOverride(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setCaptionsStyleSheetOverride"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto override = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setCaptionsStyleSheetOverride(WTFMove(override), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO_TRACK) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPrimaryAudioTrackLanguageOverride(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setPrimaryAudioTrackLanguageOverride"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto language = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setPrimaryAudioTrackLanguageOverride(WTFMove(language), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO_TRACK) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetCaptionDisplayMode(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setCaptionDisplayMode"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto mode = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setCaptionDisplayMode(WTFMove(mode), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCreateTimeRanges(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "createTimeRanges"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto startTimes = toFloat32Array(state->uncheckedArgument(0)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!startTimes)) |
| return throwArgumentTypeError(*state, throwScope, 0, "startTimes", "Internals", "createTimeRanges", "Float32Array"); |
| auto endTimes = toFloat32Array(state->uncheckedArgument(1)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!endTimes)) |
| return throwArgumentTypeError(*state, throwScope, 1, "endTimes", "Internals", "createTimeRanges", "Float32Array"); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.createTimeRanges(startTimes.releaseNonNull(), endTimes.releaseNonNull())); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionClosestTimeToTimeRanges(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "closestTimeToTimeRanges"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto time = convert<double>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto ranges = JSTimeRanges::toWrapped(state->uncheckedArgument(1)); |
| if (UNLIKELY(!ranges)) |
| return throwArgumentTypeError(*state, throwScope, 1, "ranges", "Internals", "closestTimeToTimeRanges", "TimeRanges"); |
| JSValue result = jsNumber(impl.closestTimeToTimeRanges(WTFMove(time), *ranges)); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsSelectPopupVisible(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isSelectPopupVisible"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSHTMLSelectElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "isSelectPopupVisible", "HTMLSelectElement"); |
| JSValue result = jsBoolean(impl.isSelectPopupVisible(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPluginUnavailabilityIndicatorObscured(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isPluginUnavailabilityIndicatorObscured"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "isPluginUnavailabilityIndicatorObscured", "Element"); |
| JSValue result = jsBoolean(impl.isPluginUnavailabilityIndicatorObscured(*element, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPluginSnapshotted(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isPluginSnapshotted"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "isPluginSnapshotted", "Element"); |
| JSValue result = jsBoolean(impl.isPluginSnapshotted(*element)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSelectionBounds(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "selectionBounds"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = toJS(state, castedThis->globalObject(), impl.selectionBounds(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| #if ENABLE(MEDIA_SOURCE) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInitializeMockMediaSource(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "initializeMockMediaSource"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.initializeMockMediaSource(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_SOURCE) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionBufferedSamplesForTrackID(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "bufferedSamplesForTrackID"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto buffer = JSSourceBuffer::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!buffer)) |
| return throwArgumentTypeError(*state, throwScope, 0, "buffer", "Internals", "bufferedSamplesForTrackID", "SourceBuffer"); |
| auto trackID = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsArray(state, castedThis->globalObject(), impl.bufferedSamplesForTrackID(*buffer, WTFMove(trackID))); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_SOURCE) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEnqueuedSamplesForTrackID(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "enqueuedSamplesForTrackID"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto buffer = JSSourceBuffer::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!buffer)) |
| return throwArgumentTypeError(*state, throwScope, 0, "buffer", "Internals", "enqueuedSamplesForTrackID", "SourceBuffer"); |
| auto trackID = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsArray(state, castedThis->globalObject(), impl.enqueuedSamplesForTrackID(*buffer, WTFMove(trackID))); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_SOURCE) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetShouldGenerateTimestamps(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setShouldGenerateTimestamps"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto buffer = JSSourceBuffer::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!buffer)) |
| return throwArgumentTypeError(*state, throwScope, 0, "buffer", "Internals", "setShouldGenerateTimestamps", "SourceBuffer"); |
| auto flag = state->uncheckedArgument(1).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setShouldGenerateTimestamps(*buffer, WTFMove(flag)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionBeginMediaSessionInterruption(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "beginMediaSessionInterruption"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto interruptionType = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.beginMediaSessionInterruption(WTFMove(interruptionType), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionEndMediaSessionInterruption(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "endMediaSessionInterruption"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto flags = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.endMediaSessionInterruption(WTFMove(flags)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_SESSION) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSendMediaSessionStartOfInterruptionNotification(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "sendMediaSessionStartOfInterruptionNotification"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto categoryValue = state->uncheckedArgument(0); |
| Internals::MediaSessionInterruptingCategory category; |
| auto optionalValue = parse<Internals::MediaSessionInterruptingCategory>(*state, categoryValue); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!optionalValue)) |
| return throwArgumentMustBeEnumError(*state, throwScope, 0, "category", "Internals", "sendMediaSessionStartOfInterruptionNotification", expectedEnumerationValues<Internals::MediaSessionInterruptingCategory>()); |
| category = optionalValue.value(); |
| impl.sendMediaSessionStartOfInterruptionNotification(category); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_SESSION) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSendMediaSessionEndOfInterruptionNotification(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "sendMediaSessionEndOfInterruptionNotification"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto categoryValue = state->uncheckedArgument(0); |
| Internals::MediaSessionInterruptingCategory category; |
| auto optionalValue = parse<Internals::MediaSessionInterruptingCategory>(*state, categoryValue); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!optionalValue)) |
| return throwArgumentMustBeEnumError(*state, throwScope, 0, "category", "Internals", "sendMediaSessionEndOfInterruptionNotification", expectedEnumerationValues<Internals::MediaSessionInterruptingCategory>()); |
| category = optionalValue.value(); |
| impl.sendMediaSessionEndOfInterruptionNotification(category); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_SESSION) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMediaSessionCurrentState(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "mediaSessionCurrentState"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto session = JSMediaSession::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!session)) |
| return throwArgumentTypeError(*state, throwScope, 0, "session", "Internals", "mediaSessionCurrentState", "MediaSession"); |
| JSValue result = jsStringWithCache(state, impl.mediaSessionCurrentState(*session)); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_SESSION) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionMediaElementPlayerVolume(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "mediaElementPlayerVolume"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSHTMLMediaElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "mediaElementPlayerVolume", "HTMLMediaElement"); |
| JSValue result = jsNumber(impl.mediaElementPlayerVolume(*element)); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_SESSION) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSendMediaControlEvent(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "sendMediaControlEvent"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto eventValue = state->uncheckedArgument(0); |
| Internals::MediaControlEvent event; |
| auto optionalValue = parse<Internals::MediaControlEvent>(*state, eventValue); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!optionalValue)) |
| return throwArgumentMustBeEnumError(*state, throwScope, 0, "event", "Internals", "sendMediaControlEvent", expectedEnumerationValues<Internals::MediaControlEvent>()); |
| event = optionalValue.value(); |
| impl.sendMediaControlEvent(event); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionApplicationDidEnterForeground(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "applicationDidEnterForeground"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.applicationDidEnterForeground(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionApplicationWillEnterBackground(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "applicationWillEnterBackground"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.applicationWillEnterBackground(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMediaSessionRestrictions(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setMediaSessionRestrictions"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto mediaType = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto restrictions = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setMediaSessionRestrictions(WTFMove(mediaType), WTFMove(restrictions), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMediaElementRestrictions(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setMediaElementRestrictions"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSHTMLMediaElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "setMediaElementRestrictions", "HTMLMediaElement"); |
| auto restrictions = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setMediaElementRestrictions(*element, WTFMove(restrictions)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(WEB_AUDIO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetAudioContextRestrictions(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setAudioContextRestrictions"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto context = JSAudioContext::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!context)) |
| return throwArgumentTypeError(*state, throwScope, 0, "context", "Internals", "setAudioContextRestrictions", "AudioContext"); |
| auto restrictions = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setAudioContextRestrictions(*context, WTFMove(restrictions)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPostRemoteControlCommand(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "postRemoteControlCommand"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto command = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto argument = state->argument(1).isUndefined() ? 0 : convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.postRemoteControlCommand(WTFMove(command), WTFMove(argument), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMockMediaPlaybackTargetPickerEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setMockMediaPlaybackTargetPickerEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setMockMediaPlaybackTargetPickerEnabled(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMockMediaPlaybackTargetPickerState(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setMockMediaPlaybackTargetPickerState"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto deviceName = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto deviceState = state->uncheckedArgument(1).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setMockMediaPlaybackTargetPickerState(WTFMove(deviceName), WTFMove(deviceState), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(MEDIA_STREAM) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetMockMediaCaptureDevicesEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setMockMediaCaptureDevicesEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enabled = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setMockMediaCaptureDevicesEnabled(WTFMove(enabled)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSimulateSystemSleep(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "simulateSystemSleep"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.simulateSystemSleep(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSimulateSystemWake(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "simulateSystemWake"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.simulateSystemWake(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionElementIsBlockingDisplaySleep(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "elementIsBlockingDisplaySleep"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSHTMLMediaElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "elementIsBlockingDisplaySleep", "HTMLMediaElement"); |
| JSValue result = jsBoolean(impl.elementIsBlockingDisplaySleep(*element)); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionInstallMockPageOverlay(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "installMockPageOverlay"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto typeValue = state->uncheckedArgument(0); |
| Internals::PageOverlayType type; |
| auto optionalValue = parse<Internals::PageOverlayType>(*state, typeValue); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!optionalValue)) |
| return throwArgumentMustBeEnumError(*state, throwScope, 0, "type", "Internals", "installMockPageOverlay", expectedEnumerationValues<Internals::PageOverlayType>()); |
| type = optionalValue.value(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.installMockPageOverlay(type, ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPageOverlayLayerTreeAsText(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pageOverlayLayerTreeAsText"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| JSValue result = jsStringWithCache(state, impl.pageOverlayLayerTreeAsText(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPageMuted(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setPageMuted"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto muted = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setPageMuted(WTFMove(muted)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsPagePlayingAudio(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isPagePlayingAudio"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsBoolean(impl.isPagePlayingAudio()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetPageDefersLoading(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setPageDefersLoading"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto defersLoading = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setPageDefersLoading(WTFMove(defersLoading)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionCreateFile(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "createFile"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto url = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.createFile(WTFMove(url))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionQueueMicroTask(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "queueMicroTask"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto testNumber = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.queueMicroTask(WTFMove(testNumber)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionTestPreloaderSettingViewport(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "testPreloaderSettingViewport"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsBoolean(impl.testPreloaderSettingViewport()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionPathStringWithShrinkWrappedRects(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "pathStringWithShrinkWrappedRects"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto rectComponents = toNativeArray<double>(*state, state->uncheckedArgument(0)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto radius = convert<double>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::No); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.pathStringWithShrinkWrappedRects(WTFMove(rectComponents), WTFMove(radius), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| #if ENABLE(VIDEO) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionGetCurrentMediaControlsStatusForElement(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "getCurrentMediaControlsStatusForElement"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto element = JSHTMLMediaElement::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!element)) |
| return throwArgumentTypeError(*state, throwScope, 0, "element", "Internals", "getCurrentMediaControlsStatusForElement", "HTMLMediaElement"); |
| JSValue result = jsStringWithCache(state, impl.getCurrentMediaControlsStatusForElement(*element)); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionUserVisibleString(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "userVisibleString"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto url = JSDOMURL::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!url)) |
| return throwArgumentTypeError(*state, throwScope, 0, "url", "Internals", "userVisibleString", "DOMURL"); |
| JSValue result = jsStringWithCache(state, impl.userVisibleString(*url)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetShowAllPlugins(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setShowAllPlugins"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto showAll = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setShowAllPlugins(WTFMove(showAll)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #if ENABLE(READABLE_STREAM_API) |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsReadableStreamDisturbed(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isReadableStreamDisturbed"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto stream = state->uncheckedArgument(0); |
| JSValue result = jsBoolean(impl.isReadableStreamDisturbed(*state, WTFMove(stream))); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionResourceLoadStatisticsForOrigin(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "resourceLoadStatisticsForOrigin"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto domain = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.resourceLoadStatisticsForOrigin(WTFMove(domain))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetResourceLoadStatisticsEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setResourceLoadStatisticsEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enable = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setResourceLoadStatisticsEnabled(WTFMove(enable)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetCanShowModalDialogOverride(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setCanShowModalDialogOverride"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto allow = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setCanShowModalDialogOverride(WTFMove(allow), ec); |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionComposedTreeAsText(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "composedTreeAsText"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto parent = JSNode::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!parent)) |
| return throwArgumentTypeError(*state, throwScope, 0, "parent", "Internals", "composedTreeAsText", "Node"); |
| JSValue result = jsStringWithCache(state, impl.composedTreeAsText(*parent)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetLinkPreloadSupport(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setLinkPreloadSupport"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto scalable = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setLinkPreloadSupport(WTFMove(scalable)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetCSSGridLayoutEnabled(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setCSSGridLayoutEnabled"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto enable = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setCSSGridLayoutEnabled(WTFMove(enable)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetResourceTimingSupport(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setResourceTimingSupport"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto scalable = state->uncheckedArgument(0).toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setResourceTimingSupport(WTFMove(scalable)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionIsProcessingUserGesture(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "isProcessingUserGesture"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsBoolean(impl.isProcessingUserGesture()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionObserveGC(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "observeGC"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto observed = state->uncheckedArgument(0); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.observeGC(WTFMove(observed))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsInternalsPrototypeFunctionSetUserInterfaceLayoutDirection(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSInternals*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "Internals", "setUserInterfaceLayoutDirection"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSInternals::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto userInterfaceLayoutDirectionValue = state->uncheckedArgument(0); |
| Internals::UserInterfaceLayoutDirection userInterfaceLayoutDirection; |
| auto optionalValue = parse<Internals::UserInterfaceLayoutDirection>(*state, userInterfaceLayoutDirectionValue); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(!optionalValue)) |
| return throwArgumentMustBeEnumError(*state, throwScope, 0, "userInterfaceLayoutDirection", "Internals", "setUserInterfaceLayoutDirection", expectedEnumerationValues<Internals::UserInterfaceLayoutDirection>()); |
| userInterfaceLayoutDirection = optionalValue.value(); |
| impl.setUserInterfaceLayoutDirection(userInterfaceLayoutDirection); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| bool JSInternalsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) |
| { |
| UNUSED_PARAM(handle); |
| UNUSED_PARAM(visitor); |
| return false; |
| } |
| |
| void JSInternalsOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| auto* jsInternals = jsCast<JSInternals*>(handle.slot()->asCell()); |
| auto& world = *static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, &jsInternals->wrapped(), jsInternals); |
| } |
| |
| #if ENABLE(BINDING_INTEGRITY) |
| #if PLATFORM(WIN) |
| #pragma warning(disable: 4483) |
| extern "C" { extern void (*const __identifier("??_7Internals@WebCore@@6B@")[])(); } |
| #else |
| extern "C" { extern void* _ZTVN7WebCore9InternalsE[]; } |
| #endif |
| #endif |
| |
| JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<Internals>&& impl) |
| { |
| |
| #if ENABLE(BINDING_INTEGRITY) |
| void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr())); |
| #if PLATFORM(WIN) |
| void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7Internals@WebCore@@6B@")); |
| #else |
| void* expectedVTablePointer = &_ZTVN7WebCore9InternalsE[2]; |
| #if COMPILER(CLANG) |
| // If this fails Internals does not have a vtable, so you need to add the |
| // ImplementationLacksVTable attribute to the interface definition |
| static_assert(__is_polymorphic(Internals), "Internals is not polymorphic"); |
| #endif |
| #endif |
| // If you hit this assertion you either have a use after free bug, or |
| // Internals has subclasses. If Internals has subclasses that get passed |
| // to toJS() we currently require Internals you to opt out of binding hardening |
| // by adding the SkipVTableValidation attribute to the interface IDL definition |
| RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
| #endif |
| return createWrapper<Internals>(globalObject, WTFMove(impl)); |
| } |
| |
| JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, Internals& impl) |
| { |
| return wrap(state, globalObject, impl); |
| } |
| |
| Internals* JSInternals::toWrapped(JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSInternals*>(value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |