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

Darin darin at opensource.apple.com
Fri Sep 23 11:24:59 PDT 2005


darin       05/09/23 11:24:58

  Modified:    .        ChangeLog
               kwq      DOM-CSS.mm
  Log:
          Reviewed by Eric.
  
          - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4310
            "sheet" method is unimplemented in Obj-C DOM API
  
          * kwq/DOM-CSS.mm: (-[DOMObject sheet]): Added.
  
  Revision  Changes    Path
  1.151     +9 -0      WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.150
  retrieving revision 1.151
  diff -u -r1.150 -r1.151
  --- ChangeLog	23 Sep 2005 18:20:29 -0000	1.150
  +++ ChangeLog	23 Sep 2005 18:24:57 -0000	1.151
  @@ -2,6 +2,15 @@
   
           Reviewed by Eric.
   
  +        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4310
  +          "sheet" method is unimplemented in Obj-C DOM API
  +
  +        * kwq/DOM-CSS.mm: (-[DOMObject sheet]): Added.
  +
  +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
   
  
  
  
  1.27      +17 -3     WebCore/kwq/DOM-CSS.mm
  
  Index: DOM-CSS.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOM-CSS.mm,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- DOM-CSS.mm	23 Sep 2005 18:20:30 -0000	1.26
  +++ DOM-CSS.mm	23 Sep 2005 18:24:58 -0000	1.27
  @@ -33,10 +33,12 @@
   #import "css_valueimpl.h"
   #import "css_value.h"
   #import "dom_string.h"
  +#import "dom_xmlimpl.h"
   #import "KWQColor.h"
   #import "shared.h"
   #import "dom_stringimpl.h"
   #import "dom2_viewsimpl.h"
  +#import "html_headimpl.h"
   
   #import "DOMInternal.h"
   #import "KWQAssertions.h"
  @@ -58,7 +60,10 @@
   using DOM::CSSValueImpl;
   using DOM::CSSValueListImpl;
   using DOM::DOMString;
  +using DOM::HTMLLinkElementImpl;
  +using DOM::HTMLStyleElementImpl;
   using DOM::MediaListImpl;
  +using DOM::ProcessingInstructionImpl;
   using DOM::RectImpl;
   using DOM::StyleSheetImpl;
   using DOM::StyleSheetListImpl;
  @@ -2504,13 +2509,22 @@
   
   //------------------------------------------------------------------------------------------
   
  -
   @implementation DOMObject (DOMLinkStyle)
   
   - (DOMStyleSheet *)sheet
   {
  -    ERROR("unimplemented");
  -    return nil;
  +    StyleSheetImpl *sheet;
  +
  +    if ([self isKindOfClass:[DOMProcessingInstruction class]])
  +        sheet = static_cast<ProcessingInstructionImpl *>([(DOMProcessingInstruction *)self _nodeImpl])->sheet();
  +    else if ([self isKindOfClass:[DOMHTMLLinkElement class]])
  +        sheet = static_cast<HTMLLinkElementImpl *>([(DOMHTMLLinkElement *)self _nodeImpl])->sheet();
  +    else if ([self isKindOfClass:[DOMHTMLStyleElement class]])
  +        sheet = static_cast<HTMLStyleElementImpl *>([(DOMHTMLStyleElement *)self _nodeImpl])->sheet();
  +    else
  +        return nil;
  +
  +    return [DOMStyleSheet _DOMStyleSheetWithImpl:sheet];
   }
   
   @end
  
  
  



More information about the webkit-changes mailing list