Reviewed by Tim H.
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Sep 2006 21:13:17 +0000 (21:13 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Sep 2006 21:13:17 +0000 (21:13 +0000)
        Patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10885
        Auto-generate DOMHTMLDocument for the Objective-C bindings

        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/DOMExtensions.h:
        * bindings/objc/DOMHTML.mm:
        (-[DOMHTMLDocument createDocumentFragmentWithText:]):
        * bindings/objc/DOMHTMLDocument.h: Removed.
        * bindings/objc/DOMHTMLDocument.mm: Removed.
        * bindings/objc/PublicDOMInterfaces.h:
        * bindings/scripts/CodeGeneratorObjC.pm:
        * html/HTMLDocument.idl:
        * platform/DeprecatedString.h:
        (WebCore::DeprecatedString::operator NSString*):

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

WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOMExtensions.h
WebCore/bindings/objc/DOMHTML.mm
WebCore/bindings/objc/DOMHTMLDocument.h [deleted file]
WebCore/bindings/objc/DOMHTMLDocument.mm [deleted file]
WebCore/bindings/objc/PublicDOMInterfaces.h
WebCore/bindings/scripts/CodeGeneratorObjC.pm
WebCore/html/HTMLDocument.idl
WebCore/platform/DeprecatedString.h

index 99812e1f4150173bb606b9924f08393698671636..2d5de2ce811b4bac2635240289f549b668c1311a 100644 (file)
@@ -1,3 +1,23 @@
+2006-09-16  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Tim H.
+
+        Patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10885
+        Auto-generate DOMHTMLDocument for the Objective-C bindings
+
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/objc/DOMExtensions.h:
+        * bindings/objc/DOMHTML.mm:
+        (-[DOMHTMLDocument createDocumentFragmentWithText:]):
+        * bindings/objc/DOMHTMLDocument.h: Removed.
+        * bindings/objc/DOMHTMLDocument.mm: Removed.
+        * bindings/objc/PublicDOMInterfaces.h:
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        * html/HTMLDocument.idl:
+        * platform/DeprecatedString.h:
+        (WebCore::DeprecatedString::operator NSString*):
+
 2006-09-16  Rob Buis  <buis@kde.org>
 
         Reviewed by Eric.
index c60fa37fb08ebe5e93fa1f444b2e09d024672c94..10bef077ac031aa1d062de74ba6c15b1bc36a5e4 100644 (file)
@@ -81,6 +81,7 @@ all : \
     DOMHTMLDListElement.h \
     DOMHTMLDirectoryElement.h \
     DOMHTMLDivElement.h \
+    DOMHTMLDocument.h \
     DOMHTMLElement.h \
     DOMHTMLFieldSetElement.h \
     DOMHTMLFontElement.h \
index 5a9ae148f9444de4ff305e062005d0c244d7986e..2b229c0d8e2a76c3c3962e51dc0d7dfc730aa29e 100644 (file)
                85992EBF0AA5069500AC0785 /* DOMHTMLLinkElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85992EB70AA5069500AC0785 /* DOMHTMLLinkElement.mm */; };
                85992EC00AA5069500AC0785 /* DOMHTMLTitleElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85992EB80AA5069500AC0785 /* DOMHTMLTitleElement.h */; settings = {ATTRIBUTES = (); }; };
                85992EC10AA5069500AC0785 /* DOMHTMLTitleElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85992EB90AA5069500AC0785 /* DOMHTMLTitleElement.mm */; };
-               85992FC00AA5DD4000AC0785 /* DOMHTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 85992FBE0AA5DD4000AC0785 /* DOMHTMLDocument.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               85992FC10AA5DD4000AC0785 /* DOMHTMLDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85992FBF0AA5DD4000AC0785 /* DOMHTMLDocument.mm */; };
                859A9C470AA5E3BD00B694B2 /* DOMHTMLBaseElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 859A9C3D0AA5E3BD00B694B2 /* DOMHTMLBaseElement.h */; };
                859A9C480AA5E3BD00B694B2 /* DOMHTMLBaseElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 859A9C3E0AA5E3BD00B694B2 /* DOMHTMLBaseElement.mm */; };
                859A9C490AA5E3BD00B694B2 /* DOMHTMLBodyElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 859A9C3F0AA5E3BD00B694B2 /* DOMHTMLBodyElement.h */; };
                85BA4D2C0AA6889F0088052D /* DOMHTMLMenuElement.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85BA4D050AA688680088052D /* DOMHTMLMenuElement.h */; };
                85BA4D2D0AA6889F0088052D /* DOMHTMLOListElement.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85BA4D070AA688680088052D /* DOMHTMLOListElement.h */; };
                85BA4D2E0AA6889F0088052D /* DOMHTMLUListElement.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85BA4D090AA688680088052D /* DOMHTMLUListElement.h */; };
