| 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 5838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5849 return undef if !$contentAttributeName; | 5849 return undef if !$contentAttributeName; |
| 5850 | 5850 |
| 5851 $contentAttributeName = lc AttributeNameForGetterAndSetter($attribute) if $c
ontentAttributeName eq "VALUE_IS_MISSING"; | 5851 $contentAttributeName = lc AttributeNameForGetterAndSetter($attribute) if $c
ontentAttributeName eq "VALUE_IS_MISSING"; |
| 5852 | 5852 |
| 5853 my $namespace = NamespaceForAttributeName($interfaceName, $contentAttributeN
ame); | 5853 my $namespace = NamespaceForAttributeName($interfaceName, $contentAttributeN
ame); |
| 5854 | 5854 |
| 5855 AddToImplIncludes("${namespace}.h"); | 5855 AddToImplIncludes("${namespace}.h"); |
| 5856 return "WebCore::${namespace}::${contentAttributeName}Attr"; | 5856 return "WebCore::${namespace}::${contentAttributeName}Attr"; |
| 5857 } | 5857 } |
| 5858 | 5858 |
| 5859 sub CanUseFastAttribute | |
| 5860 { | |
| 5861 my $attribute = shift; | |
| 5862 return !IsSVGAnimatedType($attribute->type); | |
| 5863 } | |
| 5864 | |
| 5865 sub GetterExpression | 5859 sub GetterExpression |
| 5866 { | 5860 { |
| 5867 my ($interfaceName, $attribute) = @_; | 5861 my ($interfaceName, $attribute) = @_; |
| 5868 | 5862 |
| 5869 my $contentAttributeName = ContentAttributeName($interfaceName, $attribute); | 5863 my $contentAttributeName = ContentAttributeName($interfaceName, $attribute); |
| 5870 | 5864 |
| 5871 if (!$contentAttributeName) { | 5865 if (!$contentAttributeName) { |
| 5872 return (ToMethodName(AttributeNameForGetterAndSetter($attribute))); | 5866 return (ToMethodName(AttributeNameForGetterAndSetter($attribute))); |
| 5873 } | 5867 } |
| 5874 | 5868 |
| 5875 my $functionName; | 5869 my $functionName; |
| 5876 if ($attribute->extendedAttributes->{"URL"}) { | 5870 if ($attribute->extendedAttributes->{"URL"}) { |
| 5877 $functionName = "getURLAttribute"; | 5871 $functionName = "getURLAttribute"; |
| 5878 } elsif ($attribute->type eq "boolean") { | 5872 } elsif ($attribute->type eq "boolean") { |
| 5879 if (CanUseFastAttribute($attribute)) { | 5873 $functionName = "fastHasAttribute"; |
| 5880 $functionName = "fastHasAttribute"; | |
| 5881 } else { | |
| 5882 $functionName = "hasAttribute"; | |
| 5883 } | |
| 5884 } elsif ($attribute->type eq "long") { | 5874 } elsif ($attribute->type eq "long") { |
| 5885 $functionName = "getIntegralAttribute"; | 5875 $functionName = "getIntegralAttribute"; |
| 5886 } elsif ($attribute->type eq "unsigned long") { | 5876 } elsif ($attribute->type eq "unsigned long") { |
| 5887 $functionName = "getUnsignedIntegralAttribute"; | 5877 $functionName = "getUnsignedIntegralAttribute"; |
| 5888 } else { | 5878 } else { |
| 5889 if ($contentAttributeName eq "WebCore::HTMLNames::idAttr") { | 5879 if ($contentAttributeName eq "WebCore::HTMLNames::idAttr") { |
| 5890 $functionName = "getIdAttribute"; | 5880 $functionName = "getIdAttribute"; |
| 5891 $contentAttributeName = ""; | 5881 $contentAttributeName = ""; |
| 5892 } elsif ($contentAttributeName eq "WebCore::HTMLNames::nameAttr") { | 5882 } elsif ($contentAttributeName eq "WebCore::HTMLNames::nameAttr") { |
| 5893 $functionName = "getNameAttribute"; | 5883 $functionName = "getNameAttribute"; |
| 5894 $contentAttributeName = ""; | 5884 $contentAttributeName = ""; |
| 5895 } elsif ($contentAttributeName eq "WebCore::HTMLNames::classAttr") { | 5885 } elsif ($contentAttributeName eq "WebCore::HTMLNames::classAttr") { |
| 5896 $functionName = "getClassAttribute"; | 5886 $functionName = "getClassAttribute"; |
| 5897 $contentAttributeName = ""; | 5887 $contentAttributeName = ""; |
| 5898 } elsif (CanUseFastAttribute($attribute)) { | 5888 } else { |
| 5899 $functionName = "fastGetAttribute"; | 5889 $functionName = "fastGetAttribute"; |
| 5900 } else { | |
| 5901 $functionName = "getAttribute"; | |
| 5902 } | 5890 } |
| 5903 } | 5891 } |
| 5904 | 5892 |
| 5905 return ($functionName, $contentAttributeName); | 5893 return ($functionName, $contentAttributeName); |
| 5906 } | 5894 } |
| 5907 | 5895 |
| 5908 sub SetterExpression | 5896 sub SetterExpression |
| 5909 { | 5897 { |
| 5910 my ($interfaceName, $attribute) = @_; | 5898 my ($interfaceName, $attribute) = @_; |
| 5911 | 5899 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6025 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { | 6013 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { |
| 6026 $found = 1; | 6014 $found = 1; |
| 6027 } | 6015 } |
| 6028 return 1 if $found; | 6016 return 1 if $found; |
| 6029 }, 0); | 6017 }, 0); |
| 6030 | 6018 |
| 6031 return $found; | 6019 return $found; |
| 6032 } | 6020 } |
| 6033 | 6021 |
| 6034 1; | 6022 1; |
| OLD | NEW |