| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "bindings/core/v8/V8AnimationEffect.h" | 34 #include "bindings/core/v8/V8AnimationEffect.h" |
| 35 #include "bindings/core/v8/V8AnimationPlayer.h" | 35 #include "bindings/core/v8/V8AnimationPlayer.h" |
| 36 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | 36 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
| 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/core/frame/UseCounter.h" | |
| 44 #include "sky/engine/wtf/GetPtr.h" | 43 #include "sky/engine/wtf/GetPtr.h" |
| 45 | 44 |
| 46 namespace blink { | 45 namespace blink { |
| 47 | 46 |
| 48 void V8Element::scrollLeftAttributeSetterCustom(v8::Local<v8::Value> value, cons
t v8::PropertyCallbackInfo<void>& info) | 47 void V8Element::scrollLeftAttributeSetterCustom(v8::Local<v8::Value> value, cons
t v8::PropertyCallbackInfo<void>& info) |
| 49 { | 48 { |
| 50 ExceptionState exceptionState(ExceptionState::SetterContext, "scrollLeft", "
Element", info.Holder(), info.GetIsolate()); | 49 ExceptionState exceptionState(ExceptionState::SetterContext, "scrollLeft", "
Element", info.Holder(), info.GetIsolate()); |
| 51 Element* impl = V8Element::toNative(info.Holder()); | 50 Element* impl = V8Element::toNative(info.Holder()); |
| 52 | 51 |
| 53 if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject())
{ | 52 if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject())
{ |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 return; | 173 return; |
| 175 } | 174 } |
| 176 // AnimationPlayer animate(AnimationEffect effect); | 175 // AnimationPlayer animate(AnimationEffect effect); |
| 177 if (V8AnimationEffect::hasInstance(info[0], isolate)) { | 176 if (V8AnimationEffect::hasInstance(info[0], isolate)) { |
| 178 animate1Method(info); | 177 animate1Method(info); |
| 179 return; | 178 return; |
| 180 } | 179 } |
| 181 // [MeasureAs=ElementAnimateKeyframeListEffectNoTiming] | 180 // [MeasureAs=ElementAnimateKeyframeListEffectNoTiming] |
| 182 // AnimationPlayer animate(sequence<Dictionary> effect); | 181 // AnimationPlayer animate(sequence<Dictionary> effect); |
| 183 if (info[0]->IsArray()) { | 182 if (info[0]->IsArray()) { |
| 184 UseCounter::count(callingExecutionContext(isolate), UseCounter::Elem
entAnimateKeyframeListEffectNoTiming); | |
| 185 animate2Method(info); | 183 animate2Method(info); |
| 186 return; | 184 return; |
| 187 } | 185 } |
| 188 break; | 186 break; |
| 189 case 2: | 187 case 2: |
| 190 // As above, null resolved to AnimationEffect | 188 // As above, null resolved to AnimationEffect |
| 191 // AnimationPlayer animate(AnimationEffect? effect, Dictionary timing); | 189 // AnimationPlayer animate(AnimationEffect? effect, Dictionary timing); |
| 192 if (info[0]->IsNull() && info[1]->IsObject()) { | 190 if (info[0]->IsNull() && info[1]->IsObject()) { |
| 193 animate4Method(info); | 191 animate4Method(info); |
| 194 return; | 192 return; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 205 return; | 203 return; |
| 206 } | 204 } |
| 207 // AnimationPlayer animate(AnimationEffect effect, double timing); | 205 // AnimationPlayer animate(AnimationEffect effect, double timing); |
| 208 if (V8AnimationEffect::hasInstance(info[0], isolate)) { | 206 if (V8AnimationEffect::hasInstance(info[0], isolate)) { |
| 209 animate3Method(info); | 207 animate3Method(info); |
| 210 return; | 208 return; |
| 211 } | 209 } |
| 212 // [MeasureAs=ElementAnimateKeyframeListEffectObjectTiming] | 210 // [MeasureAs=ElementAnimateKeyframeListEffectObjectTiming] |
| 213 // AnimationPlayer animate(sequence<Dictionary> effect, Dictionary timin
g); | 211 // AnimationPlayer animate(sequence<Dictionary> effect, Dictionary timin
g); |
| 214 if (info[0]->IsArray() && info[1]->IsObject()) { | 212 if (info[0]->IsArray() && info[1]->IsObject()) { |
| 215 UseCounter::count(callingExecutionContext(isolate), UseCounter::Elem
entAnimateKeyframeListEffectObjectTiming); | |
| 216 animate6Method(info); | 213 animate6Method(info); |
| 217 return; | 214 return; |
| 218 } | 215 } |
| 219 // [MeasureAs=ElementAnimateKeyframeListEffectDoubleTiming] | 216 // [MeasureAs=ElementAnimateKeyframeListEffectDoubleTiming] |
| 220 // AnimationPlayer animate(sequence<Dictionary> effect, double timing); | 217 // AnimationPlayer animate(sequence<Dictionary> effect, double timing); |
| 221 if (info[0]->IsArray()) { | 218 if (info[0]->IsArray()) { |
| 222 UseCounter::count(callingExecutionContext(isolate), UseCounter::Elem
entAnimateKeyframeListEffectDoubleTiming); | |
| 223 animate5Method(info); | 219 animate5Method(info); |
| 224 return; | 220 return; |
| 225 } | 221 } |
| 226 break; | 222 break; |
| 227 default: | 223 default: |
| 228 setArityTypeError(exceptionState, "[1]", info.Length()); | 224 setArityTypeError(exceptionState, "[1]", info.Length()); |
| 229 exceptionState.throwIfNeeded(); | 225 exceptionState.throwIfNeeded(); |
| 230 return; | 226 return; |
| 231 break; | 227 break; |
| 232 } | 228 } |
| 233 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 229 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
| 234 exceptionState.throwIfNeeded(); | 230 exceptionState.throwIfNeeded(); |
| 235 } | 231 } |
| 236 | 232 |
| 237 } // namespace blink | 233 } // namespace blink |
| OLD | NEW |