+               85BCBC130ABBA87D00381160 /* DOMHTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 85BCBC110ABBA87D00381160 /* DOMHTMLDocument.h */; };
+               85BCBC140ABBA87D00381160 /* DOMHTMLDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85BCBC120ABBA87D00381160 /* DOMHTMLDocument.mm */; };
                85C7F3E60AAF5D5E004014DD /* DOMEvent.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85AFA8200AAF528A00E84305 /* DOMEvent.h */; };
                85C7F4470AAF76DC004014DD /* DOMEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 85C7F4450AAF76DC004014DD /* DOMEventTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85C7F4910AAF79DC004014DD /* DOMUIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85C7F48F0AAF79DC004014DD /* DOMUIEvent.h */; };
                85ECBF0C0AA7628900544F0B /* DOMHTMLMapElement.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85ECBEE50AA7626800544F0B /* DOMHTMLMapElement.h */; };
                85ECBF0D0AA7628900544F0B /* DOMHTMLModElement.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85ECBEE70AA7626800544F0B /* DOMHTMLModElement.h */; };
                85ECBF0E0AA7628900544F0B /* DOMHTMLParamElement.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85ECBEE90AA7626900544F0B /* DOMHTMLParamElement.h */; };
+               85F264B20ABBAA580096944B /* DOMHTMLDocument.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85BCBC110ABBA87D00381160 /* DOMHTMLDocument.h */; };
                85F32AEC0AA63B8700FF3184 /* DOMHTMLInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85F32AE40AA63B8700FF3184 /* DOMHTMLInputElement.h */; };
                85F32AED0AA63B8700FF3184 /* DOMHTMLInputElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85F32AE50AA63B8700FF3184 /* DOMHTMLInputElement.mm */; };
                85F32AEE0AA63B8700FF3184 /* DOMHTMLOptGroupElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85F32AE60AA63B8700FF3184 /* DOMHTMLOptGroupElement.h */; };
                        dstPath = Versions/A/PrivateHeaders;
                        dstSubfolderSpec = 1;
                        files = (
+                               85F264B20ABBAA580096944B /* DOMHTMLDocument.h in CopyFiles */,
                                853BF4EC0ABB6EB9008647BB /* DOMNode.h in CopyFiles */,
                                853BF4ED0ABB6EB9008647BB /* DOMNodePrivate.h in CopyFiles */,
                                85E9E0A80AB3A11900069CD0 /* DOMXPathExpression.h in CopyFiles */,
                85992EB70AA5069500AC0785 /* DOMHTMLLinkElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLLinkElement.mm; sourceTree = "<group>"; };
                85992EB80AA5069500AC0785 /* DOMHTMLTitleElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLTitleElement.h; sourceTree = "<group>"; };
                85992EB90AA5069500AC0785 /* DOMHTMLTitleElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLTitleElement.mm; sourceTree = "<group>"; };
-               85992FBE0AA5DD4000AC0785 /* DOMHTMLDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLDocument.h; sourceTree = "<group>"; };
-               85992FBF0AA5DD4000AC0785 /* DOMHTMLDocument.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLDocument.mm; sourceTree = "<group>"; };
                859A9C3D0AA5E3BD00B694B2 /* DOMHTMLBaseElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLBaseElement.h; sourceTree = "<group>"; };
                859A9C3E0AA5E3BD00B694B2 /* DOMHTMLBaseElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLBaseElement.mm; sourceTree = "<group>"; };
                859A9C3F0AA5E3BD00B694B2 /* DOMHTMLBodyElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLBodyElement.h; sourceTree = "<group>"; };
                85BA4D080AA688680088052D /* DOMHTMLOListElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLOListElement.mm; sourceTree = "<group>"; };
                85BA4D090AA688680088052D /* DOMHTMLUListElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLUListElement.h; sourceTree = "<group>"; };
                85BA4D0A0AA688680088052D /* DOMHTMLUListElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLUListElement.mm; sourceTree = "<group>"; };
+               85BCBC110ABBA87D00381160 /* DOMHTMLDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLDocument.h; sourceTree = "<group>"; };
+               85BCBC120ABBA87D00381160 /* DOMHTMLDocument.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLDocument.mm; sourceTree = "<group>"; };
                85C56C5B0AA87AFD00D95755 /* MediaList.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = MediaList.idl; sourceTree = "<group>"; };
                85C56CA10AA89AB400D95755 /* CSSStyleRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSStyleRule.idl; sourceTree = "<group>"; };
                85C56CA20AA89C1000D95755 /* CSSMediaRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSMediaRule.idl; sourceTree = "<group>"; };
                                852B9E840AA79C47002ADA6E /* DOMHTMLAppletElement.mm */,
                                859128F10AB2431A00202265 /* DOMHTMLEmbedElement.h */,
                                859128F20AB2431A00202265 /* DOMHTMLEmbedElement.mm */,
-                               85992FBE0AA5DD4000AC0785 /* DOMHTMLDocument.h */,
-                               85992FBF0AA5DD4000AC0785 /* DOMHTMLDocument.mm */,
                                852B9E850AA79C47002ADA6E /* DOMHTMLOptionElement.h */,
                                852B9E860AA79C47002ADA6E /* DOMHTMLOptionElement.mm */,
                        );
                                85BA4CFE0AA688680088052D /* DOMHTMLDirectoryElement.mm */,
                                85BA4CFF0AA688680088052D /* DOMHTMLDivElement.h */,
                                85BA4D000AA688680088052D /* DOMHTMLDivElement.mm */,
