Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copyright 2014 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
- #include "config.h"
- #include "V8Element.h"
- #include "HTMLNames.h"
- #include "RuntimeEnabledFeatures.h"
- #include "V8AnimationEffect.h"
- #include "V8AnimationPlayer.h"
- #include "V8Attr.h"
- #include "V8CSSStyleDeclaration.h"
- #include "V8ClientRect.h"
- #include "V8ClientRectList.h"
- #include "V8DOMStringMap.h"
- #include "V8DOMTokenList.h"
- #include "V8HTMLCollection.h"
- #include "V8HTMLElement.h"
- #include "V8NamedNodeMap.h"
- #include "V8NodeList.h"
- #include "V8SVGElement.h"
- #include "V8ShadowRoot.h"
- #include "bindings/v8/Dictionary.h"
- #include "bindings/v8/ExceptionState.h"
- #include "bindings/v8/V8AbstractEventListener.h"
- #include "bindings/v8/V8DOMActivityLogger.h"
- #include "bindings/v8/V8DOMConfiguration.h"
- #include "bindings/v8/V8EventListenerList.h"
- #include "bindings/v8/V8HiddenValue.h"
- #include "bindings/v8/V8ObjectConstructor.h"
- #include "core/animation/ElementAnimation.h"
- #include "core/dom/ChildNode.h"
- #include "core/dom/ContextFeatures.h"
- #include "core/dom/Document.h"
- #include "core/dom/ParentNode.h"
- #include "core/dom/custom/CustomElementCallbackDispatcher.h"
- #include "core/frame/UseCounter.h"
- #include "platform/TraceEvent.h"
- #include "wtf/GetPtr.h"
- #include "wtf/RefPtr.h"
- namespace WebCore {
- static void initializeScriptWrappableForInterface(Element* object)
- {
- if (ScriptWrappable::wrapperCanBeStoredInObject(object))
- ScriptWrappable::fromObject(object)->setTypeInfo(&V8Element::wrapperTypeInfo);
- else
- ASSERT_NOT_REACHED();
- }
- } // namespace WebCore
- void webCoreInitializeScriptWrappableForInterface(WebCore::Element* object)
- {
- WebCore::initializeScriptWrappableForInterface(object);
- }
- namespace WebCore {
- const WrapperTypeInfo V8Element::wrapperTypeInfo = { gin::kEmbedderBlink, V8Element::domTemplate, V8Element::derefObject, 0, V8Element::toEventTarget, 0, V8Element::installPerContextEnabledMethods, &V8Node::wrapperTypeInfo, WrapperTypeObjectPrototype, RefCountedObject };
- namespace ElementV8Internal {
- template <typename T> void V8_USE(T) { }
- static void tagNameAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueStringOrNull(info, impl->tagName(), info.GetIsolate());
- }
- static void tagNameAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::tagNameAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void attributesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueFast(info, WTF::getPtr(impl->attributes()), impl);
- }
- static void attributesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::attributesAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void attributesAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->attributes()));
- }
- static void attributesAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::attributesAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void styleAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueFast(info, WTF::getPtr(impl->style()), impl);
- }
- static void styleAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::styleAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void styleAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->style()));
- }
- static void styleAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::styleAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void idAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueString(info, impl->getIdAttribute(), info.GetIsolate());
- }
- static void idAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::idAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void idAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
- impl->setAttribute(HTMLNames::idAttr, cppValue);
- }
- static void idAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- ElementV8Internal::idAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void namespaceURIAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueStringOrNull(info, impl->namespaceURI(), info.GetIsolate());
- }
- static void namespaceURIAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::namespaceURIAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void prefixAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueStringOrNull(info, impl->prefix(), info.GetIsolate());
- }
- static void prefixAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::prefixAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void prefixAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- ExceptionState exceptionState(ExceptionState::SetterContext, "prefix", "Element", holder, info.GetIsolate());
- Element* impl = V8Element::toNative(holder);
- TOSTRING_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value);
- impl->setPrefix(cppValue, exceptionState);
- exceptionState.throwIfNeeded();
- }
- static void prefixAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::prefixAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void localNameAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueStringOrNull(info, impl->localName(), info.GetIsolate());
- }
- static void localNameAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::localNameAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void offsetLeftAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->offsetLeft());
- }
- static void offsetLeftAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::offsetLeftAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void offsetTopAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->offsetTop());
- }
- static void offsetTopAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::offsetTopAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void offsetWidthAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->offsetWidth());
- }
- static void offsetWidthAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::offsetWidthAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void offsetHeightAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->offsetHeight());
- }
- static void offsetHeightAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::offsetHeightAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void offsetParentAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueFast(info, WTF::getPtr(impl->offsetParentForBindings()), impl);
- }
- static void offsetParentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::offsetParentAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void offsetParentAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->offsetParentForBindings()));
- }
- static void offsetParentAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::offsetParentAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void clientLeftAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->clientLeft());
- }
- static void clientLeftAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::clientLeftAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void clientTopAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->clientTop());
- }
- static void clientTopAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::clientTopAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void clientWidthAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->clientWidth());
- }
- static void clientWidthAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::clientWidthAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void clientHeightAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->clientHeight());
- }
- static void clientHeightAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::clientHeightAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollLeftAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->scrollLeft());
- }
- static void scrollLeftAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::scrollLeftAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollLeftAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- V8Element::scrollLeftAttributeSetterCustom(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollTopAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->scrollTop());
- }
- static void scrollTopAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::scrollTopAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollTopAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- V8Element::scrollTopAttributeSetterCustom(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollWidthAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->scrollWidth());
- }
- static void scrollWidthAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::scrollWidthAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollHeightAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueInt(info, impl->scrollHeight());
- }
- static void scrollHeightAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::scrollHeightAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void innerHTMLAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueString(info, impl->innerHTML(), info.GetIsolate());
- }
- static void innerHTMLAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::innerHTMLAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void innerHTMLAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- ExceptionState exceptionState(ExceptionState::SetterContext, "innerHTML", "Element", holder, info.GetIsolate());
- Element* impl = V8Element::toNative(holder);
- TOSTRING_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value);
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- impl->setInnerHTML(cppValue, exceptionState);
- exceptionState.throwIfNeeded();
- }
- static void innerHTMLAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
- if (contextData && contextData->activityLogger()) {
- v8::Handle<v8::Value> loggerArg[] = { v8Value };
- contextData->activityLogger()->log("Element.innerHTML", 1, &loggerArg[0], "Setter");
- }
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- ElementV8Internal::innerHTMLAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void outerHTMLAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueString(info, impl->outerHTML(), info.GetIsolate());
- }
- static void outerHTMLAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::outerHTMLAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void outerHTMLAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- ExceptionState exceptionState(ExceptionState::SetterContext, "outerHTML", "Element", holder, info.GetIsolate());
- Element* impl = V8Element::toNative(holder);
- TOSTRING_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value);
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- impl->setOuterHTML(cppValue, exceptionState);
- exceptionState.throwIfNeeded();
- }
- static void outerHTMLAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- ElementV8Internal::outerHTMLAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void classNameAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueString(info, impl->getClassAttribute(), info.GetIsolate());
- }
- static void classNameAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::classNameAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void classNameAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
- impl->setAttribute(HTMLNames::classAttr, cppValue);
- }
- static void classNameAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- ElementV8Internal::classNameAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void classListAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueFast(info, WTF::getPtr(impl->classList()), impl);
- }
- static void classListAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::classListAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void classListAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->classList()));
- }
- static void classListAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::classListAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void datasetAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueFast(info, WTF::getPtr(impl->dataset()), impl);
- }
- static void datasetAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::datasetAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void datasetAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->dataset()));
- }
- static void datasetAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::datasetAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void shadowRootAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueFast(info, WTF::getPtr(impl->shadowRoot()), impl);
- }
- static void shadowRootAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::shadowRootAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void shadowRootAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->shadowRoot()));
- }
- static void shadowRootAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::shadowRootAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onbeforecopyAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->onbeforecopy();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void onbeforecopyAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::onbeforecopyAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onbeforecopyAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOnbeforecopy(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void onbeforecopyAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::onbeforecopyAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onbeforecutAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->onbeforecut();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void onbeforecutAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::onbeforecutAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onbeforecutAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOnbeforecut(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void onbeforecutAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::onbeforecutAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onbeforepasteAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->onbeforepaste();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void onbeforepasteAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::onbeforepasteAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onbeforepasteAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOnbeforepaste(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void onbeforepasteAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::onbeforepasteAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void oncopyAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->oncopy();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void oncopyAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::oncopyAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void oncopyAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOncopy(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void oncopyAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::oncopyAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void oncutAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->oncut();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void oncutAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::oncutAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void oncutAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOncut(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void oncutAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::oncutAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onpasteAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->onpaste();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void onpasteAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::onpasteAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onpasteAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOnpaste(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void onpasteAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::onpasteAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onsearchAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->onsearch();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void onsearchAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::onsearchAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onsearchAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOnsearch(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void onsearchAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::onsearchAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onselectstartAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->onselectstart();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void onselectstartAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::onselectstartAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onselectstartAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOnselectstart(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void onselectstartAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::onselectstartAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void ontouchcancelAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->ontouchcancel();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void ontouchcancelAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::ontouchcancelAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void ontouchcancelAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOntouchcancel(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void ontouchcancelAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::ontouchcancelAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void ontouchendAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->ontouchend();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void ontouchendAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::ontouchendAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void ontouchendAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOntouchend(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void ontouchendAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::ontouchendAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void ontouchmoveAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->ontouchmove();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void ontouchmoveAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::ontouchmoveAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void ontouchmoveAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOntouchmove(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void ontouchmoveAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::ontouchmoveAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void ontouchstartAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->ontouchstart();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void ontouchstartAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::ontouchstartAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void ontouchstartAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOntouchstart(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void ontouchstartAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::ontouchstartAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onwebkitfullscreenchangeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->onwebkitfullscreenchange();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void onwebkitfullscreenchangeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::onwebkitfullscreenchangeAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onwebkitfullscreenchangeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOnwebkitfullscreenchange(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void onwebkitfullscreenchangeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::onwebkitfullscreenchangeAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onwebkitfullscreenerrorAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->onwebkitfullscreenerror();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void onwebkitfullscreenerrorAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::onwebkitfullscreenerrorAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onwebkitfullscreenerrorAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOnwebkitfullscreenerror(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void onwebkitfullscreenerrorAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- ElementV8Internal::onwebkitfullscreenerrorAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onwheelAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- EventListener* v8Value = impl->onwheel();
- v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
- }
- static void onwheelAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::onwheelAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void onwheelAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- impl->setOnwheel(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
- }
- static void onwheelAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
- V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
- if (contextData && contextData->activityLogger()) {
- v8::Handle<v8::Value> loggerArg[] = { v8Value };
- contextData->activityLogger()->log("Element.onwheel", 1, &loggerArg[0], "Setter");
- }
- ElementV8Internal::onwheelAttributeSetter(v8Value, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void previousElementSiblingAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueFast(info, WTF::getPtr(ChildNode::previousElementSibling(*impl)), impl);
- }
- static void previousElementSiblingAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::previousElementSiblingAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void previousElementSiblingAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(ChildNode::previousElementSibling(*impl)));
- }
- static void previousElementSiblingAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::previousElementSiblingAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void nextElementSiblingAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueFast(info, WTF::getPtr(ChildNode::nextElementSibling(*impl)), impl);
- }
- static void nextElementSiblingAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::nextElementSiblingAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void nextElementSiblingAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(ChildNode::nextElementSibling(*impl)));
- }
- static void nextElementSiblingAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::nextElementSiblingAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void childrenAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueFast(info, WTF::getPtr(ParentNode::children(*impl)), impl);
- }
- static void childrenAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::childrenAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void childrenAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(ParentNode::children(*impl)));
- }
- static void childrenAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::childrenAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void firstElementChildAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueFast(info, WTF::getPtr(ParentNode::firstElementChild(*impl)), impl);
- }
- static void firstElementChildAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::firstElementChildAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void firstElementChildAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(ParentNode::firstElementChild(*impl)));
- }
- static void firstElementChildAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::firstElementChildAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void lastElementChildAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueFast(info, WTF::getPtr(ParentNode::lastElementChild(*impl)), impl);
- }
- static void lastElementChildAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::lastElementChildAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void lastElementChildAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(ParentNode::lastElementChild(*impl)));
- }
- static void lastElementChildAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::lastElementChildAttributeGetterForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void childElementCountAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- v8::Handle<v8::Object> holder = info.Holder();
- Element* impl = V8Element::toNative(holder);
- ASSERT(impl);
- v8SetReturnValueUnsigned(info, ParentNode::childElementCount(*impl));
- }
- static void childElementCountAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- ElementV8Internal::childElementCountAttributeGetter(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getAttributeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeErrorForMethod("getAttribute", "Element", 1, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, name, info[0]);
- v8SetReturnValueStringOrNull(info, impl->getAttribute(name), info.GetIsolate());
- }
- static void getAttributeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getAttributeMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void setAttributeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "setAttribute", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeError(exceptionState, 2, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- TOSTRING_VOID(V8StringResource<>, name, info[0]);
- TOSTRING_VOID(V8StringResource<>, value, info[1]);
- impl->setAttribute(name, value, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- }
- static void setAttributeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::setAttributeMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void removeAttributeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeErrorForMethod("removeAttribute", "Element", 1, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- TOSTRING_VOID(V8StringResource<>, name, info[0]);
- impl->removeAttribute(name);
- }
- static void removeAttributeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::removeAttributeMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getAttributeNodeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, name, info[0]);
- v8SetReturnValueFast(info, WTF::getPtr(impl->getAttributeNode(name)), impl);
- }
- static void getAttributeNodeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::ElementGetAttributeNode);
- ElementV8Internal::getAttributeNodeMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void setAttributeNodeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "setAttributeNode", "Element", info.Holder(), info.GetIsolate());
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- TONATIVE_VOID(Attr*, newAttr, V8Attr::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
- RefPtr<Attr> result = impl->setAttributeNode(newAttr, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void setAttributeNodeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::ElementSetAttributeNode);
- ElementV8Internal::setAttributeNodeMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void removeAttributeNodeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeAttributeNode", "Element", info.Holder(), info.GetIsolate());
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- TONATIVE_VOID(Attr*, oldAttr, V8Attr::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
- RefPtr<Attr> result = impl->removeAttributeNode(oldAttr, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void removeAttributeNodeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::ElementRemoveAttributeNode);
- ElementV8Internal::removeAttributeNodeMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getElementsByTagNameMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeErrorForMethod("getElementsByTagName", "Element", 1, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, name, info[0]);
- v8SetReturnValueFast(info, WTF::getPtr(impl->getElementsByTagName(name)), impl);
- }
- static void getElementsByTagNameMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getElementsByTagNameMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getElementsByTagNameMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeErrorForMethod("getElementsByTagName", "Element", 1, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, name, info[0]);
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->getElementsByTagName(name)));
- }
- static void getElementsByTagNameMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getElementsByTagNameMethodForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void hasAttributesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- v8SetReturnValueBool(info, impl->hasAttributes());
- }
- static void hasAttributesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::HasAttributes);
- ElementV8Internal::hasAttributesMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getAttributeNSMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeErrorForMethod("getAttributeNS", "Element", 2, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<WithNullCheck>, namespaceURI, info[0]);
- TOSTRING_VOID(V8StringResource<>, localName, info[1]);
- v8SetReturnValueStringOrNull(info, impl->getAttributeNS(namespaceURI, localName), info.GetIsolate());
- }
- static void getAttributeNSMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getAttributeNSMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void setAttributeNSMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "setAttributeNS", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 3)) {
- throwArityTypeError(exceptionState, 3, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- TOSTRING_VOID(V8StringResource<WithNullCheck>, namespaceURI, info[0]);
- TOSTRING_VOID(V8StringResource<>, qualifiedName, info[1]);
- TOSTRING_VOID(V8StringResource<>, value, info[2]);
- impl->setAttributeNS(namespaceURI, qualifiedName, value, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- }
- static void setAttributeNSMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::setAttributeNSMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void removeAttributeNSMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeErrorForMethod("removeAttributeNS", "Element", 2, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- TOSTRING_VOID(V8StringResource<WithNullCheck>, namespaceURI, info[0]);
- TOSTRING_VOID(V8StringResource<>, localName, info[1]);
- impl->removeAttributeNS(namespaceURI, localName);
- }
- static void removeAttributeNSMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::removeAttributeNSMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getElementsByTagNameNSMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeErrorForMethod("getElementsByTagNameNS", "Element", 2, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<WithNullCheck>, namespaceURI, info[0]);
- TOSTRING_VOID(V8StringResource<>, localName, info[1]);
- v8SetReturnValueFast(info, WTF::getPtr(impl->getElementsByTagNameNS(namespaceURI, localName)), impl);
- }
- static void getElementsByTagNameNSMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getElementsByTagNameNSMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getAttributeNodeNSMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<WithNullCheck>, namespaceURI, info[0]);
- TOSTRING_VOID(V8StringResource<>, localName, info[1]);
- v8SetReturnValueFast(info, WTF::getPtr(impl->getAttributeNodeNS(namespaceURI, localName)), impl);
- }
- static void getAttributeNodeNSMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::ElementGetAttributeNodeNS);
- ElementV8Internal::getAttributeNodeNSMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void setAttributeNodeNSMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "setAttributeNodeNS", "Element", info.Holder(), info.GetIsolate());
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- TONATIVE_VOID(Attr*, newAttr, V8Attr::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
- RefPtr<Attr> result = impl->setAttributeNodeNS(newAttr, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void setAttributeNodeNSMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::ElementSetAttributeNodeNS);
- ElementV8Internal::setAttributeNodeNSMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void hasAttributeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeErrorForMethod("hasAttribute", "Element", 1, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, name, info[0]);
- v8SetReturnValueBool(info, impl->hasAttribute(name));
- }
- static void hasAttributeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::hasAttributeMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void hasAttributeNSMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeErrorForMethod("hasAttributeNS", "Element", 2, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<WithNullCheck>, namespaceURI, info[0]);
- TOSTRING_VOID(V8StringResource<>, localName, info[1]);
- v8SetReturnValueBool(info, impl->hasAttributeNS(namespaceURI, localName));
- }
- static void hasAttributeNSMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::hasAttributeNSMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void matchesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "matches", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeError(exceptionState, 1, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, selectors, info[0]);
- bool result = impl->matches(selectors, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueBool(info, result);
- }
- static void matchesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::matchesMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void focusMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- impl->focus();
- }
- static void focusMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::focusMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void blurMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- impl->blur();
- }
- static void blurMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::blurMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollIntoViewMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- if (UNLIKELY(info.Length() <= 0)) {
- impl->scrollIntoView();
- return;
- }
- TONATIVE_VOID(bool, alignWithTop, info[0]->BooleanValue());
- impl->scrollIntoView(alignWithTop);
- }
- static void scrollIntoViewMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::scrollIntoViewMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollIntoViewIfNeededMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- if (UNLIKELY(info.Length() <= 0)) {
- impl->scrollIntoViewIfNeeded();
- return;
- }
- TONATIVE_VOID(bool, centerIfNeeded, info[0]->BooleanValue());
- impl->scrollIntoViewIfNeeded(centerIfNeeded);
- }
- static void scrollIntoViewIfNeededMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::scrollIntoViewIfNeededMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollByLinesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "scrollByLines", "Element", info.Holder(), info.GetIsolate());
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID_EXCEPTIONSTATE(int, lines, toInt32(info[0], exceptionState), exceptionState);
- impl->scrollByLines(lines);
- }
- static void scrollByLinesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::scrollByLinesMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void scrollByPagesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "scrollByPages", "Element", info.Holder(), info.GetIsolate());
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID_EXCEPTIONSTATE(int, pages, toInt32(info[0], exceptionState), exceptionState);
- impl->scrollByPages(pages);
- }
- static void scrollByPagesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::scrollByPagesMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getElementsByClassNameMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeErrorForMethod("getElementsByClassName", "Element", 1, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, classNames, info[0]);
- v8SetReturnValueFast(info, WTF::getPtr(impl->getElementsByClassName(classNames)), impl);
- }
- static void getElementsByClassNameMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getElementsByClassNameMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void insertAdjacentElementMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "insertAdjacentElement", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeError(exceptionState, 2, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- TOSTRING_VOID(V8StringResource<>, where, info[0]);
- TONATIVE_VOID(Element*, element, V8Element::toNativeWithTypeCheck(info.GetIsolate(), info[1]));
- RefPtr<Element> result = impl->insertAdjacentElement(where, element, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void insertAdjacentElementMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::InsertAdjacentElement);
- ElementV8Internal::insertAdjacentElementMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void insertAdjacentTextMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "insertAdjacentText", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeError(exceptionState, 2, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, where, info[0]);
- TOSTRING_VOID(V8StringResource<>, text, info[1]);
- impl->insertAdjacentText(where, text, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- }
- static void insertAdjacentTextMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::InsertAdjacentText);
- ElementV8Internal::insertAdjacentTextMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void insertAdjacentHTMLMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "insertAdjacentHTML", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeError(exceptionState, 2, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- TOSTRING_VOID(V8StringResource<>, where, info[0]);
- TOSTRING_VOID(V8StringResource<>, html, info[1]);
- impl->insertAdjacentHTML(where, html, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- }
- static void insertAdjacentHTMLMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::InsertAdjacentHTML);
- ElementV8Internal::insertAdjacentHTMLMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void webkitMatchesSelectorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "webkitMatchesSelector", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeError(exceptionState, 1, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, selectors, info[0]);
- bool result = impl->matches(selectors, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueBool(info, result);
- }
- static void webkitMatchesSelectorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::ElementPrefixedMatchesSelector);
- ElementV8Internal::webkitMatchesSelectorMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void createShadowRootMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "createShadowRoot", "Element", info.Holder(), info.GetIsolate());
- Element* impl = V8Element::toNative(info.Holder());
- RefPtr<ShadowRoot> result = impl->createShadowRoot(exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void createShadowRootMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::createShadowRootMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getDestinationInsertionPointsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- v8SetReturnValueFast(info, WTF::getPtr(impl->getDestinationInsertionPoints()), impl);
- }
- static void getDestinationInsertionPointsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getDestinationInsertionPointsMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getDestinationInsertionPointsMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->getDestinationInsertionPoints()));
- }
- static void getDestinationInsertionPointsMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getDestinationInsertionPointsMethodForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getClientRectsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- v8SetReturnValueFast(info, WTF::getPtr(impl->getClientRects()), impl);
- }
- static void getClientRectsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getClientRectsMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void getBoundingClientRectMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- v8SetReturnValueFast(info, WTF::getPtr(impl->getBoundingClientRect()), impl);
- }
- static void getBoundingClientRectMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::getBoundingClientRectMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void webkitRequestFullScreenMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "webkitRequestFullScreen", "Element", info.Holder(), info.GetIsolate());
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID_EXCEPTIONSTATE(unsigned, flags, toUInt16(info[0], exceptionState), exceptionState);
- impl->webkitRequestFullScreen(flags);
- }
- static void webkitRequestFullScreenMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::PrefixedElementRequestFullScreen);
- V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
- if (contextData && contextData->activityLogger()) {
- Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
- contextData->activityLogger()->log("Element.webkitRequestFullScreen", info.Length(), loggerArgs.data(), "Method");
- }
- ElementV8Internal::webkitRequestFullScreenMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void webkitRequestFullScreenMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "webkitRequestFullScreen", "Element", info.Holder(), info.GetIsolate());
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID_EXCEPTIONSTATE(unsigned, flags, toUInt16(info[0], exceptionState), exceptionState);
- impl->webkitRequestFullScreen(flags);
- }
- static void webkitRequestFullScreenMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::PrefixedElementRequestFullScreen);
- V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
- if (contextData && contextData->activityLogger()) {
- Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
- contextData->activityLogger()->log("Element.webkitRequestFullScreen", info.Length(), loggerArgs.data(), "Method");
- }
- ElementV8Internal::webkitRequestFullScreenMethodForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void webkitRequestFullscreenMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- impl->webkitRequestFullscreen();
- }
- static void webkitRequestFullscreenMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::PrefixedElementRequestFullscreen);
- V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
- if (contextData && contextData->activityLogger()) {
- Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
- contextData->activityLogger()->log("Element.webkitRequestFullscreen", info.Length(), loggerArgs.data(), "Method");
- }
- ElementV8Internal::webkitRequestFullscreenMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void webkitRequestFullscreenMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- impl->webkitRequestFullscreen();
- }
- static void webkitRequestFullscreenMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::PrefixedElementRequestFullscreen);
- V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
- if (contextData && contextData->activityLogger()) {
- Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
- contextData->activityLogger()->log("Element.webkitRequestFullscreen", info.Length(), loggerArgs.data(), "Method");
- }
- ElementV8Internal::webkitRequestFullscreenMethodForMainWorld(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void webkitRequestPointerLockMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- Element* impl = V8Element::toNative(info.Holder());
- impl->webkitRequestPointerLock();
- }
- static void webkitRequestPointerLockMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::PrefixedElementRequestPointerLock);
- ElementV8Internal::webkitRequestPointerLockMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void animate1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeErrorForMethod("animate", "Element", 2, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID(AnimationEffect*, effect, V8AnimationEffect::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
- TONATIVE_VOID(Dictionary, timingInput, Dictionary(info[1], info.GetIsolate()));
- if (!timingInput.isUndefinedOrNull() && !timingInput.isObject()) {
- throwTypeError(ExceptionMessages::failedToExecute("animate", "Element", "parameter 2 ('timingInput') is not an object."), info.GetIsolate());
- return;
- }
- ASSERT(impl);
- v8SetReturnValueFast(info, WTF::getPtr(ElementAnimation::animate(*impl, effect, timingInput)), impl);
- }
- static void animate2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeErrorForMethod("animate", "Element", 2, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID(AnimationEffect*, effect, V8AnimationEffect::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
- TONATIVE_VOID(double, duration, static_cast<double>(info[1]->NumberValue()));
- ASSERT(impl);
- v8SetReturnValueFast(info, WTF::getPtr(ElementAnimation::animate(*impl, effect, duration)), impl);
- }
- static void animate3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeErrorForMethod("animate", "Element", 1, info.Length(), info.GetIsolate());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID(AnimationEffect*, effect, V8AnimationEffect::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
- ASSERT(impl);
- v8SetReturnValueFast(info, WTF::getPtr(ElementAnimation::animate(*impl, effect)), impl);
- }
- static void animate4Method(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "animate", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeError(exceptionState, 2, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID(Vector<Dictionary>, keyframes, toNativeArray<Dictionary>(info[0], 1, info.GetIsolate()));
- TONATIVE_VOID(Dictionary, timingInput, Dictionary(info[1], info.GetIsolate()));
- if (!timingInput.isUndefinedOrNull() && !timingInput.isObject()) {
- exceptionState.throwTypeError("parameter 2 ('timingInput') is not an object.");
- exceptionState.throwIfNeeded();
- return;
- }
- ASSERT(impl);
- RefPtr<AnimationPlayer> result = ElementAnimation::animate(*impl, keyframes, timingInput, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void animate5Method(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "animate", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 2)) {
- throwArityTypeError(exceptionState, 2, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID(Vector<Dictionary>, keyframes, toNativeArray<Dictionary>(info[0], 1, info.GetIsolate()));
- TONATIVE_VOID(double, duration, static_cast<double>(info[1]->NumberValue()));
- ASSERT(impl);
- RefPtr<AnimationPlayer> result = ElementAnimation::animate(*impl, keyframes, duration, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void animate6Method(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "animate", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeError(exceptionState, 1, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TONATIVE_VOID(Vector<Dictionary>, keyframes, toNativeArray<Dictionary>(info[0], 1, info.GetIsolate()));
- ASSERT(impl);
- RefPtr<AnimationPlayer> result = ElementAnimation::animate(*impl, keyframes, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void animateMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- if (((info.Length() == 2) && (info[0]->IsNull() || V8AnimationEffect::hasInstance(info[0], info.GetIsolate())) && (info[1]->IsObject()))) {
- animate1Method(info);
- return;
- }
- if (((info.Length() == 2) && (info[0]->IsNull() || V8AnimationEffect::hasInstance(info[0], info.GetIsolate())))) {
- animate2Method(info);
- return;
- }
- if (((info.Length() == 1) && (info[0]->IsNull() || V8AnimationEffect::hasInstance(info[0], info.GetIsolate())))) {
- animate3Method(info);
- return;
- }
- if (((info.Length() == 2) && (info[0]->IsArray()) && (info[1]->IsObject()))) {
- animate4Method(info);
- return;
- }
- if (((info.Length() == 2) && (info[0]->IsArray()))) {
- animate5Method(info);
- return;
- }
- if (((info.Length() == 1) && (info[0]->IsArray()))) {
- animate6Method(info);
- return;
- }
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "animate", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeError(exceptionState, 1, info.Length());
- return;
- }
- exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
- }
- static void animateMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::ElementAnimateKeyframeListEffectNoTiming);
- ElementV8Internal::animateMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void removeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "remove", "Element", info.Holder(), info.GetIsolate());
- Element* impl = V8Element::toNative(info.Holder());
- CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
- ASSERT(impl);
- ChildNode::remove(*impl, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- }
- static void removeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::removeMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void querySelectorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "querySelector", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeError(exceptionState, 1, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, selectors, info[0]);
- ASSERT(impl);
- RefPtr<Element> result = ParentNode::querySelector(*impl, selectors, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void querySelectorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::querySelectorMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- static void querySelectorAllMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "querySelectorAll", "Element", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeError(exceptionState, 1, info.Length());
- return;
- }
- Element* impl = V8Element::toNative(info.Holder());
- TOSTRING_VOID(V8StringResource<>, selectors, info[0]);
- ASSERT(impl);
- RefPtr<NodeList> result = ParentNode::querySelectorAll(*impl, selectors, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
- }
- static void querySelectorAllMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
- ElementV8Internal::querySelectorAllMethod(info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
- }
- } // namespace ElementV8Internal
- static const V8DOMConfiguration::AttributeConfiguration V8ElementAttributes[] = {
- {"tagName", ElementV8Internal::tagNameAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"attributes", ElementV8Internal::attributesAttributeGetterCallback, 0, ElementV8Internal::attributesAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"style", ElementV8Internal::styleAttributeGetterCallback, 0, ElementV8Internal::styleAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"id", ElementV8Internal::idAttributeGetterCallback, ElementV8Internal::idAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"namespaceURI", ElementV8Internal::namespaceURIAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"prefix", ElementV8Internal::prefixAttributeGetterCallback, ElementV8Internal::prefixAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"localName", ElementV8Internal::localNameAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"offsetLeft", ElementV8Internal::offsetLeftAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"offsetTop", ElementV8Internal::offsetTopAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"offsetWidth", ElementV8Internal::offsetWidthAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"offsetHeight", ElementV8Internal::offsetHeightAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"offsetParent", ElementV8Internal::offsetParentAttributeGetterCallback, 0, ElementV8Internal::offsetParentAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"clientLeft", ElementV8Internal::clientLeftAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"clientTop", ElementV8Internal::clientTopAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"clientWidth", ElementV8Internal::clientWidthAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"clientHeight", ElementV8Internal::clientHeightAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"scrollLeft", ElementV8Internal::scrollLeftAttributeGetterCallback, ElementV8Internal::scrollLeftAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"scrollTop", ElementV8Internal::scrollTopAttributeGetterCallback, ElementV8Internal::scrollTopAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"scrollWidth", ElementV8Internal::scrollWidthAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"scrollHeight", ElementV8Internal::scrollHeightAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"innerHTML", ElementV8Internal::innerHTMLAttributeGetterCallback, ElementV8Internal::innerHTMLAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"outerHTML", ElementV8Internal::outerHTMLAttributeGetterCallback, ElementV8Internal::outerHTMLAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"className", ElementV8Internal::classNameAttributeGetterCallback, ElementV8Internal::classNameAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"classList", ElementV8Internal::classListAttributeGetterCallback, 0, ElementV8Internal::classListAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"dataset", ElementV8Internal::datasetAttributeGetterCallback, 0, ElementV8Internal::datasetAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"shadowRoot", ElementV8Internal::shadowRootAttributeGetterCallback, 0, ElementV8Internal::shadowRootAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"onbeforecopy", ElementV8Internal::onbeforecopyAttributeGetterCallback, ElementV8Internal::onbeforecopyAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"onbeforecut", ElementV8Internal::onbeforecutAttributeGetterCallback, ElementV8Internal::onbeforecutAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"onbeforepaste", ElementV8Internal::onbeforepasteAttributeGetterCallback, ElementV8Internal::onbeforepasteAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"oncopy", ElementV8Internal::oncopyAttributeGetterCallback, ElementV8Internal::oncopyAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"oncut", ElementV8Internal::oncutAttributeGetterCallback, ElementV8Internal::oncutAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"onpaste", ElementV8Internal::onpasteAttributeGetterCallback, ElementV8Internal::onpasteAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"onsearch", ElementV8Internal::onsearchAttributeGetterCallback, ElementV8Internal::onsearchAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"onselectstart", ElementV8Internal::onselectstartAttributeGetterCallback, ElementV8Internal::onselectstartAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"onwebkitfullscreenchange", ElementV8Internal::onwebkitfullscreenchangeAttributeGetterCallback, ElementV8Internal::onwebkitfullscreenchangeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"onwebkitfullscreenerror", ElementV8Internal::onwebkitfullscreenerrorAttributeGetterCallback, ElementV8Internal::onwebkitfullscreenerrorAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"onwheel", ElementV8Internal::onwheelAttributeGetterCallback, ElementV8Internal::onwheelAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"previousElementSibling", ElementV8Internal::previousElementSiblingAttributeGetterCallback, 0, ElementV8Internal::previousElementSiblingAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"nextElementSibling", ElementV8Internal::nextElementSiblingAttributeGetterCallback, 0, ElementV8Internal::nextElementSiblingAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"children", ElementV8Internal::childrenAttributeGetterCallback, 0, ElementV8Internal::childrenAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"firstElementChild", ElementV8Internal::firstElementChildAttributeGetterCallback, 0, ElementV8Internal::firstElementChildAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"lastElementChild", ElementV8Internal::lastElementChildAttributeGetterCallback, 0, ElementV8Internal::lastElementChildAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"childElementCount", ElementV8Internal::childElementCountAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- };
- static const V8DOMConfiguration::MethodConfiguration V8ElementMethods[] = {
- {"getAttribute", ElementV8Internal::getAttributeMethodCallback, 0, 1},
- {"setAttribute", ElementV8Internal::setAttributeMethodCallback, 0, 2},
- {"removeAttribute", ElementV8Internal::removeAttributeMethodCallback, 0, 1},
- {"getAttributeNode", ElementV8Internal::getAttributeNodeMethodCallback, 0, 0},
- {"setAttributeNode", ElementV8Internal::setAttributeNodeMethodCallback, 0, 0},
- {"removeAttributeNode", ElementV8Internal::removeAttributeNodeMethodCallback, 0, 0},
- {"getElementsByTagName", ElementV8Internal::getElementsByTagNameMethodCallback, ElementV8Internal::getElementsByTagNameMethodCallbackForMainWorld, 1},
- {"hasAttributes", ElementV8Internal::hasAttributesMethodCallback, 0, 0},
- {"getAttributeNS", ElementV8Internal::getAttributeNSMethodCallback, 0, 2},
- {"setAttributeNS", ElementV8Internal::setAttributeNSMethodCallback, 0, 3},
- {"removeAttributeNS", ElementV8Internal::removeAttributeNSMethodCallback, 0, 2},
- {"getElementsByTagNameNS", ElementV8Internal::getElementsByTagNameNSMethodCallback, 0, 2},
- {"getAttributeNodeNS", ElementV8Internal::getAttributeNodeNSMethodCallback, 0, 0},
- {"setAttributeNodeNS", ElementV8Internal::setAttributeNodeNSMethodCallback, 0, 0},
- {"hasAttribute", ElementV8Internal::hasAttributeMethodCallback, 0, 1},
- {"hasAttributeNS", ElementV8Internal::hasAttributeNSMethodCallback, 0, 2},
- {"matches", ElementV8Internal::matchesMethodCallback, 0, 1},
- {"focus", ElementV8Internal::focusMethodCallback, 0, 0},
- {"blur", ElementV8Internal::blurMethodCallback, 0, 0},
- {"scrollIntoView", ElementV8Internal::scrollIntoViewMethodCallback, 0, 0},
- {"scrollIntoViewIfNeeded", ElementV8Internal::scrollIntoViewIfNeededMethodCallback, 0, 0},
- {"scrollByLines", ElementV8Internal::scrollByLinesMethodCallback, 0, 0},
- {"scrollByPages", ElementV8Internal::scrollByPagesMethodCallback, 0, 0},
- {"getElementsByClassName", ElementV8Internal::getElementsByClassNameMethodCallback, 0, 1},
- {"insertAdjacentElement", ElementV8Internal::insertAdjacentElementMethodCallback, 0, 2},
- {"insertAdjacentText", ElementV8Internal::insertAdjacentTextMethodCallback, 0, 2},
- {"insertAdjacentHTML", ElementV8Internal::insertAdjacentHTMLMethodCallback, 0, 2},
- {"webkitMatchesSelector", ElementV8Internal::webkitMatchesSelectorMethodCallback, 0, 1},
- {"createShadowRoot", ElementV8Internal::createShadowRootMethodCallback, 0, 0},
- {"getDestinationInsertionPoints", ElementV8Internal::getDestinationInsertionPointsMethodCallback, ElementV8Internal::getDestinationInsertionPointsMethodCallbackForMainWorld, 0},
- {"getClientRects", ElementV8Internal::getClientRectsMethodCallback, 0, 0},
- {"getBoundingClientRect", ElementV8Internal::getBoundingClientRectMethodCallback, 0, 0},
- {"webkitRequestFullScreen", ElementV8Internal::webkitRequestFullScreenMethodCallback, ElementV8Internal::webkitRequestFullScreenMethodCallbackForMainWorld, 0},
- {"webkitRequestFullscreen", ElementV8Internal::webkitRequestFullscreenMethodCallback, ElementV8Internal::webkitRequestFullscreenMethodCallbackForMainWorld, 0},
- {"webkitRequestPointerLock", ElementV8Internal::webkitRequestPointerLockMethodCallback, 0, 0},
- {"animate", ElementV8Internal::animateMethodCallback, 0, 2},
- {"remove", ElementV8Internal::removeMethodCallback, 0, 0},
- {"querySelector", ElementV8Internal::querySelectorMethodCallback, 0, 1},
- {"querySelectorAll", ElementV8Internal::querySelectorAllMethodCallback, 0, 1},
- };
- static void configureV8ElementTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
- {
- functionTemplate->ReadOnlyPrototype();
- v8::Local<v8::Signature> defaultSignature;
- defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "Element", V8Node::domTemplate(isolate), V8Element::internalFieldCount,
- V8ElementAttributes, WTF_ARRAY_LENGTH(V8ElementAttributes),
- 0, 0,
- V8ElementMethods, WTF_ARRAY_LENGTH(V8ElementMethods),
- isolate);
- v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate();
- v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate();
- if (RuntimeEnabledFeatures::touchEnabled()) {
- static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
- {"ontouchcancel", ElementV8Internal::ontouchcancelAttributeGetterCallback, ElementV8Internal::ontouchcancelAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
- V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
- }
- if (RuntimeEnabledFeatures::touchEnabled()) {
- static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
- {"ontouchend", ElementV8Internal::ontouchendAttributeGetterCallback, ElementV8Internal::ontouchendAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
- V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
- }
- if (RuntimeEnabledFeatures::touchEnabled()) {
- static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
- {"ontouchmove", ElementV8Internal::ontouchmoveAttributeGetterCallback, ElementV8Internal::ontouchmoveAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
- V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
- }
- if (RuntimeEnabledFeatures::touchEnabled()) {
- static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
- {"ontouchstart", ElementV8Internal::ontouchstartAttributeGetterCallback, ElementV8Internal::ontouchstartAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
- V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
- }
- static const V8DOMConfiguration::ConstantConfiguration V8ElementConstants[] = {
- {"ALLOW_KEYBOARD_INPUT", 1},
- };
- V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8ElementConstants, WTF_ARRAY_LENGTH(V8ElementConstants), isolate);
- COMPILE_ASSERT(1 == Element::ALLOW_KEYBOARD_INPUT, TheValueOfElement_ALLOW_KEYBOARD_INPUTDoesntMatchWithImplementation);
- // Custom toString template
- functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
- }
- v8::Handle<v8::FunctionTemplate> V8Element::domTemplate(v8::Isolate* isolate)
- {
- V8PerIsolateData* data = V8PerIsolateData::from(isolate);
- v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo));
- if (!result.IsEmpty())
- return result;
- TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
- result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
- configureV8ElementTemplate(result, isolate);
- data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result);
- return result;
- }
- bool V8Element::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
- {
- return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
- }
- v8::Handle<v8::Object> V8Element::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
- {
- return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
- }
- Element* V8Element::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
- {
- return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Object>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0;
- }
- EventTarget* V8Element::toEventTarget(v8::Handle<v8::Object> object)
- {
- return toNative(object);
- }
- v8::Handle<v8::Object> wrap(Element* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
- {
- ASSERT(impl);
- if (impl->isHTMLElement())
- return wrap(toHTMLElement(impl), creationContext, isolate);
- if (impl->isSVGElement())
- return wrap(toSVGElement(impl), creationContext, isolate);
- v8::Handle<v8::Object> wrapper = V8Element::createWrapper(impl, creationContext, isolate);
- return wrapper;
- }
- v8::Handle<v8::Object> V8Element::createWrapper(PassRefPtr<Element> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
- {
- ASSERT(impl);
- ASSERT(!DOMDataStore::containsWrapper<V8Element>(impl.get(), isolate));
- if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
- const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get())->typeInfo();
- // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
- // the same object de-ref functions, though, so use that as the basis of the check.
- RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
- }
- v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
- if (UNLIKELY(wrapper.IsEmpty()))
- return wrapper;
- installPerContextEnabledProperties(wrapper, impl.get(), isolate);
- V8DOMWrapper::associateObjectWithWrapper<V8Element>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
- return wrapper;
- }
- void V8Element::derefObject(void* object)
- {
- fromInternalPointer(object)->deref();
- }
- template<>
- v8::Handle<v8::Value> toV8NoInline(Element* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
- {
- return toV8(impl, creationContext, isolate);
- }
- } // namespace WebCore
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement