OLD | NEW |
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> | 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> |
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> | 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> |
5 # Copyright (C) 2006 Apple Computer, Inc. | 5 # Copyright (C) 2006 Apple Computer, Inc. |
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. | 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. |
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. | 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. |
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. | 10 # Copyright (C) 2012 Ericsson AB. All rights reserved. |
(...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 throwNotEnoughArgumentsError(args.GetIsolate()); | 2659 throwNotEnoughArgumentsError(args.GetIsolate()); |
2660 return; | 2660 return; |
2661 } | 2661 } |
2662 | 2662 |
2663 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]); | 2663 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]); |
2664 ${implClassName}Init eventInit; | 2664 ${implClassName}Init eventInit; |
2665 if (args.Length() >= 2) { | 2665 if (args.Length() >= 2) { |
2666 V8TRYCATCH_VOID(Dictionary, options, Dictionary(args[1], args.GetIsolate
())); | 2666 V8TRYCATCH_VOID(Dictionary, options, Dictionary(args[1], args.GetIsolate
())); |
2667 if (!fill${implClassName}Init(eventInit, options)) | 2667 if (!fill${implClassName}Init(eventInit, options)) |
2668 return; | 2668 return; |
| 2669 END |
| 2670 for (my $index = 0; $index < @{$interface->attributes}; $index++) { |
| 2671 my $attribute = @{$interface->attributes}[$index]; |
| 2672 if ($attribute->type eq "any") { |
| 2673 my $attributeName = $attribute->name; |
| 2674 $implementation{nameSpaceInternal}->add(<<END); |
| 2675 v8::Local<v8::Value> ${attributeName}; |
| 2676 options.get("${attributeName}", ${attributeName}); |
| 2677 if (!${attributeName}.IsEmpty()) { |
| 2678 args.Holder()->SetHiddenValue(V8HiddenPropertyName::${attributeName}
(), ${attributeName}); |
| 2679 eventInit.${attributeName}IsSet = true; |
| 2680 } |
| 2681 END |
| 2682 } |
| 2683 } |
| 2684 $implementation{nameSpaceInternal}->add(<<END); |
2669 } | 2685 } |
2670 | 2686 |
2671 RefPtr<${implClassName}> event = ${implClassName}::create(type, eventInit); | 2687 RefPtr<${implClassName}> event = ${implClassName}::create(type, eventInit); |
2672 | 2688 |
2673 v8::Handle<v8::Object> wrapper = args.Holder(); | 2689 v8::Handle<v8::Object> wrapper = args.Holder(); |
2674 V8DOMWrapper::associateObjectWithWrapper(event.release(), &${v8ClassName}::i
nfo, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); | 2690 V8DOMWrapper::associateObjectWithWrapper(event.release(), &${v8ClassName}::i
nfo, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); |
2675 args.GetReturnValue().Set(wrapper); | 2691 v8SetReturnValue(args, wrapper); |
2676 } | 2692 } |
2677 END | 2693 END |
2678 | 2694 |
2679 my $code = ""; | 2695 my $code = ""; |
2680 $code .= <<END; | 2696 $code .= <<END; |
2681 bool fill${implClassName}Init(${implClassName}Init& eventInit, const Dictionary&
options) | 2697 bool fill${implClassName}Init(${implClassName}Init& eventInit, const Dictionary&
options) |
2682 { | 2698 { |
2683 END | 2699 END |
2684 | 2700 |
2685 foreach my $interfaceBase (@{$interface->parents}) { | 2701 foreach my $interfaceBase (@{$interface->parents}) { |
2686 $code .= <<END; | 2702 $code .= <<END; |
2687 if (!fill${interfaceBase}Init(eventInit, options)) | 2703 if (!fill${interfaceBase}Init(eventInit, options)) |
2688 return false; | 2704 return false; |
2689 | 2705 |
2690 END | 2706 END |
2691 } | 2707 } |
2692 | 2708 |
2693 for (my $index = 0; $index < @{$interface->attributes}; $index++) { | 2709 for (my $index = 0; $index < @{$interface->attributes}; $index++) { |
2694 my $attribute = @{$interface->attributes}[$index]; | 2710 my $attribute = @{$interface->attributes}[$index]; |
2695 if ($attribute->extendedAttributes->{"InitializedByEventConstructor"}) { | 2711 if ($attribute->extendedAttributes->{"InitializedByEventConstructor"}) { |
2696 my $attributeName = $attribute->name; | 2712 my $attributeName = $attribute->name; |
2697 $code .= " options.get(\"$attributeName\", eventInit.$attributeNa
me);\n"; | 2713 my $attributeType = $attribute->type; |
| 2714 if (not ($attribute->type eq "any")) { |
| 2715 $code .= " options.get(\"$attributeName\", eventInit.$attribu
teName);\n"; |
| 2716 } |
2698 } | 2717 } |
2699 } | 2718 } |
2700 | 2719 |
2701 $code .= <<END; | 2720 $code .= <<END; |
2702 return true; | 2721 return true; |
2703 } | 2722 } |
2704 | 2723 |
2705 END | 2724 END |
2706 $implementation{nameSpaceWebCore}->add($code); | 2725 $implementation{nameSpaceWebCore}->add($code); |
2707 } | 2726 } |
(...skipping 3328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6036 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { | 6055 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { |
6037 $found = 1; | 6056 $found = 1; |
6038 } | 6057 } |
6039 return 1 if $found; | 6058 return 1 if $found; |
6040 }, 0); | 6059 }, 0); |
6041 | 6060 |
6042 return $found; | 6061 return $found; |
6043 } | 6062 } |
6044 | 6063 |
6045 1; | 6064 1; |
OLD | NEW |