Changeset 53666 in webkit


Ignore:
Timestamp:
Jan 21, 2010 6:23:34 PM (14 years ago)
Author:
Nikolas Zimmermann
Message:

2010-01-21 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Sam Weinig.

SVG JS bindings "context" pointer needs to move onto binding impls
https://bugs.webkit.org/show_bug.cgi?id=27243

Rewrite SVG DOM JSC bindings to use a global DOMObject <-> SVGElement context map, similar to V8's approach.
This allows us to remove DOMObjectWithSVGContext and make all SVG JS objects use DOMObjectWithGlobalPointer.
We're fitting again in JS_CELL_SIZE, and there's no need to special case SVG anymore.

Not adding a new test, as we have yet to identify how to test that we're passing around correct global objects.
For now this is just a code cleanup which lets me continue making progress in that area of the code.

  • GNUmakefile.am: Add new DOMObjectWithSVGContext.h to build.
  • WebCore.gypi: Ditto.
  • WebCore.vcproj/WebCore.vcproj: Ditto.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • bindings/js/DOMObjectWithSVGContext.h: Removed.
  • bindings/js/JSDOMBinding.cpp: (WebCore::setDOMException): Add comment, that passing 0 context is intentional.
  • bindings/js/JSDOMBinding.h: (WebCore::createDOMObjectWrapper): Add to JSSVGContextCache, when creating wrappers. (WebCore::getDOMObjectWrapper): Add assertion guarding the JSSVGContextCache is in-sync with the passed context.
  • bindings/js/JSSVGContextCache.h: Added. Maps DOMObjects to SVGElements - just like V8 approachs to this problem. (WebCore::JSSVGContextCache::wrapperMap): (WebCore::JSSVGContextCache::addWrapper): (WebCore::JSSVGContextCache::forgetWrapper): (WebCore::JSSVGContextCache::propagateSVGDOMChange): (WebCore::JSSVGContextCache::svgContextForDOMObject):
  • bindings/js/JSSVGLengthCustom.cpp: Retrieve context from cache, instead of taking it from the JS* class. (WebCore::JSSVGLength::value): (WebCore::JSSVGLength::convertToSpecifiedUnits):
  • bindings/js/JSSVGMatrixCustom.cpp Ditto.: (WebCore::JSSVGMatrix::multiply): (WebCore::JSSVGMatrix::inverse): (WebCore::JSSVGMatrix::rotateFromVector):
  • bindings/js/JSSVGPODListCustom.h: Ditto. (WebCore::JSSVGPODListCustom::finishGetter): (WebCore::JSSVGPODListCustom::finishSetter): (WebCore::JSSVGPODListCustom::finishSetterReadOnlyResult): (WebCore::JSSVGPODListCustom::clear): (WebCore::JSSVGPODListCustom::initialize):
  • bindings/js/JSSVGPODTypeWrapper.h: Ditto. (WebCore::JSSVGDynamicPODTypeWrapper::commitChange): (WebCore::JSSVGStaticPODTypeWrapper::commitChange): (WebCore::JSSVGStaticPODTypeWrapperWithPODTypeParent::commitChange): (WebCore::JSSVGStaticPODTypeWrapperWithParent::commitChange): (WebCore::JSSVGPODTypeWrapperCreatorForList::create): (WebCore::JSSVGPODTypeWrapperCreatorForList::commitChange):
  • bindings/js/JSSVGPathSegCustom.cpp: Ditto. (WebCore::toJS):
  • bindings/js/JSSVGPathSegListCustom.cpp: Ditto. (WebCore::JSSVGPathSegList::clear): (WebCore::JSSVGPathSegList::initialize): (WebCore::JSSVGPathSegList::getItem): (WebCore::JSSVGPathSegList::insertItemBefore): (WebCore::JSSVGPathSegList::replaceItem): (WebCore::JSSVGPathSegList::removeItem): (WebCore::JSSVGPathSegList::appendItem):
  • bindings/scripts/CodeGeneratorJS.pm:
  • svg/SVGAngle.h: Remove unneeded associatedAttributeName() method.
  • svg/SVGPreserveAspectRatio.h: Ditto.
  • svg/SVGTransform.h: Ditto.
