Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Unified Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 153883003: [SVG] SVGAnimatedTransform{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove m_zoomAndPan Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/svg/hixie/transform/001-expected.txt ('k') | Source/bindings/tests/idls/TestInterface.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/code_generator_v8.pm
diff --git a/Source/bindings/scripts/code_generator_v8.pm b/Source/bindings/scripts/code_generator_v8.pm
index 9eba7868b01b48f20f66ff62556ec204c65ef93c..fd40eaa869dd59d4b1ce821520aa97f0f78667e2 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -246,17 +246,12 @@ my %svgTypeNewPropertyImplementation = (
"SVGRect" => 1,
"SVGString" => 1,
"SVGStringList" => 1,
+ "SVGTransform" => 1,
+ "SVGTransformList" => 1,
);
my %svgTypeNeedingTearOff = (
- "SVGMatrix" => "SVGMatrixTearOff",
"SVGPathSegList" => "SVGPathSegListPropertyTearOff",
- "SVGTransform" => "SVGPropertyTearOff<SVGTransform>",
- "SVGTransformList" => "SVGTransformListPropertyTearOff"
-);
-
-my %svgTypeWithWritablePropertiesNeedingTearOff = (
- "SVGMatrix" => 1
);
# Default license header
@@ -559,12 +554,13 @@ END
if ($svgPropertyType) {
$setReferenceType = $svgNativeType;
}
+ my $setReferenceImplType = GetImplNameFromImplementedBy($setReferenceType);
my $setReferenceName = $setReference->name;
AddIncludesForType($setReferenceType);
$code .= <<END;
- ${setReferenceType}* ${setReferenceName} = impl->${setReferenceName}();
+ ${setReferenceImplType}* ${setReferenceName} = impl->${setReferenceName}();
if (${setReferenceName}) {
if (!DOMDataStore::containsWrapper<${setReferenceV8Type}>(${setReferenceName}, isolate))
wrap(${setReferenceName}, creationContext, isolate);
@@ -614,10 +610,6 @@ sub GetSVGPropertyTypes
if ($svgNativeType =~ /SVGPropertyTearOff/) {
$svgPropertyType = $svgWrappedNativeType;
AddToHeaderIncludes("core/svg/properties/SVGAnimatedPropertyTearOff.h");
- } elsif ($svgNativeType =~ /SVGMatrixTearOff/) {
- $svgPropertyType = $svgWrappedNativeType;
- AddToHeaderIncludes("core/svg/properties/SVGMatrixTearOff.h");
- AddToHeaderIncludes("core/svg/properties/SVGAnimatedPropertyTearOff.h");
} elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SVGStaticListPropertyTearOff/ or $svgNativeType =~ /SVGTransformListPropertyTearOff/) {
$svgListPropertyType = $svgWrappedNativeType;
AddToHeaderIncludes("core/svg/properties/SVGAnimatedListPropertyTearOff.h");
@@ -1710,25 +1702,7 @@ END
AddToImplIncludes("core/svg/properties/SVGPropertyTearOff.h");
my $tearOffType = GetSVGTypeNeedingTearOff($attrType);
my $wrappedValue;
- if (IsSVGTypeWithWritablePropertiesNeedingTearOff($attrType) and not defined $attribute->extendedAttributes->{"Immutable"}) {
- my $getter = $expression;
- $getter =~ s/imp->//;
- $getter =~ s/\(\)//;
-
- my $updateMethod = "&${implClassName}::update" . FirstLetterToUpperCase($getter);
-
- my $selfIsTearOffType = IsSVGTypeNeedingTearOff($interfaceName);
- if ($selfIsTearOffType) {
- AddToImplIncludes("core/svg/properties/SVGMatrixTearOff.h");
- # FIXME: Don't create a new one everytime we access the matrix property. This means, e.g, === won't work.
- $wrappedValue = "WTF::getPtr(SVGMatrixTearOff::create(wrapper, $expression))";
- } else {
- AddToImplIncludes("core/svg/properties/SVGStaticPropertyTearOff.h");
- $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$implClassName, /;
-
- $wrappedValue = "WTF::getPtr(${tearOffType}::create(imp, $expression, $updateMethod))";
- }
- } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
+ if ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
$wrappedValue = "WTF::getPtr(${tearOffType}::create(imp, $expression))";
} elsif ($tearOffType =~ /SVG(Point|PathSeg)List/) {
$wrappedValue = "WTF::getPtr($expression)";
@@ -5335,8 +5309,6 @@ END
}
END
}
- } elsif ($parameter->type eq "SVGMatrix" and $interfaceName eq "SVGTransformList") {
- push @arguments, "$paramName.get()";
} elsif (IsNullableParameter($parameter)) {
push @arguments, "${paramName}IsNull ? 0 : &$paramName";
} elsif (IsCallbackInterface($paramType) or $paramType eq "NodeFilter" or $paramType eq "XPathNSResolver") {
@@ -6035,14 +6007,6 @@ sub IsSVGTypeNeedingTearOff
return 0;
}
-sub IsSVGTypeWithWritablePropertiesNeedingTearOff
-{
- my $type = shift;
-
- return 1 if $svgTypeWithWritablePropertiesNeedingTearOff{$type};
- return 0;
-}
-
sub IsTypedArrayType
{
my $type = shift;
@@ -6105,8 +6069,6 @@ sub GetSVGWrappedTypeNeedingTearOff
$svgTypeNeedingTearOff =~ s/SVGStaticListPropertyTearOff<//;
} elsif ($svgTypeNeedingTearOff =~ /SVGTransformListPropertyTearOff/) {
$svgTypeNeedingTearOff =~ s/SVGTransformListPropertyTearOff<//;
- } elsif ($svgTypeNeedingTearOff =~ /SVGMatrixTearOff/) {
- $svgTypeNeedingTearOff = 'SVGMatrix';
}
$svgTypeNeedingTearOff =~ s/>//;
« no previous file with comments | « LayoutTests/svg/hixie/transform/001-expected.txt ('k') | Source/bindings/tests/idls/TestInterface.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698