[webkit-changes] cvs commit: WebCore/kwq DOM-CSS.mm

Darin darin at opensource.apple.com
Fri Sep 23 11:20:31 PDT 2005


darin       05/09/23 11:20:30

  Modified:    .        ChangeLog
               kwq      DOM-CSS.mm
  Log:
          Reviewed by Eric.
  
          - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4309
            CSSStyleSheet objects don't get Obj-C DOMCSSStyleSheet wrappers
  
          * kwq/DOM-CSS.mm:
          (-[DOMStyleSheet _initWithStyleSheetImpl:]): Changed the name of this method to be consistent
          with other method names in the DOM wrappers. The old name had an extraneous "DOM" in it.
          (+[DOMStyleSheet _DOMStyleSheetWithImpl:]): Create a wrapper of an appropriate class
          that matches the actual style sheet. This is analogous to what +[DOMNode _nodeWithImpl:] does.
          (+[DOMCSSStyleSheet _CSSStyleSheetWithImpl:]): Call through to the base class. The only difference
          here is the static type of the parameter, which ensures a compile-time error if you pass the
          wrong type of pointer.
  
  Revision  Changes    Path
  1.150     +16 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.149
  retrieving revision 1.150
  diff -u -r1.149 -r1.150
  --- ChangeLog	23 Sep 2005 17:38:05 -0000	1.149
  +++ ChangeLog	23 Sep 2005 18:20:29 -0000	1.150
  @@ -1,3 +1,19 @@
  +2005-09-23  Darin Adler  <darin at apple.com>
  +
  +        Reviewed by Eric.
  +
  +        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4309
  +          CSSStyleSheet objects don't get Obj-C DOMCSSStyleSheet wrappers
  +
  +        * kwq/DOM-CSS.mm:
  +        (-[DOMStyleSheet _initWithStyleSheetImpl:]): Changed the name of this method to be consistent
  +        with other method names in the DOM wrappers. The old name had an extraneous "DOM" in it.
  +        (+[DOMStyleSheet _DOMStyleSheetWithImpl:]): Create a wrapper of an appropriate class
  +        that matches the actual style sheet. This is analogous to what +[DOMNode _nodeWithImpl:] does.
  +        (+[DOMCSSStyleSheet _CSSStyleSheetWithImpl:]): Call through to the base class. The only difference
  +        here is the static type of the parameter, which ensures a compile-time error if you pass the
  +        wrong type of pointer.
  +
   2005-09-23  David Hyatt  <hyatt at apple.com>
   
           Reviewed by Maciej.
  
  
  
  1.26      +8 -36     WebCore/kwq/DOM-CSS.mm
  
  Index: DOM-CSS.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOM-CSS.mm,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DOM-CSS.mm	16 Sep 2005 22:42:23 -0000	1.25
  +++ DOM-CSS.mm	23 Sep 2005 18:20:30 -0000	1.26
  @@ -169,7 +169,7 @@
   
   @implementation DOMStyleSheet (WebCoreInternal)
   
  -- (id)_initWithDOMStyleSheetImpl:(StyleSheetImpl *)impl
  +- (id)_initWithStyleSheetImpl:(StyleSheetImpl *)impl
   {
       [super _init];
       _internal = DOM_cast<DOMObjectInternal *>(impl);
  @@ -188,7 +188,12 @@
       if (cachedInstance)
           return [[cachedInstance retain] autorelease];
       
  -    return [[[self alloc] _initWithDOMStyleSheetImpl:impl] autorelease];
  +    Class wrapperClass;
  +    if (impl->isCSSStyleSheet())
  +        wrapperClass = [DOMCSSStyleSheet class];
  +    else
  +        wrapperClass = [DOMStyleSheet class];
  +    return [[[wrapperClass alloc] _initWithStyleSheetImpl:impl] autorelease];
   }
   
   @end
  @@ -262,22 +267,6 @@
   
   @implementation DOMCSSStyleSheet
   
  -- (void)dealloc
  -{
  -    if (_internal) {
  -        DOM_cast<CSSStyleSheetImpl *>(_internal)->deref();
  -    }
  -    [super dealloc];
  -}
  -
  -- (void)finalize
  -{
  -    if (_internal) {
  -        DOM_cast<CSSStyleSheetImpl *>(_internal)->deref();
  -    }
  -    [super finalize];
  -}
  -
   - (CSSStyleSheetImpl *)_CSSStyleSheetImpl
   {
       return DOM_cast<CSSStyleSheetImpl *>(_internal);
  @@ -312,26 +301,9 @@
   
   @implementation DOMCSSStyleSheet (WebCoreInternal)
   
  -- (id)_initWithCSSStyleSheetImpl:(CSSStyleSheetImpl *)impl
  -{
  -    [super _init];
  -    _internal = DOM_cast<DOMObjectInternal *>(impl);
  -    impl->ref();
  -    addDOMWrapper(self, impl);
  -    return self;
  -}
  -
   + (DOMCSSStyleSheet *)_CSSStyleSheetWithImpl:(CSSStyleSheetImpl *)impl
   {
  -    if (!impl)
  -        return nil;
  -    
  -    id cachedInstance;
  -    cachedInstance = getDOMWrapper(impl);
  -    if (cachedInstance)
  -        return [[cachedInstance retain] autorelease];
  -    
  -    return [[[self alloc] _initWithCSSStyleSheetImpl:impl] autorelease];
  +    return (DOMCSSStyleSheet *)[DOMStyleSheet _DOMStyleSheetWithImpl:impl];
   }
   
   @end
  
  
  



More information about the webkit-changes mailing list