WebCore:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Sep 2006 02:11:32 +0000 (02:11 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Sep 2006 02:11:32 +0000 (02:11 +0000)
        Reviewed by Darin and Tim H.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10711
          Auto-generate the Objective-C DOM Stylesheet bindings

          Auto-generates DOMMediaList, DOMStyleSheet, and DOMStyleSheetList.

        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/DOMCSS.mm:
        (+[DOMStyleSheet _styleSheetWith:]):
        (+[DOMCSSStyleSheet _CSSStyleSheetWith:]):
        * bindings/objc/DOMCSSInternal.h:
        * bindings/objc/DOMInternal.h:
        * bindings/objc/DOMObject.mm:
        (-[DOMObject sheet]):
        * bindings/objc/DOMPrivate.h:
        * bindings/objc/DOMStylesheets.h:
        * bindings/objc/DOMUtility.mm:
        (KJS::ScriptInterpreter::createObjcInstanceForValue):
        * bindings/scripts/CodeGeneratorObjC.pm:
        * css/StyleSheet.idl: Added.
        * css/StyleSheetList.idl: Added.

WebKit:

        Reviewed by Darin and Tim H.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10711
          Auto-generate the Objective-C DOM Stylesheet bindings

        * MigrateHeaders.make:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOMCSS.mm
WebCore/bindings/objc/DOMCSSInternal.h
WebCore/bindings/objc/DOMInternal.h
WebCore/bindings/objc/DOMObject.mm
WebCore/bindings/objc/DOMPrivate.h
WebCore/bindings/objc/DOMStylesheets.h
WebCore/bindings/objc/DOMUtility.mm
WebCore/bindings/scripts/CodeGeneratorObjC.pm
WebCore/css/StyleSheet.idl [new file with mode: 0644]
WebCore/css/StyleSheetList.idl [new file with mode: 0644]
WebKit/ChangeLog
WebKit/MigrateHeaders.make

index d77d0d55ed42303ce5568e35b15ce60dde32f6ad..f87e36c31d62400b6b53852d4d0fe81e64f0e0a9 100644 (file)
@@ -1,3 +1,29 @@
+2006-09-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin and Tim H.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10711
+          Auto-generate the Objective-C DOM Stylesheet bindings
+
+          Auto-generates DOMMediaList, DOMStyleSheet, and DOMStyleSheetList.
+
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/objc/DOMCSS.mm:
+        (+[DOMStyleSheet _styleSheetWith:]):
+        (+[DOMCSSStyleSheet _CSSStyleSheetWith:]):
+        * bindings/objc/DOMCSSInternal.h:
+        * bindings/objc/DOMInternal.h:
+        * bindings/objc/DOMObject.mm:
+        (-[DOMObject sheet]):
+        * bindings/objc/DOMPrivate.h:
+        * bindings/objc/DOMStylesheets.h:
+        * bindings/objc/DOMUtility.mm:
+        (KJS::ScriptInterpreter::createObjcInstanceForValue):
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        * css/StyleSheet.idl: Added.
+        * css/StyleSheetList.idl: Added.
+
 2006-09-03  Rob Buis  <buis@kde.org>
 
         Reviewed by Darin.
index a33052685436b827e183b217f546c332187d158b..0e84d099c688445cd181b9ddc29f16a4c01a1825 100644 (file)
@@ -46,26 +46,25 @@ all : \
     CharsetData.cpp \
     ColorData.c \
     DocTypeStrings.cpp \
+    DOMAttr.h \
+    DOMCDATASection.h \
     DOMCSSCharsetRule.h \
     DOMCSSFontFaceRule.h \
     DOMCSSImportRule.h \
     DOMCSSMediaRule.h \
     DOMCSSPageRule.h \
+    DOMCSSPrimitiveValue.h \
     DOMCSSRule.h \
     DOMCSSRuleList.h \
     DOMCSSStyleDeclaration.h \
     DOMCSSStyleRule.h \
+    DOMCSSStyleSheet.h \
     DOMCSSUnknownRule.h \
     DOMCSSValue.h \
-    DOMCSSPrimitiveValue.h \
     DOMCSSValueList.h \
-    DOMCSSStyleSheet.h \
-    DOMCounter.h \
-    DOMRect.h \
-    DOMAttr.h \
-    DOMCDATASection.h \
     DOMCharacterData.h \
     DOMComment.h \
+    DOMCounter.h \
     DOMDOMImplementation.h \
     DOMDocument.h \
     DOMDocumentFragment.h \
@@ -73,11 +72,6 @@ all : \
     DOMElement.h \
     DOMEntity.h \
     DOMEntityReference.h \
-    DOMNamedNodeMap.h \
-    DOMNodeList.h \
-    DOMNotation.h \
-    DOMProcessingInstruction.h \
-    DOMText.h \
     DOMHTMLAnchorElement.h \
     DOMHTMLAreaElement.h \
     DOMHTMLBRElement.h \
@@ -131,6 +125,15 @@ all : \
     DOMHTMLTextAreaElement.h \
     DOMHTMLTitleElement.h \
     DOMHTMLUListElement.h \
+    DOMMediaList.h \
+    DOMNamedNodeMap.h \
+    DOMNodeList.h \
+    DOMNotation.h \
+    DOMProcessingInstruction.h \
+    DOMRect.h \
+    DOMStyleSheet.h \
+    DOMStyleSheetList.h \
+    DOMText.h \
     HTMLEntityNames.c \
     JSAttr.h \
     JSCSSPrimitiveValue.h \
index 5e1cd754d3316b2eb850a4c78072ad0420c314c7..296c722cd10e3587d70c63c863febba77f4f68f1 100644 (file)
                85032DE80AA8C9BE007D3B7D /* DOMCSSStyleRule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85032DD40AA8C9BE007D3B7D /* DOMCSSStyleRule.mm */; };
                85032DE90AA8C9BE007D3B7D /* DOMCSSUnknownRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 85032DD50AA8C9BE007D3B7D /* DOMCSSUnknownRule.h */; };
                85032DEA0AA8C9BE007D3B7D /* DOMCSSUnknownRule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85032DD60AA8C9BE007D3B7D /* DOMCSSUnknownRule.mm */; };
