WebKit Bugzilla
Attachment 356729 Details for
Bug 191237
: Remove SVG properties tear-off objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
11-JSBinding
11-JSBinding.patch (text/plain), 5.37 KB, created by
Said Abou-Hallawa
on 2018-12-06 08:02:18 PST
(
hide
)
Description:
11-JSBinding
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-12-06 08:02:18 PST
Size:
5.37 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3109e82884b..a0f8a5e4f07 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-12-05 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ Remove SVG properties tear-off objects >+ https://bugs.webkit.org/show_bug.cgi?id=191237 >+ >+ This changes the JS binding of the SVGAnimatedProperties to call a method >+ in the SVGElement whose name is exactly the same as the attribute name. >+ For example the JS binding will call the method SVGRectElement::x(), which >+ will return an Ref<SVGAnimatedLength>, to get access to the 'x' property. >+ >+ Also we need to include 'SVGAnimatedPropertyImpl.h' to bind all the >+ SVGAnimatedProperty types. And we need to include 'SVGPathSegImpl.h' >+ to bind all the SVGPathSeg types. >+ >+ * bindings/js/JSSVGPathSegCustom.cpp: >+ * bindings/scripts/CodeGenerator.pm: >+ (IsSVGPathSegTypeName): >+ (IsSVGPathSegType): >+ (AttributeNameForGetterAndSetter): >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GenerateHeader): >+ > 2018-12-05 Said Abou-Hallawa <sabouhallawa@apple.com> > > Remove SVG properties tear-off objects >diff --git a/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp b/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp >index 86adb9d339f..08173ee0195 100644 >--- a/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp >+++ b/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp >@@ -41,20 +41,6 @@ > #include "JSSVGPathSegMovetoAbs.h" > #include "JSSVGPathSegMovetoRel.h" > #include "SVGPathSeg.h" >-#include "SVGPathSegArc.h" >-#include "SVGPathSegClosePath.h" >-#include "SVGPathSegCurvetoCubic.h" >-#include "SVGPathSegCurvetoCubicSmooth.h" >-#include "SVGPathSegCurvetoQuadratic.h" >-#include "SVGPathSegCurvetoQuadraticSmoothAbs.h" >-#include "SVGPathSegCurvetoQuadraticSmoothRel.h" >-#include "SVGPathSegLinetoAbs.h" >-#include "SVGPathSegLinetoHorizontal.h" >-#include "SVGPathSegLinetoRel.h" >-#include "SVGPathSegLinetoVertical.h" >-#include "SVGPathSegMovetoAbs.h" >-#include "SVGPathSegMovetoRel.h" >- > > namespace WebCore { > using namespace JSC; >diff --git a/Source/WebCore/bindings/scripts/CodeGenerator.pm b/Source/WebCore/bindings/scripts/CodeGenerator.pm >index 75c19ecdba8..6268cf77682 100644 >--- a/Source/WebCore/bindings/scripts/CodeGenerator.pm >+++ b/Source/WebCore/bindings/scripts/CodeGenerator.pm >@@ -619,6 +619,22 @@ sub IsSVGAnimatedType > return $object->IsSVGAnimatedTypeName($type->name); > } > >+sub IsSVGPathSegTypeName >+{ >+ my ($object, $typeName) = @_; >+ >+ return $typeName =~ /^SVGPathSeg/; >+} >+ >+sub IsSVGPathSegType >+{ >+ my ($object, $type) = @_; >+ >+ assert("Not a type") if ref($type) ne "IDLType"; >+ >+ return $object->IsSVGPathSegTypeName($type->name); >+} >+ > sub IsConstructorType > { > my ($object, $type) = @_; >@@ -783,11 +799,6 @@ sub AttributeNameForGetterAndSetter > if ($attribute->extendedAttributes->{"ImplementedAs"}) { > $attributeName = $attribute->extendedAttributes->{"ImplementedAs"}; > } >- my $attributeType = $attribute->type; >- >- # SVG animated types need to use a special attribute name. >- # The rest of the special casing for SVG animated types is handled in the language-specific code generators. >- $attributeName .= "Animated" if $generator->IsSVGAnimatedType($attributeType); > > return $attributeName; > } >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 65e4536fa6e..a68964dda84 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -2499,8 +2499,6 @@ sub GenerateHeader > } > } > >- $headerIncludes{"$interfaceName.h"} = 1 if $hasParent && $interface->extendedAttributes->{JSGenerateToNativeObject}; >- > $headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/; > > my $implType = GetImplClassName($interface); >@@ -2512,8 +2510,11 @@ sub GenerateHeader > push(@headerContent, "\nnamespace WebCore {\n\n"); > > if ($codeGenerator->IsSVGAnimatedType($interface->type)) { >- $headerIncludes{"$interfaceName.h"} = 1; >+ $headerIncludes{"SVGAnimatedPropertyImpl.h"} = 1; >+ } elsif ($codeGenerator->IsSVGPathSegType($interface->type)) { >+ $headerIncludes{"SVGPathSegImpl.h"} = 1; > } else { >+ $headerIncludes{"$interfaceName.h"} = 1 if $hasParent && $interface->extendedAttributes->{JSGenerateToNativeObject}; > # Implementation class forward declaration > if (IsDOMGlobalObject($interface)) { > AddClassForwardIfNeeded($interface->type); >@@ -2563,7 +2564,9 @@ sub GenerateHeader > push(@headerContent, " return ptr;\n"); > push(@headerContent, " }\n\n"); > } else { >- AddIncludesForImplementationTypeInHeader($implType); >+ if (!$codeGenerator->IsSVGAnimatedType($interface->type) && !$codeGenerator->IsSVGPathSegType($interface->type)) { >+ AddIncludesForImplementationTypeInHeader($implType); >+ } > push(@headerContent, " static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<$implType>&& impl)\n"); > push(@headerContent, " {\n"); > push(@headerContent, " $className* ptr = new (NotNull, JSC::allocateCell<$className>(globalObject->vm().heap)) $className(structure, *globalObject, WTFMove(impl));\n");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191237
:
353808
|
353812
|
353815
|
353817
|
353818
|
353820
|
353824
|
353825
|
355382
|
355386
|
355388
|
355393
|
355568
|
355574
|
355575
|
355577
|
355580
|
355582
|
355585
|
355666
|
355672
|
355693
|
355699
|
355711
|
355752
|
355777
|
355820
|
356333
|
356334
|
356338
|
356340
|
356342
|
356344
|
356346
|
356351
|
356352
|
356358
|
356360
|
356380
|
356497
|
356500
|
356507
|
356579
|
356607
|
356728
|
356729
|
356730
|
356731
|
356732
|
356733
|
356752
|
356810
|
356811
|
356879
|
356880
|
356881
|
356882
|
356883
|
356884
|
356885
|
356887
|
356888
|
356889
|
356892
|
356895
|
356896
|
359721
|
359735
|
359747
|
363581
|
363595
|
363613
|
363690
|
364172
|
364180
|
366512
|
366557
|
366636