+                               85BCBC110ABBA87D00381160 /* DOMHTMLDocument.h */,
+                               85BCBC120ABBA87D00381160 /* DOMHTMLDocument.mm */,
                                85DF2EEB0AA387CB00AD64C5 /* DOMHTMLElement.h */,
                                85DF2EEC0AA387CB00AD64C5 /* DOMHTMLElement.mm */,
                                85BA4CD70AA6861B0088052D /* DOMHTMLFieldSetElement.h */,
                                85992EBC0AA5069500AC0785 /* DOMHTMLHtmlElement.h in Headers */,
                                85992EBE0AA5069500AC0785 /* DOMHTMLLinkElement.h in Headers */,
                                85992EC00AA5069500AC0785 /* DOMHTMLTitleElement.h in Headers */,
-                               85992FC00AA5DD4000AC0785 /* DOMHTMLDocument.h in Headers */,
                                859A9C470AA5E3BD00B694B2 /* DOMHTMLBaseElement.h in Headers */,
                                859A9C490AA5E3BD00B694B2 /* DOMHTMLBodyElement.h in Headers */,
                                859A9C4B0AA5E3BD00B694B2 /* DOMHTMLIsIndexElement.h in Headers */,
                                B20111080AB7740500DB0E68 /* JSSVGAElement.h in Headers */,
                                853BF4DB0ABB6B55008647BB /* DOMNode.h in Headers */,
                                853BF4EB0ABB6E97008647BB /* DOMNodePrivate.h in Headers */,
+                               85BCBC130ABBA87D00381160 /* DOMHTMLDocument.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 */,
                                85992EBD0AA5069500AC0785 /* DOMHTMLHtmlElement.mm in Sources */,
                                85992EBF0AA5069500AC0785 /* DOMHTMLLinkElement.mm in Sources */,
                                85992EC10AA5069500AC0785 /* DOMHTMLTitleElement.mm in Sources */,
-                               85992FC10AA5DD4000AC0785 /* DOMHTMLDocument.mm in Sources */,
                                859A9C480AA5E3BD00B694B2 /* DOMHTMLBaseElement.mm in Sources */,
                                859A9C4A0AA5E3BD00B694B2 /* DOMHTMLBodyElement.mm in Sources */,
                                859A9C4C0AA5E3BD00B694B2 /* DOMHTMLIsIndexElement.mm in Sources */,
                                B222F69C0AB771B80022EFAD /* JSSVGElement.cpp in Sources */,
                                B20111070AB7740500DB0E68 /* JSSVGAElement.cpp in Sources */,
                                853BF4DC0ABB6B55008647BB /* DOMNode.mm in Sources */,