+               850656FE0AAB4763002D15C0 /* DOMMediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = 850656F80AAB4763002D15C0 /* DOMMediaList.h */; };
+               850656FF0AAB4763002D15C0 /* DOMMediaList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 850656F90AAB4763002D15C0 /* DOMMediaList.mm */; };
+               850657000AAB4763002D15C0 /* DOMStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = 850656FA0AAB4763002D15C0 /* DOMStyleSheet.h */; };
+               850657010AAB4763002D15C0 /* DOMStyleSheet.mm in Sources */ = {isa = PBXBuildFile; fileRef = 850656FB0AAB4763002D15C0 /* DOMStyleSheet.mm */; };
+               850657020AAB4763002D15C0 /* DOMStyleSheetList.h in Headers */ = {isa = PBXBuildFile; fileRef = 850656FC0AAB4763002D15C0 /* DOMStyleSheetList.h */; };
+               850657030AAB4763002D15C0 /* DOMStyleSheetList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 850656FD0AAB4763002D15C0 /* DOMStyleSheetList.mm */; };
+               8506579F0AAB4A8E002D15C0 /* DOMMediaList.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 850656F80AAB4763002D15C0 /* DOMMediaList.h */; };
+               850657A00AAB4A8E002D15C0 /* DOMStyleSheet.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 850656FA0AAB4763002D15C0 /* DOMStyleSheet.h */; };
+               850657A10AAB4A8E002D15C0 /* DOMStyleSheetList.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 850656FC0AAB4763002D15C0 /* DOMStyleSheetList.h */; };
                85089CD70A98C42800A275AA /* DOMCDATASection.h in Headers */ = {isa = PBXBuildFile; fileRef = 85089CCF0A98C42700A275AA /* DOMCDATASection.h */; settings = {ATTRIBUTES = (); }; };
                85089CD80A98C42800A275AA /* DOMCDATASection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85089CD00A98C42700A275AA /* DOMCDATASection.mm */; };
                85089CD90A98C42800A275AA /* DOMComment.h in Headers */ = {isa = PBXBuildFile; fileRef = 85089CD10A98C42700A275AA /* DOMComment.h */; settings = {ATTRIBUTES = (); }; };
                        dstPath = Versions/A/PrivateHeaders;
                        dstSubfolderSpec = 1;
                        files = (
+                               8506579F0AAB4A8E002D15C0 /* DOMMediaList.h in CopyFiles */,
+                               850657A00AAB4A8E002D15C0 /* DOMStyleSheet.h in CopyFiles */,
+                               850657A10AAB4A8E002D15C0 /* DOMStyleSheetList.h in CopyFiles */,
                                1C11CCB50AA6093700DADB20 /* DOMNotation.h in CopyFiles */,
                                1C11CCB60AA6093700DADB20 /* DOMComment.h in CopyFiles */,
                                1C11CCB70AA6093700DADB20 /* DOMNamedNodeMap.h in CopyFiles */,
                85032DD40AA8C9BE007D3B7D /* DOMCSSStyleRule.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMCSSStyleRule.mm; sourceTree = "<group>"; };
                85032DD50AA8C9BE007D3B7D /* DOMCSSUnknownRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMCSSUnknownRule.h; sourceTree = "<group>"; };
                85032DD60AA8C9BE007D3B7D /* DOMCSSUnknownRule.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMCSSUnknownRule.mm; sourceTree = "<group>"; };
+               850656DC0AAB44D9002D15C0 /* StyleSheet.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = StyleSheet.idl; sourceTree = "<group>"; };
+               850656DF0AAB454F002D15C0 /* StyleSheetList.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = StyleSheetList.idl; sourceTree = "<group>"; };
+               850656F80AAB4763002D15C0 /* DOMMediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMediaList.h; sourceTree = "<group>"; };
+               850656F90AAB4763002D15C0 /* DOMMediaList.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMediaList.mm; sourceTree = "<group>"; };
+               850656FA0AAB4763002D15C0 /* DOMStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMStyleSheet.h; sourceTree = "<group>"; };
+               850656FB0AAB4763002D15C0 /* DOMStyleSheet.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMStyleSheet.mm; sourceTree = "<group>"; };
+               850656FC0AAB4763002D15C0 /* DOMStyleSheetList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMStyleSheetList.h; sourceTree = "<group>"; };
+               850656FD0AAB4763002D15C0 /* DOMStyleSheetList.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMStyleSheetList.mm; sourceTree = "<group>"; };
                85089CC70A98C22600A275AA /* Comment.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Comment.idl; sourceTree = "<group>"; };
                85089CC90A98C2AB00A275AA /* CDATASection.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CDATASection.idl; sourceTree = "<group>"; };
                85089CCB0A98C33A00A275AA /* EntityReference.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = EntityReference.idl; sourceTree = "<group>"; };
                        path = mac;
                        sourceTree = "<group>";
                };
+               850657040AAB476C002D15C0 /* StyleSheets */ = {
+                       isa = PBXGroup;
+                       children = (
+                               850656F80AAB4763002D15C0 /* DOMMediaList.h */,
+                               850656F90AAB4763002D15C0 /* DOMMediaList.mm */,
+                               850656FA0AAB4763002D15C0 /* DOMStyleSheet.h */,
+                               850656FB0AAB4763002D15C0 /* DOMStyleSheet.mm */,
+                               850656FC0AAB4763002D15C0 /* DOMStyleSheetList.h */,
+                               850656FD0AAB4763002D15C0 /* DOMStyleSheetList.mm */,
+                       );
+                       name = StyleSheets;
+                       sourceTree = "<group>";
+               };
                854F12AC0A8EBC18000940B5 /* Core */ = {
                        isa = PBXGroup;
                        children = (
                85B232260A8BF3A100FDF47B /* Derived Sources */ = {
                        isa = PBXGroup;
                        children = (
+                               850657040AAB476C002D15C0 /* StyleSheets */,
                                85967D9F0AA8BB59005FEDEE /* Core */,
                                85967DCA0AA8BF0F005FEDEE /* CSS */,
                                85C56D030AA8BAA700D95755 /* HTML */,
                                A80E734A0A199C77007FB8C5 /* StyleList.h */,
                                A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */,
                                A8EA80040A19516E00A8EF5F /* StyleSheet.h */,
+                               850656DC0AAB44D9002D15C0 /* StyleSheet.idl */,
                                A8EA80030A19516E00A8EF5F /* StyleSheetList.cpp */,
                                A8EA80020A19516E00A8EF5F /* StyleSheetList.h */,
+                               850656DF0AAB454F002D15C0 /* StyleSheetList.idl */,
                                93CA4CA209DF93FA00DF8677 /* svg.css */,
                                93CA4CA309DF93FA00DF8677 /* tokenizer.flex */,
                                BC5EC1760A507E3E006007F5 /* view-source.css */,
                                858C38A70AA8F20400B187A4 /* DOMRect.h in Headers */,
                                858C39280AA8FF9D00B187A4 /* DOMCSSStyleSheet.h in Headers */,
                                858C395F0AA902A900B187A4 /* DOMRGBColor.h in Headers */,
+                               850656FE0AAB4763002D15C0 /* DOMMediaList.h in Headers */,
+                               850657000AAB4763002D15C0 /* DOMStyleSheet.h in Headers */,
+                               850657020AAB4763002D15C0 /* DOMStyleSheetList.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
                        projectRoot = "";
-                       shouldCheckCompatibility = 1;
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
                                858C38A80AA8F20400B187A4 /* DOMRect.mm in Sources */,
                                858C39290AA8FF9D00B187A4 /* DOMCSSStyleSheet.mm in Sources */,
                                858C39600AA902A900B187A4 /* DOMRGBColor.mm in Sources */,
+                               850656FF0AAB4763002D15C0 /* DOMMediaList.mm in Sources */,
+                               850657010AAB4763002D15C0 /* DOMStyleSheet.mm in Sources */,
+                               850657030AAB4763002D15C0 /* DOMStyleSheetList.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 82f137344666e9e456a0f0b5fb4439534dde5604..d7e7d3605aa058e5eed8bd50a32fee0cf03a0129 100644 (file)
@@ -61,71 +61,6 @@ typedef DOMWindow AbstractView;
 //------------------------------------------------------------------------------------------
 // DOMStyleSheet
 
-@implementation DOMStyleSheet
-
-- (void)dealloc
-{
-    if (_internal) {
-        DOM_cast<StyleSheet*>(_internal)->deref();
-    }
-    [super dealloc];
-}
-
-- (void)finalize
-{
-    if (_internal) {
-        DOM_cast<StyleSheet*>(_internal)->deref();
-    }
-    [super finalize];
-}
-
-- (StyleSheet *)_DOMStyleSheet
-{
-    return DOM_cast<StyleSheet*>(_internal);
-}
-
-- (NSString *)type
-{
-    return [self _DOMStyleSheet]->type();
-}
-
-- (BOOL)disabled
-{
-    return [self _DOMStyleSheet]->disabled();
-}
-
-- (void)setDisabled:(BOOL)disabled
-{
-    [self _DOMStyleSheet]->setDisabled(disabled);
-}
-
-- (DOMNode *)ownerNode
-{
-    return [DOMNode _nodeWith:[self _DOMStyleSheet]->ownerNode()];
-}
-
-- (DOMStyleSheet *)parentStyleSheet
-{
-    return [DOMStyleSheet _DOMStyleSheetWith:[self _DOMStyleSheet]->parentStyleSheet()];
-}
-
-- (NSString *)href
-{
-    return [self _DOMStyleSheet]->href();
-}
-
-- (NSString *)title
-{
-    return [self _DOMStyleSheet]->title();
-}
-
-- (DOMMediaList *)media
-{
-    return nil;
-}
-
-@end
-
 @implementation DOMStyleSheet (WebCoreInternal)
 
 - (id)_initWithStyleSheet:(StyleSheet *)impl
@@ -137,7 +72,7 @@ typedef DOMWindow AbstractView;
     return self;
 }
 
-+ (DOMStyleSheet *)_DOMStyleSheetWith:(StyleSheet *)impl
++ (DOMStyleSheet *)_styleSheetWith:(StyleSheet *)impl
 {
     if (!impl)
         return nil;
@@ -157,44 +92,10 @@ typedef DOMWindow AbstractView;
 
 @end
 
+
 //------------------------------------------------------------------------------------------
 // DOMStyleSheetList
 
-@implementation DOMStyleSheetList
-
-- (void)dealloc
-{
-    if (_internal) {
-        DOM_cast<StyleSheetList*>(_internal)->deref();
-    }
-    [super dealloc];
-}
-
-- (void)finalize
-{
-    if (_internal) {
-        DOM_cast<StyleSheetList*>(_internal)->deref();
-    }
-    [super finalize];
-}
-
-- (StyleSheetList *)_styleSheetList
-{
-    return DOM_cast<StyleSheetList*>(_internal);
-}
-
-- (unsigned)length
-{
-    return [self _styleSheetList]->length();
-}
-
-- (DOMStyleSheet *)item:(unsigned)index
-{
-    return [DOMStyleSheet _DOMStyleSheetWith:[self _styleSheetList]->item(index)];
-}
-
-@end
-
 @implementation DOMStyleSheetList (WebCoreInternal)
 
 - (id)_initWithStyleSheetList:(StyleSheetList *)impl
@@ -221,6 +122,7 @@ typedef DOMWindow AbstractView;
 
 @end
 
+
 //------------------------------------------------------------------------------------------
 // DOMCSSStyleSheet
 
@@ -228,75 +130,15 @@ typedef DOMWindow AbstractView;
 
 + (DOMCSSStyleSheet *)_CSSStyleSheetWith:(CSSStyleSheet *)impl
 {
-    return static_cast<DOMCSSStyleSheet*>([DOMStyleSheet _DOMStyleSheetWith:impl]);
+    return static_cast<DOMCSSStyleSheet*>([DOMStyleSheet _styleSheetWith:impl]);
 }
 
 @end
 
+
 //------------------------------------------------------------------------------------------
 // DOMMediaList
 
-@implementation DOMMediaList
-
-- (void)dealloc
-{
-    if (_internal) {
-        DOM_cast<MediaList*>(_internal)->deref();
-    }
-    [super dealloc];
-}
-
-- (void)finalize
-{
-    if (_internal) {
-        DOM_cast<MediaList*>(_internal)->deref();
-    }
-    [super finalize];
-}
-
-- (MediaList *)_mediaList
-{
-    return DOM_cast<MediaList*>(_internal);
-}
-
-- (NSString *)mediaText
-{
-    return [self _mediaList]->mediaText();
-}
-
-- (void)setMediaText:(NSString *)mediaText
-{
-    ExceptionCode ec = 0;
-    [self _mediaList]->setMediaText(mediaText, ec);
-    raiseOnDOMError(ec);
-}
-
-- (unsigned)length
-{
-    return [self _mediaList]->length();
-}
-
-- (NSString *)item:(unsigned)index
-{
-    return [self _mediaList]->item(index);
-}
-
-- (void)deleteMedium:(NSString *)oldMedium
-{
-    ExceptionCode ec = 0;
-    [self _mediaList]->deleteMedium(oldMedium, ec);
-    raiseOnDOMError(ec);
-}
-
-- (void)appendMedium:(NSString *)newMedium
-{
-    ExceptionCode ec = 0;
-    [self _mediaList]->appendMedium(newMedium, ec);
-    raiseOnDOMError(ec);
-}
-
-@end
-
 @implementation DOMMediaList (WebCoreInternal)
 
 - (id)_initWithMediaList:(MediaList *)impl
@@ -323,6 +165,7 @@ typedef DOMWindow AbstractView;
 
 @end
 
+
 //------------------------------------------------------------------------------------------
 // DOMCSSRuleList
 
index 2fce81af534d7feb8a0f8c2d2676170926fe742b..7aadd128c1143f3717d0fc897a7859ae2c458560 100644 (file)
@@ -44,19 +44,9 @@ namespace WebCore {
     class CSSStyleSheet;
     class CSSValue;
     class Counter;
-    class MediaList;
     class RectImpl;
-    class StyleSheet;
 }
 
-@interface DOMStyleSheet (WebCoreInternal)
-+ (DOMStyleSheet *)_DOMStyleSheetWith:(WebCore::StyleSheet *)impl;
-@end
-
-@interface DOMMediaList (WebCoreInternal)
-+ (DOMMediaList *)_mediaListWith:(WebCore::MediaList *)impl;
-@end
-
 @interface DOMCSSRuleList (WebCoreInternal)
 + (DOMCSSRuleList *)_ruleListWith:(WebCore::CSSRuleList *)impl;
 @end
index a5fbbd5a0fd02180062ed7346f9347f4f7319196..de0397297dc40bf193beb0b9becdc0fb8d67b055 100644 (file)
 #import "DOMDocumentType.h"
 #import "DOMElement.h"
 #import "DOMEntityReference.h"
+#import "DOMMediaList.h"
 #import "DOMNamedNodeMap.h"
 #import "DOMNode.h"
 #import "DOMNodeList.h"
 #import "DOMObject.h"
 #import "DOMProcessingInstruction.h"
+#import "DOMStyleSheet.h"
+#import "DOMStyleSheetList.h"
 #import "DOMText.h"
 
 namespace WebCore {
@@ -54,6 +57,7 @@ namespace WebCore {
     class DocumentType;
     class Element;
     class EntityReference;
+    class MediaList;
     class NamedNodeMap;
     class Node;
     class NodeFilter;
@@ -61,6 +65,7 @@ namespace WebCore {
     class NodeList;
     class ProcessingInstruction;
     class Range;
+    class StyleSheet;
     class StyleSheetList;
     class Text;
     class TreeWalker;
@@ -149,10 +154,18 @@ namespace WebCore {
 + (DOMTreeWalker *)_treeWalkerWith:(WebCore::TreeWalker *)impl filter:(id <DOMNodeFilter>)filter;
 @end
 
+@interface DOMStyleSheet (WebCoreInternal)
++ (DOMStyleSheet *)_styleSheetWith:(WebCore::StyleSheet *)impl;
+@end
+
 @interface DOMStyleSheetList (WebCoreInternal)
 + (DOMStyleSheetList *)_styleSheetListWith:(WebCore::StyleSheetList *)impl;
 @end
 
+@interface DOMMediaList (WebCoreInternal)
++ (DOMMediaList *)_mediaListWith:(WebCore::MediaList *)impl;
+@end
+
 @interface DOMNodeFilter : DOMObject <DOMNodeFilter>
 + (DOMNodeFilter *)_nodeFilterWith:(WebCore::NodeFilter *)impl;
 @end
index abdad512e92cb41f4cde17b1a1235f0c41a240d2..cdd28943545bff6ad505525170545b175c83eb63 100644 (file)
 #import "DOMObject.h"
 
 #import "DOMInternal.h"
-
-#import "DOMCSS.h" // for DOMStyleSheet
-#import "DOMCSSInternal.h"
-#import "DOMHTML.h" // for DOMHTMLLinkElement and DOMHTMLStyleElement
+#import "DOMHTMLLinkElement.h"
+#import "DOMHTMLStyleElement.h"
 #import "DOMProcessingInstruction.h"
+#import "DOMStyleSheet.h"
 #import "HTMLLinkElement.h"
 #import "HTMLStyleElement.h"
 #import "ProcessingInstruction.h"
@@ -85,7 +84,7 @@
     else
         return nil;
 
-    return [DOMStyleSheet _DOMStyleSheetWith:sheet];
+    return [DOMStyleSheet _styleSheetWith:sheet];
 }
 
 @end
index 8bd07b445bf08bb791b9e789d3ea772497bf5541..d35d082986a0b6483edfe363152af4d6366ea77e 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #import <WebCore/DOMCSS.h>
+#import <WebCore/DOMCSSStyleDeclaration.h>
 #import <WebCore/DOMElement.h>
 #import <WebCore/DOMEvents.h>
 #import <WebCore/DOMHTML.h>
@@ -32,6 +33,7 @@
 #import <WebCore/DOMHTMLInputElement.h>
 #import <WebCore/DOMHTMLSelectElement.h>
 #import <WebCore/DOMNode.h>
+#import <WebCore/DOMRGBColor.h>
 #import <WebCore/DOMRange.h>
 
 @interface DOMRange (WebPrivate)
index ac9c744d44f608feed7b17b98ca65c84f2f8252c..81b5def6966d1689e20df25bcb6539419026808b 100644 (file)
 #import <WebCore/DOMDocument.h>
 #import <WebCore/DOMObject.h>
 
-@class DOMMediaList;
-@class DOMStyleSheet;
-
-extern NSString * const DOMEventException;
-
-@interface DOMStyleSheet : DOMObject
-- (NSString *)type;
-- (BOOL)disabled;
-- (void)setDisabled:(BOOL)disabled;
-- (DOMNode *)ownerNode;
-- (DOMStyleSheet *)parentStyleSheet;
-- (NSString *)href;
-- (NSString *)title;
-- (DOMMediaList *)media;
-@end
-
-@interface DOMStyleSheetList : DOMObject
-- (unsigned)length;
-- (DOMStyleSheet *)item:(unsigned)index;
-@end
-
-@interface DOMMediaList : DOMObject
-- (NSString *)mediaText;
-- (void)setMediaText:(NSString *)mediaText;
-- (unsigned)length;
-- (NSString *)item:(unsigned)index;
-- (void)deleteMedium:(NSString *)oldMedium;
-- (void)appendMedium:(NSString *)newMedium;
-@end
+#import <WebCore/DOMStyleSheet.h>
+#import <WebCore/DOMStyleSheetList.h>
+#import <WebCore/DOMMediaList.h>
index a2b3fe26863812eefaf915e9886f02cf10def2a7..233b3a210a7cfaa779e502498573f53ec77485fe 100644 (file)
@@ -54,7 +54,7 @@ void *ScriptInterpreter::createObjcInstanceForValue(ExecState *exec, JSObject *v
     else if (value->inherits(&DOMStyleSheetList::info))
         newObj = [objc_getClass("DOMStyleSheetList") _styleSheetListWith:static_cast<DOMStyleSheetList *>(value)->impl()];
     else if (value->inherits(&DOMStyleSheet::info))
-        newObj = [objc_getClass("DOMStyleSheet") _DOMStyleSheetWith:static_cast<DOMStyleSheet *>(value)->impl()];
+        newObj = [objc_getClass("DOMStyleSheet") _styleSheetWith:static_cast<DOMStyleSheet *>(value)->impl()];
     else if (value->inherits(&DOMMediaList::info))
         newObj = [objc_getClass("DOMMediaList") _mediaListWith:static_cast<DOMMediaList *>(value)->impl()];
     else if (value->inherits(&WebCore::JSCSSRuleList::info))
index 9f86678c492ff3a99be19191f9f1f9098091ce81..74ed976d502a86edcd7c8cd4ad22afb4e7bbfd82 100644 (file)
@@ -341,13 +341,6 @@ sub AddIncludesForType
         return;
     }
 
-    # Temp DOMStylesheets.h
-    if ($type eq "StyleSheet" or $type eq "StyleSheetList" or $type eq "MediaList") {
-        $implIncludes{"DOMStylesheets.h"} = 1;
-        $implIncludes{"$type.h"} = 1;
-        return;
-    }
-
     # Temp DOMViews.h
     if ($type eq "DOMWindow") {
         $implIncludes{"DOMViews.h"} = 1;
@@ -404,11 +397,7 @@ sub GenerateHeader
     @headerContentHeader = split("\r", $headerLicenceTemplate);
 
     # - INCLUDES -
-    if ($parentClassName eq "DOMStyleSheet") {
-        push(@headerContentHeader, "\n#import <WebCore/DOMStylesheets.h> // parent class\n\n");
-    } else {
-        push(@headerContentHeader, "\n#import <WebCore/$parentClassName.h> // parent class\n\n");
-    }
+    push(@headerContentHeader, "\n#import <WebCore/$parentClassName.h>\n\n");
 
     # - Add constants.
     if ($numConstants > 0) {
@@ -521,7 +510,7 @@ sub GenerateHeader
         }
 
         if (@headerFunctions > 0) {
-            push(@headerContent, "\n");
+            push(@headerContent, "\n") if $buildingForLeopardOrLater and $numAttributes > 0;
             push(@headerContent, @headerFunctions);
         }
     }
diff --git a/WebCore/css/StyleSheet.idl b/WebCore/css/StyleSheet.idl
new file mode 100644 (file)
index 0000000..1772cf1
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module stylesheets {
+
+    // Introduced in DOM Level 2:
+    interface StyleSheet {
+        readonly attribute DOMString        type;
+                 attribute boolean          disabled;
+        readonly attribute Node             ownerNode;
+        readonly attribute StyleSheet       parentStyleSheet;
+        readonly attribute DOMString        href;
+        readonly attribute DOMString        title;
+        readonly attribute MediaList        media;
+    };
+
+}
diff --git a/WebCore/css/StyleSheetList.idl b/WebCore/css/StyleSheetList.idl
new file mode 100644 (file)
index 0000000..a193c0a
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module stylesheets {
+
+    // Introduced in DOM Level 2:
+    interface StyleSheetList {
+        readonly attribute unsigned long    length;
+        StyleSheet         item(in unsigned long index);
+    };
+
+}
index c45c5626461b86e18fec3918753443680ca8b6b5..59e8d9ce54c6fb56aebf9cac1b0f3fe66b388792 100644 (file)
@@ -1,3 +1,12 @@
+2006-09-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin and Tim H.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10711
+          Auto-generate the Objective-C DOM Stylesheet bindings
+
+        * MigrateHeaders.make:
+
 2006-09-02  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Tim H.
index ed447b9abc1e113e8a28943e26d699a2aab89fd1..3063f2fbfb363b7bacc8147872ba6d6b534356ed 100644 (file)
@@ -117,6 +117,7 @@ all : \
     DOMHTMLTitleElement.h \
     DOMHTMLUListElement.h \
     DOMList.h \
+    DOMMediaList.h \
     DOMNamedNodeMap.h \
     DOMNode.h \
     DOMNodeList.h \
@@ -127,6 +128,8 @@ all : \
     DOMRGBColor.h \
     DOMRange.h \
     DOMRect.h \
+    DOMStyleSheet.h \
+    DOMStyleSheetList.h \
     DOMStylesheets.h \
     DOMText.h \
     DOMTraversal.h \