Location:
trunk/WebCore
Files:
1 added
1 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53665 r53666  
     12010-01-21  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        SVG JS bindings "context" pointer needs to move onto binding impls
     6        https://bugs.webkit.org/show_bug.cgi?id=27243
     7
     8        Rewrite SVG DOM JSC bindings to use a global DOMObject <-> SVGElement context map, similar to V8's approach.
     9        This allows us to remove DOMObjectWithSVGContext and make all SVG JS objects use DOMObjectWithGlobalPointer.
     10        We're fitting again in JS_CELL_SIZE, and there's no need to special case SVG anymore.
     11
     12        Not adding a new test, as we have yet to identify how to test that we're passing around correct global objects.
     13        For now this is just a code cleanup which lets me continue making progress in that area of the code.
     14
     15        * GNUmakefile.am: Add new DOMObjectWithSVGContext.h to build.
     16        * WebCore.gypi: Ditto.
     17        * WebCore.vcproj/WebCore.vcproj: Ditto.
     18        * WebCore.xcodeproj/project.pbxproj: Ditto.
     19        * bindings/js/DOMObjectWithSVGContext.h: Removed.
     20        * bindings/js/JSDOMBinding.cpp:
     21        (WebCore::setDOMException): Add comment, that passing 0 context is intentional.
     22        * bindings/js/JSDOMBinding.h:
     23        (WebCore::createDOMObjectWrapper): Add to JSSVGContextCache, when creating wrappers.
     24        (WebCore::getDOMObjectWrapper): Add assertion guarding the JSSVGContextCache is in-sync with the passed context.
     25        * bindings/js/JSSVGContextCache.h: Added. Maps DOMObjects to SVGElements - just like V8 approachs to this problem.
     26        (WebCore::JSSVGContextCache::wrapperMap):
     27        (WebCore::JSSVGContextCache::addWrapper):
     28        (WebCore::JSSVGContextCache::forgetWrapper):
     29        (WebCore::JSSVGContextCache::propagateSVGDOMChange):
     30        (WebCore::JSSVGContextCache::svgContextForDOMObject):
     31        * bindings/js/JSSVGLengthCustom.cpp: Retrieve context from cache, instead of taking it from the JS* class.
     32        (WebCore::JSSVGLength::value):
     33        (WebCore::JSSVGLength::convertToSpecifiedUnits):
     34        * bindings/js/JSSVGMatrixCustom.cpp Ditto.:
     35        (WebCore::JSSVGMatrix::multiply):
     36        (WebCore::JSSVGMatrix::inverse):
     37        (WebCore::JSSVGMatrix::rotateFromVector):
     38        * bindings/js/JSSVGPODListCustom.h: Ditto.
     39        (WebCore::JSSVGPODListCustom::finishGetter):
     40        (WebCore::JSSVGPODListCustom::finishSetter):
     41        (WebCore::JSSVGPODListCustom::finishSetterReadOnlyResult):
     42        (WebCore::JSSVGPODListCustom::clear):
     43        (WebCore::JSSVGPODListCustom::initialize):
     44        * bindings/js/JSSVGPODTypeWrapper.h: Ditto.
     45        (WebCore::JSSVGDynamicPODTypeWrapper::commitChange):
     46        (WebCore::JSSVGStaticPODTypeWrapper::commitChange):
     47        (WebCore::JSSVGStaticPODTypeWrapperWithPODTypeParent::commitChange):
     48        (WebCore::JSSVGStaticPODTypeWrapperWithParent::commitChange):
     49        (WebCore::JSSVGPODTypeWrapperCreatorForList::create):
     50        (WebCore::JSSVGPODTypeWrapperCreatorForList::commitChange):
     51        * bindings/js/JSSVGPathSegCustom.cpp: Ditto.
     52        (WebCore::toJS):
     53        * bindings/js/JSSVGPathSegListCustom.cpp: Ditto.
     54        (WebCore::JSSVGPathSegList::clear):
     55        (WebCore::JSSVGPathSegList::initialize):
     56        (WebCore::JSSVGPathSegList::getItem):
     57        (WebCore::JSSVGPathSegList::insertItemBefore):
     58        (WebCore::JSSVGPathSegList::replaceItem):
     59        (WebCore::JSSVGPathSegList::removeItem):
     60        (WebCore::JSSVGPathSegList::appendItem):
     61        * bindings/scripts/CodeGeneratorJS.pm:
     62        * svg/SVGAngle.h: Remove unneeded associatedAttributeName() method.
     63        * svg/SVGPreserveAspectRatio.h: Ditto.
     64        * svg/SVGTransform.h: Ditto.
     65
    1662010-01-21  Kevin Ollivier  <kevino@theolliviers.com>
    267
  • trunk/WebCore/GNUmakefile.am

    r53644 r53666  
    29322932
    29332933webcore_sources += \
     2934        WebCore/bindings/js/JSSVGContextCache.h \
    29342935        WebCore/bindings/js/JSSVGElementInstanceCustom.cpp \
    29352936        WebCore/bindings/js/JSSVGLengthCustom.cpp \
  • trunk/WebCore/WebCore.gypi

    r53649 r53666  
    586586            'bindings/js/JSStyleSheetCustom.cpp',
    587587            'bindings/js/JSStyleSheetListCustom.cpp',
     588            'bindings/js/JSSVGContextCache.h',
    588589            'bindings/js/JSSVGElementInstanceCustom.cpp',
    589590            'bindings/js/JSSVGLengthCustom.cpp',
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r53644 r53666  
    3896138961                                </File>
    3896238962                                <File
     38963                                        RelativePath="..\bindings\js\JSSVGContextCache.h"
     38964                                        >
     38965                                </File>
     38966                                <File
    3896338967                                        RelativePath="..\bindings\js\JSSVGElementInstanceCustom.cpp"
    3896438968                                        >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r53644 r53666  
    6363                082341C50FCF3A9500D75BD6 /* WMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 082341C30FCF3A9400D75BD6 /* WMLSelectElement.cpp */; };
    6464                082341C60FCF3A9500D75BD6 /* WMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */; };
     65                082FCAC4110927CE00CC4821 /* JSSVGContextCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 082FCAC3110927CE00CC4821 /* JSSVGContextCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
    6566                08385FF610F0186000BFE07B /* SVGMarkerData.h in Headers */ = {isa = PBXBuildFile; fileRef = 08385FF510F0186000BFE07B /* SVGMarkerData.h */; };
    6667                0839476C0ECE4BD600027350 /* WMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08FB84B00ECE373300DC064E /* WMLElementFactory.cpp */; };
     
    53275328                082341C30FCF3A9400D75BD6 /* WMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLSelectElement.cpp; sourceTree = "<group>"; };
    53285329                082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLSelectElement.h; sourceTree = "<group>"; };
     5330                082FCAC3110927CE00CC4821 /* JSSVGContextCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGContextCache.h; sourceTree = "<group>"; };
    53295331                08385FF510F0186000BFE07B /* SVGMarkerData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMarkerData.h; sourceTree = "<group>"; };
    53305332                083DAEA20F01A7FB00342754 /* RenderTextControlMultiLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextControlMultiLine.cpp; sourceTree = "<group>"; };
     
    1476314765                                BC98A27C0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp */,
    1476414766                                A84EBD770CB8C89200079609 /* JSStyleSheetListCustom.cpp */,
     14767                                082FCAC3110927CE00CC4821 /* JSSVGContextCache.h */,
    1476514768                                08A48A6D0E86CF6D00E225DD /* JSSVGElementInstanceCustom.cpp */,
    1476614769                                08E4FE450E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp */,
     
    1844818451                                59B5977511086579007159E8 /* BridgeJSC.h in Headers */,
    1844918452                                93C4F6EB1108F9A50099D0DB /* AccessibilityScrollbar.h in Headers */,
     18453                                082FCAC4110927CE00CC4821 /* JSSVGContextCache.h in Headers */,
    1845018454                        );
    1845118455                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/bindings/js/JSDOMBinding.cpp

    r53514 r53666  
    731731#if ENABLE(SVG)
    732732        case SVGExceptionType:
    733             errorObject = toJS(exec, globalObject, SVGException::create(description).get(), 0);
     733            errorObject = toJS(exec, globalObject, SVGException::create(description).get(), 0 /* no context on purpose */);
    734734            break;
    735735#endif
  • trunk/WebCore/bindings/js/JSDOMBinding.h

    r53514 r53666  
    2424
    2525#include "JSDOMGlobalObject.h"
     26#include "JSSVGContextCache.h"
    2627#include "Document.h"
    2728#include <runtime/Completion.h>
     
    302303    template<class WrapperClass, class DOMClass> inline DOMObject* createDOMObjectWrapper(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMClass* object, SVGElement* context)
    303304    {
    304         ASSERT(object);
    305         ASSERT(!getCachedDOMObjectWrapper(exec, object));
    306         WrapperClass* wrapper = new (exec) WrapperClass(getDOMStructure<WrapperClass>(exec, globalObject), globalObject, object, context);
    307         cacheDOMObjectWrapper(exec, object, wrapper);
     305        DOMObject* wrapper = createDOMObjectWrapper<WrapperClass, DOMClass>(exec, globalObject, object);
     306        ASSERT(wrapper);
     307        if (context)
     308            JSSVGContextCache::addWrapper(wrapper, context);
    308309        return wrapper;
    309310    }
     
    312313        if (!object)
    313314            return JSC::jsNull();
    314         if (DOMObject* wrapper = getCachedDOMObjectWrapper(exec, object))
     315        if (DOMObject* wrapper = getCachedDOMObjectWrapper(exec, object)) {
     316            ASSERT(JSSVGContextCache::svgContextForDOMObject(wrapper) == context);
    315317            return wrapper;
    316         return createDOMObjectWrapper<WrapperClass>(exec, globalObject, object, context);
     318        }
     319        return createDOMObjectWrapper<WrapperClass, DOMClass>(exec, globalObject, object, context);
    317320    }
    318321#endif
  • trunk/WebCore/bindings/js/JSSVGLengthCustom.cpp

    r43122 r53666  
    2929JSValue JSSVGLength::value(ExecState* exec) const
    3030{
    31     SVGLength imp(*impl());
    32     return jsNumber(exec, imp.value(context()));
     31    JSSVGPODTypeWrapper<SVGLength>* imp = impl();
     32    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(const_cast<JSSVGLength*>(this));
     33
     34    SVGLength podImp(*imp);
     35    return jsNumber(exec, podImp.value(context));
    3336}
    3437
    3538JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec, const ArgList& args)
    3639{
    37     JSSVGPODTypeWrapper<SVGLength>* wrapper = impl();
     40    JSSVGPODTypeWrapper<SVGLength>* imp = impl();
     41    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
    3842
    39     SVGLength imp(*wrapper);
    40     imp.convertToSpecifiedUnits(args.at(0).toInt32(exec), context());
     43    SVGLength podImp(*imp);
     44    podImp.convertToSpecifiedUnits(args.at(0).toInt32(exec), context);
    4145
    42     wrapper->commitChange(imp, context());
     46    imp->commitChange(podImp, this);
    4347    return jsUndefined();
    4448}
  • trunk/WebCore/bindings/js/JSSVGMatrixCustom.cpp

    r50561 r53666  
    4545    TransformationMatrix m2(*(matrixObj->impl()));
    4646
    47     JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(m1.multLeft(m2)).get(), m_context.get());
    48 
    49     return result;
     47    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
     48    return toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(m1.multLeft(m2)).get(), context);
    5049}
    5150
     
    5352{
    5453    TransformationMatrix imp(*impl());
    55     JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.inverse()).get(), m_context.get());
     54
     55    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
     56    JSValue result = toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.inverse()).get(), context);
    5657
    5758    if (!imp.isInvertible())
     
    6869    float y = args.at(1).toFloat(exec);
    6970
    70     JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.rotateFromVector(x, y)).get(), m_context.get());
     71    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
     72    JSValue result = toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.rotateFromVector(x, y)).get(), context);
    7173
    7274    if (x == 0.0 || y == 0.0)
  • trunk/WebCore/bindings/js/JSSVGPODListCustom.h

    r53086 r53666  
    2323#define JSSVGPODListCustom_h
    2424
     25#include "JSSVGContextCache.h"
    2526#include "JSSVGPODTypeWrapper.h"
    2627#include "SVGList.h"
     
    3839};
    3940
    40 template<typename PODType>
    41 static JSC::JSValue finishGetter(JSC::ExecState* exec, ExceptionCode& ec, SVGElement* context,
    42                                  typename JSSVGPODListTraits<PODType>::PODList* list,
     41template<typename JSPODListType, typename PODType>
     42static JSC::JSValue finishGetter(JSC::ExecState* exec, ExceptionCode& ec, JSPODListType* wrapper,
     43                                 PassRefPtr<typename JSSVGPODListTraits<PODType>::PODListItem> item)
     44{
     45    if (ec) {
     46        setDOMException(exec, ec);
     47        return JSC::jsUndefined();
     48    }
     49   
     50    typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl();
     51
     52    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(wrapper);
     53    return toJS(exec, wrapper->globalObject(),
     54                JSSVGPODTypeWrapperCreatorForList<PODType>::create(item.get(), listImp->associatedAttributeName()).get(), context);
     55}
     56
     57template<typename JSPODListType, typename PODType>
     58static JSC::JSValue finishSetter(JSC::ExecState* exec, ExceptionCode& ec, JSPODListType* wrapper,                               
    4359                                 PassRefPtr<typename JSSVGPODListTraits<PODType>::PODListItem> item)
    4460{
     
    4864    }
    4965
    50     return toJS(exec, deprecatedGlobalObjectForPrototype(exec),
    51                 JSSVGPODTypeWrapperCreatorForList<PODType>::create(item.get(), list->associatedAttributeName()).get(), context);
     66    typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl();
     67
     68    const QualifiedName& attributeName = listImp->associatedAttributeName();
     69    JSSVGContextCache::propagateSVGDOMChange(wrapper, attributeName);
     70
     71    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(wrapper);
     72    return toJS(exec, wrapper->globalObject(),
     73                JSSVGPODTypeWrapperCreatorForList<PODType>::create(item.get(), attributeName).get(), context);
    5274}
    5375
    54 template<typename PODType>
    55 static JSC::JSValue finishSetter(JSC::ExecState* exec, ExceptionCode& ec, SVGElement* context,
    56                                  typename JSSVGPODListTraits<PODType>::PODList* list,
    57                                  PassRefPtr<typename JSSVGPODListTraits<PODType>::PODListItem> item)
     76template<typename JSPODListType, typename PODType>
     77static JSC::JSValue finishSetterReadOnlyResult(JSC::ExecState* exec, ExceptionCode& ec, JSPODListType* wrapper,                               
     78                                               PassRefPtr<typename JSSVGPODListTraits<PODType>::PODListItem> item)
    5879{
    5980    if (ec) {
     
    6283    }
    6384
    64     const QualifiedName& attributeName = list->associatedAttributeName();
    65     context->svgAttributeChanged(attributeName);
    66 
    67     return toJS(exec, deprecatedGlobalObjectForPrototype(exec),
    68                 JSSVGPODTypeWrapperCreatorForList<PODType>::create(item.get(), attributeName).get(), context);
    69 }
    70 
    71 template<typename PODType>
    72 static JSC::JSValue finishSetterReadOnlyResult(JSC::ExecState* exec, ExceptionCode& ec, SVGElement* context,
    73                                                typename JSSVGPODListTraits<PODType>::PODList* list,
    74                                                PassRefPtr<typename JSSVGPODListTraits<PODType>::PODListItem> item)
    75 {
    76     if (ec) {
    77         setDOMException(exec, ec);
    78         return JSC::jsUndefined();
    79     }
    80     context->svgAttributeChanged(list->associatedAttributeName());
    81     return toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<PODType>::create(*item).get(), context);
     85    typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl();
     86    JSSVGContextCache::propagateSVGDOMChange(wrapper, listImp->associatedAttributeName());
     87    return toJS(exec, wrapper->globalObject(),
     88                JSSVGStaticPODTypeWrapper<PODType>::create(*item).get(), 0  /* no context on purpose */);
    8289}
    8390
     
    93100        setDOMException(exec, ec);
    94101    else
    95         wrapper->context()->svgAttributeChanged(listImp->associatedAttributeName());
     102        JSSVGContextCache::propagateSVGDOMChange(wrapper, listImp->associatedAttributeName());
    96103
    97104    return JSC::jsUndefined();
     
    104111    ExceptionCode ec = 0;
    105112    typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl();
    106     return finishSetter<PODType>(exec, ec, wrapper->context(), listImp,
    107                                  listImp->initialize(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), ec));
    108 
     113    return finishSetter<JSPODListType, PODType>(exec, ec, wrapper,
     114                                                listImp->initialize(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), ec));
    109115}
    110116
     
    122128    ExceptionCode ec = 0;
    123129    typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl();
    124     return finishGetter<PODType>(exec, ec, wrapper->context(), listImp,
    125                                  listImp->getItem(index, ec));
     130    return finishGetter<JSPODListType, PODType>(exec, ec, wrapper,
     131                                                listImp->getItem(index, ec));
    126132}
    127133
     
    139145    ExceptionCode ec = 0;
    140146    typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl();
    141     return finishSetter<PODType>(exec, ec, wrapper->context(), listImp,
    142                                  listImp->insertItemBefore(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), index, ec));
     147    return finishSetter<JSPODListType, PODType>(exec, ec, wrapper,
     148                                                listImp->insertItemBefore(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), index, ec));
    143149}
    144150
     
    156162    ExceptionCode ec = 0;
    157163    typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl();
    158     return finishSetter<PODType>(exec, ec, wrapper->context(), listImp,
    159                                  listImp->replaceItem(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), index, ec));
     164    return finishSetter<JSPODListType, PODType>(exec, ec, wrapper,
     165                                                listImp->replaceItem(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), index, ec));
    160166}
    161167
     
    173179    ExceptionCode ec = 0;
    174180    typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl();
    175     return finishSetterReadOnlyResult<PODType>(exec, ec, wrapper->context(), listImp,
    176                                                listImp->removeItem(index, ec));
     181    return finishSetterReadOnlyResult<JSPODListType, PODType>(exec, ec, wrapper,
     182                                                              listImp->removeItem(index, ec));
    177183}
    178184
     
    183189    ExceptionCode ec = 0;
    184190    typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl();
    185     return finishSetter<PODType>(exec, ec, wrapper->context(), listImp,
    186                                  listImp->appendItem(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), ec));
     191    return finishSetter<JSPODListType, PODType>(exec, ec, wrapper,
     192                                                listImp->appendItem(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), ec));
    187193}
    188194
  • trunk/WebCore/bindings/js/JSSVGPODTypeWrapper.h

    r52082 r53666  
    2929
    3030#if ENABLE(SVG)
     31#include "JSSVGContextCache.h"
    3132#include "SVGElement.h"
    3233#include <wtf/StdLibExtras.h>
     
    3435namespace WebCore {
    3536
     37class DOMObject;
     38
    3639template<typename PODType>
    3740class JSSVGPODTypeWrapper : public RefCounted<JSSVGPODTypeWrapper<PODType> > {
     
    4043
    4144    virtual operator PODType() = 0;
    42     virtual void commitChange(PODType, SVGElement*) = 0;
     45    virtual void commitChange(PODType, DOMObject*) = 0;
    4346};
    4447
     
    8790    }
    8891
    89     virtual void commitChange(PODType type, SVGElement* context)
     92    virtual void commitChange(PODType type, DOMObject* wrapper)
    9093    {
    9194        (m_creator.get()->*m_setter)(type);
    92 
    93         if (context)
    94             context->svgAttributeChanged(m_creator->associatedAttributeName());
     95        JSSVGContextCache::propagateSVGDOMChange(wrapper, m_creator->associatedAttributeName());
    9596    }
    9697
     
    131132    }
    132133
    133     virtual void commitChange(PODType type, SVGElement*)
     134    virtual void commitChange(PODType type, DOMObject*)
    134135    {
    135136        m_podType = type;
     
    155156    }
    156157
    157     virtual void commitChange(PODType type, SVGElement* context)
    158     {
    159         JSSVGStaticPODTypeWrapper<PODType>::commitChange(type, context);
    160         m_parentType->commitChange(ParentTypeArg(type), context);   
     158    virtual void commitChange(PODType type, DOMObject* wrapper)
     159    {
     160        JSSVGStaticPODTypeWrapper<PODType>::commitChange(type, wrapper);
     161        m_parentType->commitChange(ParentTypeArg(type), wrapper);
    161162    }
    162163
     
    193194    }
    194195
    195     virtual void commitChange(PODType type, SVGElement*)
     196    virtual void commitChange(PODType type, DOMObject*)
    196197    {
    197198        (m_parent.get()->*m_setter)(type);
     
    238239    }
    239240
    240     virtual void commitChange(PODType type, SVGElement* context)
     241    virtual void commitChange(PODType type, DOMObject* wrapper)
    241242    {
    242243        if (!m_setter)
     
    244245
    245246        (m_creator.get()->*m_setter)(type);
    246 
    247         if (context)
    248             context->svgAttributeChanged(m_associatedAttributeName);
     247        JSSVGContextCache::propagateSVGDOMChange(wrapper, m_associatedAttributeName);
    249248    }
    250249
  • trunk/WebCore/bindings/js/JSSVGPathSegCustom.cpp

    r51363 r53666  
    2222#if ENABLE(SVG)
    2323#include "JSSVGPathSeg.h"
     24
     25#include "JSDOMBinding.h"
    2426#include "JSSVGPathSegArcAbs.h"
    2527#include "JSSVGPathSegArcRel.h"
     
    4143#include "JSSVGPathSegMovetoAbs.h"
    4244#include "JSSVGPathSegMovetoRel.h"
    43 
    44 #include "JSDOMBinding.h"
    45 
    4645#include "SVGPathSeg.h"
    4746#include "SVGPathSegArc.h"
     
    6564        return jsNull();
    6665
    67     if (DOMObject* wrapper = getCachedDOMObjectWrapper(exec, object))
     66    if (DOMObject* wrapper = getCachedDOMObjectWrapper(exec, object)) {
     67        ASSERT(JSSVGContextCache::svgContextForDOMObject(wrapper) == context);
    6868        return wrapper;
     69    }
    6970
    7071    switch (object->pathSegType()) {
     
    116117
    117118#endif // ENABLE(SVG)
    118 
    119 // vim:ts=4:noet
  • trunk/WebCore/bindings/js/JSSVGPathSegListCustom.cpp

    r46346 r53666  
    2525#include "Document.h"
    2626#include "Frame.h"
     27#include "JSSVGContextCache.h"
    2728#include "JSSVGPathSeg.h"
    2829#include "SVGDocumentExtensions.h"
     
    4041    ExceptionCode ec = 0;
    4142
    42     SVGPathSegList* imp = static_cast<SVGPathSegList*>(impl());
    43     imp->clear(ec);
     43    SVGPathSegList* list = impl();
     44    list->clear(ec);
    4445
    4546    setDOMException(exec, ec);
    4647
    47     m_context->svgAttributeChanged(imp->associatedAttributeName());
     48    JSSVGContextCache::propagateSVGDOMChange(this, list->associatedAttributeName());
    4849    return jsUndefined();
    4950}
     
    5455    SVGPathSeg* newItem = toSVGPathSeg(args.at(0));
    5556
    56     SVGPathSegList* imp = static_cast<SVGPathSegList*>(impl());
     57    SVGPathSegList* list = impl();
    5758
    58     SVGPathSeg* obj = WTF::getPtr(imp->initialize(newItem, ec));
     59    SVGPathSeg* obj = WTF::getPtr(list->initialize(newItem, ec));
     60    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
    5961
    60     JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), obj, m_context.get());
     62    JSValue result = toJS(exec, globalObject(), obj, context);
    6163    setDOMException(exec, ec);
    6264
    63     m_context->svgAttributeChanged(imp->associatedAttributeName());   
     65    JSSVGContextCache::propagateSVGDOMChange(this, list->associatedAttributeName());
    6466    return result;
    6567}
     
    7678    }
    7779
    78     SVGPathSegList* imp = static_cast<SVGPathSegList*>(impl());
    79     SVGPathSeg* obj = WTF::getPtr(imp->getItem(index, ec));
     80    SVGPathSegList* list = impl();
     81    SVGPathSeg* obj = WTF::getPtr(list->getItem(index, ec));
     82    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
    8083
    81     JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), obj, m_context.get());
     84    JSValue result = toJS(exec, globalObject(), obj, context);
    8285    setDOMException(exec, ec);
    8386    return result;
     
    9699    }
    97100
    98     SVGPathSegList* imp = static_cast<SVGPathSegList*>(impl());
     101    SVGPathSegList* list = impl();
     102    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
    99103
    100     JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), WTF::getPtr(imp->insertItemBefore(newItem, index, ec)), m_context.get());
     104    JSValue result = toJS(exec, globalObject(), WTF::getPtr(list->insertItemBefore(newItem, index, ec)), context);
    101105    setDOMException(exec, ec);
    102106
    103     m_context->svgAttributeChanged(imp->associatedAttributeName());   
     107    JSSVGContextCache::propagateSVGDOMChange(this, list->associatedAttributeName());
    104108    return result;
    105109}
     
    117121    }
    118122
    119     SVGPathSegList* imp = static_cast<SVGPathSegList*>(impl());
     123    SVGPathSegList* list = impl();
     124    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
    120125
    121     JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), WTF::getPtr(imp->replaceItem(newItem, index, ec)), m_context.get());
     126    JSValue result = toJS(exec, globalObject(), WTF::getPtr(list->replaceItem(newItem, index, ec)), context);
    122127    setDOMException(exec, ec);
    123128
    124     m_context->svgAttributeChanged(imp->associatedAttributeName());   
     129    JSSVGContextCache::propagateSVGDOMChange(this, list->associatedAttributeName());
    125130    return result;
    126131}
     
    137142    }
    138143
    139     SVGPathSegList* imp = static_cast<SVGPathSegList*>(impl());
     144    SVGPathSegList* list = impl();
    140145
    141     RefPtr<SVGPathSeg> obj(imp->removeItem(index, ec));
     146    RefPtr<SVGPathSeg> obj(list->removeItem(index, ec));
     147    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
    142148
    143     JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), obj.get(), m_context.get());
     149    JSValue result = toJS(exec, globalObject(), obj.get(), context);
    144150    setDOMException(exec, ec);
    145151
    146     m_context->svgAttributeChanged(imp->associatedAttributeName());   
     152    JSSVGContextCache::propagateSVGDOMChange(this, list->associatedAttributeName());
    147153    return result;
    148154}
     
    153159    SVGPathSeg* newItem = toSVGPathSeg(args.at(0));
    154160
    155     SVGPathSegList* imp = static_cast<SVGPathSegList*>(impl());
     161    SVGPathSegList* list = impl();
     162    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
    156163
    157     JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), WTF::getPtr(imp->appendItem(newItem, ec)), m_context.get());
     164    JSValue result = toJS(exec, globalObject(), WTF::getPtr(list->appendItem(newItem, ec)), context);
    158165    setDOMException(exec, ec);
    159166
    160     m_context->svgAttributeChanged(imp->associatedAttributeName());   
     167    JSSVGContextCache::propagateSVGDOMChange(this, list->associatedAttributeName());
    161168    return result;
    162169}
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r53574 r53666  
    133133
    134134    return $dataNode->extendedAttributes->{"LegacyParent"} if $dataNode->extendedAttributes->{"LegacyParent"};
    135     if (@{$dataNode->parents} eq 0) {
    136         # FIXME: SVG types requiring a context() pointer do not have enough
    137         # space to hold a globalObject pointer as well w/o hitting the CELL_SIZE limit.
    138         # This could be fixed by moving context() into the various impl() classes.
    139         # Until then, we special case these SVG bindings and allow them to return
    140         # the wrong prototypes and constructors during x-frame access.  See bug 27088.
    141         return "DOMObjectWithSVGContext" if IsSVGTypeNeedingContextParameter($dataNode->name);
    142         return "DOMObjectWithGlobalPointer";
    143     }
     135    return "DOMObjectWithGlobalPointer" if (@{$dataNode->parents} eq 0);
    144136    return "JS" . $codeGenerator->StripModule($dataNode->parents(0));
    145137}
     
    168160    return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "CSSVariablesDeclaration";
    169161    return 0;
    170 }
    171 
    172 sub CreateSVGContextInterfaceName
    173 {
    174     my $type = shift;
    175 
    176     return $type if $codeGenerator->IsSVGAnimatedType($type);
    177     return "SVGPathSeg" if $type =~ /^SVGPathSeg/ and $type ne "SVGPathSegList";
    178 
    179     return "";
    180162}
    181163
     
    494476    my $parentClassName = GetParentClassName($dataNode);
    495477    my $conditional = $dataNode->extendedAttributes->{"Conditional"};
    496     my $needsSVGContext = IsSVGTypeNeedingContextParameter($interfaceName);
    497478    my $eventTarget = $dataNode->extendedAttributes->{"EventTarget"};
    498479    my $needsMarkChildren = $dataNode->extendedAttributes->{"CustomMarkFunction"} || $dataNode->extendedAttributes->{"EventTarget"};
     
    514495        $headerIncludes{"$parentClassName.h"} = 1;
    515496    } else {
    516         $headerIncludes{"DOMObjectWithSVGContext.h"} = $needsSVGContext;
    517         $headerIncludes{"JSDOMBinding.h"} = !$needsSVGContext;
     497        $headerIncludes{"JSDOMBinding.h"} = 1;
    518498        $headerIncludes{"<runtime/JSGlobalObject.h>"} = 1;
    519499        $headerIncludes{"<runtime/ObjectPrototype.h>"} = 1;
     
    562542    } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) {
    563543        push(@headerContent, "    $className(NonNullPassRefPtr<JSC::Structure>, PassRefPtr<$implType>);\n");
    564     } elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
    565         push(@headerContent, "    $className(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<$implType>, SVGElement* context);\n");
    566544    } else {
    567545        push(@headerContent, "    $className(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<$implType>);\n");
     
    784762    if (!$hasParent || $dataNode->extendedAttributes->{"GenerateToJS"} || $dataNode->extendedAttributes->{"CustomToJS"}) {
    785763        if ($podType) {
    786             push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, JSSVGPODTypeWrapper<$podType>*, SVGElement* context);\n");
     764            push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, JSSVGPODTypeWrapper<$podType>*, SVGElement*);\n");
    787765        } elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
    788766            push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*, SVGElement* context);\n");
     
    11741152    my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName;
    11751153
    1176     my $needsSVGContext = IsSVGTypeNeedingContextParameter($implClassName);
    1177     my $parentNeedsSVGContext = ($needsSVGContext and $parentClassName =~ /SVG/);
    1178 
    11791154    # Constructor
    11801155    if ($interfaceName eq "DOMWindow") {
     
    11871162        push(@implContent, "    : $parentClassName(structure, impl)\n");
    11881163    } else {
    1189         my $contextArg = $needsSVGContext ? ", SVGElement* context" : "";
    1190         push(@implContent, "${className}::$className(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl$contextArg)\n");
     1164        push(@implContent, "${className}::$className(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n");
    11911165        if ($hasParent) {
    1192             push(@implContent, "    : $parentClassName(structure, globalObject, impl" . ($parentNeedsSVGContext ? ", context" : "") . ")\n");
     1166            push(@implContent, "    : $parentClassName(structure, globalObject, impl)\n");
    11931167        } else {
    1194             push(@implContent, "    : $parentClassName(structure, globalObject" . ($needsSVGContext ? ", context" : "") . ")\n");
     1168            push(@implContent, "    : $parentClassName(structure, globalObject)\n");
    11951169            push(@implContent, "    , m_impl(impl)\n");
    11961170        }
     
    12151189                push(@implContent, "    forgetDOMObject(this, impl());\n");
    12161190            }
     1191
     1192            push(@implContent, "    JSSVGContextCache::forgetWrapper(this);\n") if IsSVGTypeNeedingContextParameter($implClassName);
    12171193        }
    12181194
     
    13961372                push(@implContent, "JSValue ${constructorFunctionName}(ExecState* exec, const Identifier&, const PropertySlot& slot)\n");
    13971373                push(@implContent, "{\n");
    1398                 if (IsSVGTypeNeedingContextParameter($interfaceName)) {
    1399                     # FIXME: SVG bindings with a context pointer have no space to store a globalObject
    1400                     # so we use deprecatedGlobalObjectForPrototype instead.
    1401                     push(@implContent, "    UNUSED_PARAM(slot);\n");
    1402                     push(@implContent, "    return ${className}::getConstructor(exec, deprecatedGlobalObjectForPrototype(exec));\n");
    1403                 } else {
    1404                     push(@implContent, "    ${className}* domObject = static_cast<$className*>(asObject(slot.slotBase()));\n");
    1405                     push(@implContent, "    return ${className}::getConstructor(exec, domObject->globalObject());\n");
    1406                 }
     1374                push(@implContent, "    ${className}* domObject = static_cast<$className*>(asObject(slot.slotBase()));\n");
     1375                push(@implContent, "    return ${className}::getConstructor(exec, domObject->globalObject());\n");
    14071376                push(@implContent, "}\n");
    14081377            }
     
    14891458                            push(@implContent, "    static_cast<$className*>(thisObject)->putDirect(Identifier(exec, \"$name\"), value);\n");
    14901459                        } else {
     1460                            push(@implContent, "    $className* castedThisObj = static_cast<$className*>(thisObject);\n");
     1461                            push(@implContent, "    $implType* imp = static_cast<$implType*>(castedThisObj->impl());\n");
    14911462                            if ($podType) {
    1492                                 push(@implContent, "    $podType imp(*static_cast<$className*>(thisObject)->impl());\n");
     1463                                push(@implContent, "    $podType podImp(*imp);\n");
    14931464                                if ($podType eq "float") { # Special case for JSSVGNumber
    1494                                     push(@implContent, "    imp = " . JSValueToNative($attribute->signature, "value") . ";\n");
     1465                                    push(@implContent, "    podImp = " . JSValueToNative($attribute->signature, "value") . ";\n");
    14951466                                } else {
    1496                                     push(@implContent, "    imp.set$implSetterFunctionName(" . JSValueToNative($attribute->signature, "value") . ");\n");
     1467                                    push(@implContent, "    podImp.set$implSetterFunctionName(" . JSValueToNative($attribute->signature, "value") . ");\n");
    14971468                                }
    1498                                 push(@implContent, "        static_cast<$className*>(thisObject)->impl()->commitChange(imp, static_cast<$className*>(thisObject)->context());\n");
     1469                                push(@implContent, "    imp->commitChange(podImp, castedThisObj);\n");
    14991470                            } else {
    1500                                 push(@implContent, "    $implClassName* imp = static_cast<$implClassName*>(static_cast<$className*>(thisObject)->impl());\n");
    15011471                                my $nativeValue = JSValueToNative($attribute->signature, "value");
    15021472                                push(@implContent, "    ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
     
    15141484                                push(@implContent, ");\n");
    15151485                                push(@implContent, "    setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
    1516 
    15171486                                if (IsSVGTypeNeedingContextParameter($implClassName)) {
    1518                                     push(@implContent, "    if (static_cast<$className*>(thisObject)->context())\n");
    1519                                     push(@implContent, "        static_cast<$className*>(thisObject)->context()->svgAttributeChanged(static_cast<$className*>(thisObject)->impl()->associatedAttributeName());\n");
     1487                                    push(@implContent, "    JSSVGContextCache::propagateSVGDOMChange(castedThisObj, imp->associatedAttributeName());\n");
    15201488                                }
    15211489                            }
     
    16031571                                 . ">(castedThisObj, exec, args, to" . $svgPODListType . ");\n");
    16041572            } else {
    1605                 if ($podType) {
    1606                     push(@implContent, "    JSSVGPODTypeWrapper<$podType>* wrapper = castedThisObj->impl();\n");
    1607                     push(@implContent, "    $podType imp(*wrapper);\n");
    1608                 } else {
    1609                     push(@implContent, "    $implClassName* imp = static_cast<$implClassName*>(castedThisObj->impl());\n");
    1610                 }
     1573                push(@implContent, "    $implType* imp = static_cast<$implType*>(castedThisObj->impl());\n");
     1574                push(@implContent, "    $podType podImp(*imp);\n") if $podType;
    16111575
    16121576                my $numParameters = @{$function->parameters};
     
    16281592
    16291593                my $paramIndex = 0;
    1630                 my $functionString = "imp" . ($podType ? "." : "->") . $functionImplementationName . "(";
     1594                my $functionString = ($podType ? "podImp." : "imp->") . $functionImplementationName . "(";
    16311595
    16321596                my $hasOptionalArguments = 0;
     
    17391703            push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JSSVGPODTypeWrapper<$podType>* object, SVGElement* context)\n");
    17401704        } elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
    1741              push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object, SVGElement* context)\n");
     1705            push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object, SVGElement* context)\n");
    17421706        } else {
    17431707            push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object)\n");
    17441708        }
    1745 
    17461709        push(@implContent, "{\n");
    17471710        if ($podType) {
     
    18011764        push(@implContent, $indent . "$functionString;\n");
    18021765        push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions};
    1803 
    1804         if ($podType) {
    1805             push(@implContent, $indent . "wrapper->commitChange(imp, castedThisObj->context());\n");
    1806         }
    1807 
     1766        push(@implContent, $indent . "imp->commitChange(podImp, castedThisObj);\n") if $podType;
    18081767        push(@implContent, $indent . "return jsUndefined();\n");
    18091768    } else {
     
    18141773            # Immutable methods do not commit changes back to the instance, thus producing
    18151774            # a new instance rather than mutating existing one.
    1816             push(@implContent, $indent . "wrapper->commitChange(imp, castedThisObj->context());\n");
     1775            push(@implContent, $indent . "imp->commitChange(podImp, castedThisObj);\n");
    18171776        }
    18181777
     
    19381897    }
    19391898   
    1940     # Some SVG bindings don't have space to store a globalObject pointer, for those, we use the deprecatedGlobalObjectForPrototype hack for now.
    1941     my $globalObject = IsSVGTypeNeedingContextParameter($implClassName) ? "deprecatedGlobalObjectForPrototype(exec)" : "$thisValue->globalObject()";
    1942 
     1899    my $globalObject = "$thisValue->globalObject()";
    19431900    if ($codeGenerator->IsPodType($type)) {
    19441901        $implIncludes{"JS$type.h"} = 1;
     
    19581915            and not defined $signature->extendedAttributes->{"Immutable"}) {
    19591916            if ($codeGenerator->IsPodType($implClassName)) {
    1960                 return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapperWithPODTypeParent<$nativeType, $implClassName>::create($value, $thisValue->impl()).get(), $thisValue->context())";
     1917                return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapperWithPODTypeParent<$nativeType, $implClassName>::create($value, $thisValue->impl()).get(), JSSVGContextCache::svgContextForDOMObject(castedThis))";
    19611918            } else {
    19621919                return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapperWithParent<$nativeType, $implClassName>::create(imp, &${implClassName}::$getter, &${implClassName}::$setter).get(), imp)";
     
    19651922
    19661923        if ($implClassNameForValueConversion eq "") {
    1967             # SVGZoomEvent has no context() pointer, and is also not an SVGElement.
    1968             # This is not a problem, because SVGZoomEvent has no read/write properties.
    1969             return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapper<$nativeType>::create($value).get(), 0)" if $implClassName eq "SVGZoomEvent";
    1970 
    1971             if (IsSVGTypeNeedingContextParameter($implClassName)) {
    1972                 return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapper<$nativeType>::create($value).get(), castedThisObj->context())" if $inFunctionCall;
    1973                 return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapper<$nativeType>::create($value).get(), $thisValue->context())";
    1974             } else {
    1975                 return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapper<$nativeType>::create($value).get(), imp)";
    1976             }
    1977         } else { # These classes, always have a m_context pointer!
    1978             return "toJS(exec, $globalObject, JSSVGDynamicPODTypeWrapperCache<$nativeType, $implClassNameForValueConversion>::lookupOrCreateWrapper(imp, &${implClassNameForValueConversion}::$getter, &${implClassNameForValueConversion}::$setter).get(), $thisValue->context())";
     1924            return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapper<$nativeType>::create($value).get(), 0 /* no context on purpose */)";
     1925        } else {
     1926            return "toJS(exec, $globalObject, JSSVGDynamicPODTypeWrapperCache<$nativeType, $implClassNameForValueConversion>::lookupOrCreateWrapper(imp, &${implClassNameForValueConversion}::$getter, &${implClassNameForValueConversion}::$setter).get(), JSSVGContextCache::svgContextForDOMObject(castedThis));"
    19791927        }
    19801928    }
     
    20171965
    20181966    if (IsSVGTypeNeedingContextParameter($type)) {
    2019         my $contextPtr = IsSVGTypeNeedingContextParameter($implClassName) ? "$thisValue->context()" : "imp";
     1967        my $contextPtr = IsSVGTypeNeedingContextParameter($implClassName) ? "JSSVGContextCache::svgContextForDOMObject(castedThis)" : "imp";
    20201968        return "toJS(exec, $globalObject, WTF::getPtr($value), $contextPtr)";
    20211969    }
  • trunk/WebCore/svg/SVGAngle.h

    r52373 r53666  
    2828namespace WebCore {
    2929
    30     class SVGStyledElement;
    31 
    3230    class SVGAngle {
    3331    public:
     
    5755        void convertToSpecifiedUnits(unsigned short unitType);
    5856
    59         // Throughout SVG 1.1 'SVGAngle' is only used for 'SVGMarkerElement' (orient-angle)
    60         const QualifiedName& associatedAttributeName() const { return SVGNames::orientAttr; }
    61 
    6257    private:
    6358        SVGAngleType m_unitType;
  • trunk/WebCore/svg/SVGPreserveAspectRatio.h

    r52865 r53666  
    8585        String valueAsString() const;
    8686
    87         const QualifiedName& associatedAttributeName() const { return SVGNames::preserveAspectRatioAttr; }
    88 
    8987    private:
    9088        unsigned short m_align;
  • trunk/WebCore/svg/SVGTransform.h

    r50583 r53666  
    5555        FloatPoint rotationCenter() const;
    5656
    57 //        void setMatrix(const TransformationMatrix&);
    5857        void setMatrix(TransformationMatrix);
    5958
     
    6968       
    7069        bool isValid();
    71 
    72         // Throughout SVG 1.1 'SVGTransform' is only used for the 'transform' attribute
    73         const QualifiedName& associatedAttributeName() const { return SVGNames::transformAttr; }
    7470
    7571    private:
     
    9490#endif // ENABLE(SVG)
    9591#endif
    96 
    97 // vim:ts=4:noet
Note: See TracChangeset for help on using the changeset viewer.