+                               85BCBC140ABBA87D00381160 /* DOMHTMLDocument.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 0f9853e6891b7d046004c5b9cbf4a39aff547f97..272fec97a4852ca54919d95534feaaa96659fc21 100644 (file)
 - (NSImage *)image;
 @end
 
+@interface DOMHTMLDocument (DOMHTMLDocumentExtensions)
+- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL;
+- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text;
+@end
+
 @interface DOMHTMLInputElement (DOMHTMLInputElementExtensions)
 - (NSURL *)absoluteImageURL;
 @end
index 27533422f5390acb7a015f745d7a8845b8284b4b..ff0d6bab5916fde497d850b0dec7c203a17b9a94 100644 (file)
@@ -59,6 +59,21 @@ using namespace HTMLNames;
 //------------------------------------------------------------------------------------------
 // DOMHTMLDocument
 
+@implementation DOMHTMLDocument (DOMHTMLDocumentExtensions)
+
+- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL
+{
+    return [DOMDocumentFragment _documentFragmentWith:createFragmentFromMarkup([self _document], markupString, [baseURL absoluteString]).get()];
+}
+
+- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text
+{
+    // FIXME: Since this is not a contextual fragment, it won't handle whitespace properly.
+    return [DOMDocumentFragment _documentFragmentWith:createFragmentFromText([self _document]->createRange().get(), text).get()];
+}
+
+@end
+
 @implementation DOMHTMLDocument (WebPrivate)
 
 - (DOMDocumentFragment *)_createDocumentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString
diff --git a/WebCore/bindings/objc/DOMHTMLDocument.h b/WebCore/bindings/objc/DOMHTMLDocument.h
deleted file mode 100644 (file)
index 596fd5f..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import <WebCore/DOMDocument.h>
-
-@class DOMElement;
-@class DOMHTMLCollection;
-@class DOMHTMLElement;
-@class DOMNodeList;
-@class DOMDocumentFragment;
-
-@interface DOMHTMLDocument : DOMDocument
-- (NSString *)title;
-- (void)setTitle:(NSString *)title;
-- (NSString *)referrer;
-- (NSString *)domain;
-- (NSString *)URL;
-- (DOMHTMLElement *)body;
-- (void)setBody:(DOMHTMLElement *)body;
-- (DOMHTMLCollection *)images;
-- (DOMHTMLCollection *)applets;
-- (DOMHTMLCollection *)links;
-- (DOMHTMLCollection *)forms;
-- (DOMHTMLCollection *)anchors;
-- (NSString *)cookie;
-- (void)setCookie:(NSString *)cookie;
-- (void)open;
-- (void)close;
-- (void)write:(NSString *)text;
-- (void)writeln:(NSString *)text;
-- (DOMElement *)getElementById:(NSString *)elementId;
-- (DOMNodeList *)getElementsByName:(NSString *)elementName;
-@end
-
-@interface DOMHTMLDocument (DOMHTMLDocumentExtensions)
-- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL;
-- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text;
-@end
diff --git a/WebCore/bindings/objc/DOMHTMLDocument.mm b/WebCore/bindings/objc/DOMHTMLDocument.mm
deleted file mode 100644 (file)
index c55148a..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import "config.h"
-#import "DOMHTMLDocument.h"
-
-#import "DOMInternal.h"
-#import "HTMLDocument.h" // implementation class
-
-#import "DOMDocumentFragment.h"
-#import "DOMHTMLCollection.h"
-#import "DOMHTMLElement.h"
-#import "DOMNodeList.h"
-#import "DocumentFragment.h"
-#import "HTMLCollection.h"
-#import "NameNodeList.h"
-#import "Range.h"
-#import "markup.h"
-
-@implementation DOMHTMLDocument
-
-#define IMPL static_cast<WebCore::HTMLDocument*>(reinterpret_cast<WebCore::Node*>(_internal))
-
-- (NSString *)title
-{
-    return IMPL->title();
-}
-
-- (void)setTitle:(NSString *)title
-{
-    IMPL->setTitle(title);
-}
-
-- (NSString *)referrer
-{
-     return IMPL->referrer();
-}
-
-- (NSString *)domain
-{
-     return IMPL->domain();
-}
-
-- (NSString *)URL
-{
-    return IMPL->URL().getNSString();
-}
-
-- (DOMHTMLElement *)body
-{
-    return [DOMHTMLElement _HTMLElementWith:IMPL->body()];
-}
-
-- (void)setBody:(DOMHTMLElement *)body
-{
-    WebCore::ExceptionCode ec = 0;
-    IMPL->setBody([body _HTMLElement], ec);
-    raiseOnDOMError(ec);
-}
-
-- (DOMHTMLCollection *)images
-{
-    return [DOMHTMLCollection _HTMLCollectionWith:IMPL->images().get()];
-}
-
-- (DOMHTMLCollection *)applets
-{
-    return [DOMHTMLCollection _HTMLCollectionWith:IMPL->applets().get()];
-}
-
-- (DOMHTMLCollection *)links
-{
-    return [DOMHTMLCollection _HTMLCollectionWith:IMPL->links().get()];
-}
-
-- (DOMHTMLCollection *)forms
-{
-    return [DOMHTMLCollection _HTMLCollectionWith:IMPL->forms().get()];
-}
-
-- (DOMHTMLCollection *)anchors
-{
-    return [DOMHTMLCollection _HTMLCollectionWith:IMPL->anchors().get()];
-}
-
-- (NSString *)cookie
-{
-    return IMPL->cookie();
-}
-
-- (void)setCookie:(NSString *)cookie
-{
-    IMPL->setCookie(cookie);
-}
-
-- (void)open
-{
-    IMPL->open();
-}
-
-- (void)close
-{
-    IMPL->close();
-}
-
-- (void)write:(NSString *)text
-{
-    IMPL->write(text);
-}
-
-- (void)writeln:(NSString *)text
-{
-    IMPL->writeln(text);
-}
-
-- (DOMElement *)getElementById:(NSString *)elementId
-{
-    return [DOMElement _elementWith:IMPL->getElementById(elementId)];
-}
-
-- (DOMNodeList *)getElementsByName:(NSString *)elementName
-{
-    return [DOMNodeList _nodeListWith:IMPL->getElementsByName(elementName).get()];
-}
-
-@end
-
-@implementation DOMHTMLDocument (DOMHTMLDocumentExtensions)
-
-- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL
-{
-    return [DOMDocumentFragment _documentFragmentWith:createFragmentFromMarkup([self _document], markupString, [baseURL absoluteString]).get()];
-}
-
-- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text
-{
-    // FIXME: Since this is not a contextual fragment, it won't handle whitespace properly.
-    return [DOMDocumentFragment _documentFragmentWith:createFragmentFromText([self _document]->createRange().get(), text).get()];
-}
-
-@end
-
-
-@implementation DOMHTMLDocument (WebCoreInternal)
-
-- (WebCore::HTMLDocument *)_HTMLDocument
-{
-    return IMPL;
-}
-
-+ (DOMHTMLDocument *)_HTMLDocumentWith:(WebCore::HTMLDocument *)impl;
-{
-    return static_cast<DOMHTMLDocument *>([DOMNode _nodeWith:impl]);
-}
-
-@end
index dcdd83d6822573aace227921f6cb7b802150e58f..07339a516e812da283db0d920ffe7849206fdc71 100644 (file)
 @property NSString *align;
 @end
 
+@interface DOMHTMLDocument : DOMDocument
+@property NSString *title;
+@property(readonly) NSString *referrer;
+@property(readonly) NSString *domain;
+@property(readonly) NSString *URL;
+@property DOMHTMLElement *body;
+@property(readonly) DOMHTMLCollection *images;
+@property(readonly) DOMHTMLCollection *applets;
+@property(readonly) DOMHTMLCollection *links;
+@property(readonly) DOMHTMLCollection *forms;
+@property(readonly) DOMHTMLCollection *anchors;
+@property NSString *cookie;
+- (void)open;
+- (void)close;
+- (void)write:(NSString *)text;
+- (void)writeln:(NSString *)text;
+- (DOMElement *)getElementById:(NSString *)elementId;
+- (DOMNodeList *)getElementsByName:(NSString *)elementName;
+@end
+
 @interface DOMHTMLElement : DOMElement
 @property NSString *title;
 @property NSString *idName;
index 52bf3ca89debf0d4242c968853d38107be5ac4c2..e537d6bff33578458c73e6e89c822ee346dcb753 100644 (file)
@@ -413,6 +413,10 @@ sub AddIncludesForType
     # and NamedAttrMap.h
     $implIncludes{"NamedAttrMap.h"} = 1 if $type eq "NamedNodeMap";
 
+    # FIXME: for some reason it won't compile without both NodeList.h
+    # and NameNodeList.h
+    $implIncludes{"NameNodeList.h"} = 1 if $type eq "NodeList";
+
     # Default, include the same named file (the implementation) and the same name prefixed with "DOM". 
     $implIncludes{"$type.h"} = 1;
     $implIncludes{"DOM$type.h"} = 1;
index 6ff3b27d1453ed5f8e51b7c0bf4c99ed7e7c9b01..a681db880fe4867feb806faf1900d422fa92cce7 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (C) 2006 Apple Computer, Inc.
  * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- * 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
index 3211070f2fe3cd74ad83b1512d928ebd4335e455..a7bf32b5d3f4a22e1d5e90691db9af6513c04b95 100644 (file)
@@ -391,6 +391,11 @@ public:
     CFStringRef getCFString() const;
     NSString *getNSString() const;
     void setBufferFromCFString(CFStringRef);
+
+#ifdef __OBJC__
+    operator NSString*() const { return getNSString(); }
+#endif
+
 #endif
 
 private: