This source file includes following definitions.
- scrollLeftAttributeSetterCustom
- scrollTopAttributeSetterCustom
#include "config.h"
#include "V8Element.h"
#include "RuntimeEnabledFeatures.h"
#include "bindings/v8/Dictionary.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8BindingMacros.h"
#include "core/dom/Element.h"
namespace WebCore {
void V8Element::scrollLeftAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
ExceptionState exceptionState(ExceptionState::SetterContext, "scrollLeft", "Element", info.Holder(), info.GetIsolate());
Element* impl = V8Element::toNative(info.Holder());
if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject()) {
V8TRYCATCH_VOID(Dictionary, scrollOptionsHorizontal, Dictionary(value, info.GetIsolate()));
impl->setScrollLeft(scrollOptionsHorizontal, exceptionState);
exceptionState.throwIfNeeded();
return;
}
V8TRYCATCH_EXCEPTION_VOID(int, position, toInt32(value, exceptionState), exceptionState);
impl->setScrollLeft(position);
}
void V8Element::scrollTopAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
ExceptionState exceptionState(ExceptionState::SetterContext, "scrollTop", "Element", info.Holder(), info.GetIsolate());
Element* impl = V8Element::toNative(info.Holder());
if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject()) {
V8TRYCATCH_VOID(Dictionary, scrollOptionsVertical, Dictionary(value, info.GetIsolate()));
impl->setScrollTop(scrollOptionsVertical, exceptionState);
exceptionState.throwIfNeeded();
return;
}
V8TRYCATCH_EXCEPTION_VOID(int, position, toInt32(value, exceptionState), exceptionState);
impl->setScrollTop(position);
}
}