OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "sky/engine/bindings/core/v8/Dictionary.h" | 37 #include "sky/engine/bindings/core/v8/Dictionary.h" |
38 #include "sky/engine/bindings/core/v8/ExceptionState.h" | 38 #include "sky/engine/bindings/core/v8/ExceptionState.h" |
39 #include "sky/engine/bindings/core/v8/V8Binding.h" | 39 #include "sky/engine/bindings/core/v8/V8Binding.h" |
40 #include "sky/engine/bindings/core/v8/V8BindingMacros.h" | 40 #include "sky/engine/bindings/core/v8/V8BindingMacros.h" |
41 #include "sky/engine/core/animation/ElementAnimation.h" | 41 #include "sky/engine/core/animation/ElementAnimation.h" |
42 #include "sky/engine/core/dom/Element.h" | 42 #include "sky/engine/core/dom/Element.h" |
43 #include "sky/engine/wtf/GetPtr.h" | 43 #include "sky/engine/wtf/GetPtr.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 void V8Element::scrollLeftAttributeSetterCustom(v8::Local<v8::Value> value, cons
t v8::PropertyCallbackInfo<void>& info) | |
48 { | |
49 ExceptionState exceptionState(ExceptionState::SetterContext, "scrollLeft", "
Element", info.Holder(), info.GetIsolate()); | |
50 Element* impl = V8Element::toNative(info.Holder()); | |
51 | |
52 if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject())
{ | |
53 TONATIVE_VOID(Dictionary, scrollOptionsHorizontal, Dictionary(value, inf
o.GetIsolate())); | |
54 impl->setScrollLeft(scrollOptionsHorizontal, exceptionState); | |
55 exceptionState.throwIfNeeded(); | |
56 return; | |
57 } | |
58 | |
59 TONATIVE_VOID_EXCEPTIONSTATE(float, position, toInt32(value, exceptionState)
, exceptionState); | |
60 impl->setScrollLeft(position); | |
61 } | |
62 | |
63 void V8Element::scrollTopAttributeSetterCustom(v8::Local<v8::Value> value, const
v8::PropertyCallbackInfo<void>& info) | |
64 { | |
65 ExceptionState exceptionState(ExceptionState::SetterContext, "scrollTop", "E
lement", info.Holder(), info.GetIsolate()); | |
66 Element* impl = V8Element::toNative(info.Holder()); | |
67 | |
68 if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject())
{ | |
69 TONATIVE_VOID(Dictionary, scrollOptionsVertical, Dictionary(value, info.
GetIsolate())); | |
70 impl->setScrollTop(scrollOptionsVertical, exceptionState); | |
71 exceptionState.throwIfNeeded(); | |
72 return; | |
73 } | |
74 | |
75 TONATIVE_VOID_EXCEPTIONSTATE(float, position, toInt32(value, exceptionState)
, exceptionState); | |
76 impl->setScrollTop(position); | |
77 } | |
78 | |
79 //////////////////////////////////////////////////////////////////////////////// | 47 //////////////////////////////////////////////////////////////////////////////// |
80 // Overload resolution for animate() | 48 // Overload resolution for animate() |
81 // FIXME: needs support for union types http://crbug.com/240176 | 49 // FIXME: needs support for union types http://crbug.com/240176 |
82 //////////////////////////////////////////////////////////////////////////////// | 50 //////////////////////////////////////////////////////////////////////////////// |
83 | 51 |
84 // AnimationPlayer animate(AnimationEffect? effect); | 52 // AnimationPlayer animate(AnimationEffect? effect); |
85 void animate1Method(const v8::FunctionCallbackInfo<v8::Value>& info) | 53 void animate1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
86 { | 54 { |
87 Element* impl = V8Element::toNative(info.Holder()); | 55 Element* impl = V8Element::toNative(info.Holder()); |
88 TONATIVE_VOID(AnimationEffect*, effect, V8AnimationEffect::toNativeWithTypeC
heck(info.GetIsolate(), info[0])); | 56 TONATIVE_VOID(AnimationEffect*, effect, V8AnimationEffect::toNativeWithTypeC
heck(info.GetIsolate(), info[0])); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 setArityTypeError(exceptionState, "[1]", info.Length()); | 192 setArityTypeError(exceptionState, "[1]", info.Length()); |
225 exceptionState.throwIfNeeded(); | 193 exceptionState.throwIfNeeded(); |
226 return; | 194 return; |
227 break; | 195 break; |
228 } | 196 } |
229 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 197 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
230 exceptionState.throwIfNeeded(); | 198 exceptionState.throwIfNeeded(); |
231 } | 199 } |
232 | 200 |
233 } // namespace blink | 201 } // namespace blink |
OLD | NEW |