summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/objc
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
commit1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch)
tree4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/bindings/objc
parent9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff)
downloadexternal_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/bindings/objc')
-rw-r--r--WebCore/bindings/objc/DOM.mm287
-rw-r--r--WebCore/bindings/objc/DOMAbstractView.mm110
-rw-r--r--WebCore/bindings/objc/DOMAbstractViewFrame.h33
-rw-r--r--WebCore/bindings/objc/DOMCSS.h4
-rw-r--r--WebCore/bindings/objc/DOMCSS.mm9
-rw-r--r--WebCore/bindings/objc/DOMCustomXPathNSResolver.h6
-rw-r--r--WebCore/bindings/objc/DOMEventException.h6
-rw-r--r--WebCore/bindings/objc/DOMEvents.h5
-rw-r--r--WebCore/bindings/objc/DOMEvents.mm41
-rw-r--r--WebCore/bindings/objc/DOMException.h9
-rw-r--r--WebCore/bindings/objc/DOMExtensions.h10
-rw-r--r--WebCore/bindings/objc/DOMHTML.mm5
-rw-r--r--WebCore/bindings/objc/DOMImplementationFront.cpp6
-rw-r--r--WebCore/bindings/objc/DOMImplementationFront.h4
-rw-r--r--WebCore/bindings/objc/DOMInternal.h27
-rw-r--r--WebCore/bindings/objc/DOMInternal.mm9
-rw-r--r--WebCore/bindings/objc/DOMObject.h4
-rw-r--r--WebCore/bindings/objc/DOMPrivate.h6
-rw-r--r--WebCore/bindings/objc/DOMRGBColor.mm11
-rw-r--r--WebCore/bindings/objc/DOMRangeException.h6
-rw-r--r--WebCore/bindings/objc/DOMSVG.h1
-rw-r--r--WebCore/bindings/objc/DOMSVGException.h6
-rw-r--r--WebCore/bindings/objc/DOMTraversal.h15
-rw-r--r--WebCore/bindings/objc/DOMUtility.mm34
-rw-r--r--WebCore/bindings/objc/DOMXPathException.h6
-rw-r--r--WebCore/bindings/objc/ExceptionHandlers.h2
-rw-r--r--WebCore/bindings/objc/ObjCEventListener.h55
-rw-r--r--WebCore/bindings/objc/ObjCEventListener.mm82
-rw-r--r--WebCore/bindings/objc/ObjCNodeFilterCondition.h60
-rw-r--r--WebCore/bindings/objc/ObjCNodeFilterCondition.mm47
-rw-r--r--WebCore/bindings/objc/PublicDOMInterfaces.h401
-rw-r--r--WebCore/bindings/objc/WebScriptObject.h32
-rw-r--r--WebCore/bindings/objc/WebScriptObject.mm166
-rw-r--r--WebCore/bindings/objc/WebScriptObjectPrivate.h71
34 files changed, 939 insertions, 637 deletions
diff --git a/WebCore/bindings/objc/DOM.mm b/WebCore/bindings/objc/DOM.mm
index 93deb23..485d011 100644
--- a/WebCore/bindings/objc/DOM.mm
+++ b/WebCore/bindings/objc/DOM.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2006 James G. Speth (speth@end.com)
* Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
*
@@ -28,73 +28,30 @@
#import "config.h"
#import "DOM.h"
-#import "CDATASection.h"
-#import "CSSHelper.h"
-#import "CSSStyleSheet.h"
-#import "Comment.h"
#import "DOMHTMLCanvasElement.h"
#import "DOMInternal.h"
-#import "DOMPrivate.h"
-#import "Document.h"
-#import "DocumentFragment.h"
-#import "DocumentType.h"
-#import "EntityReference.h"
-#import "Event.h"
-#import "EventListener.h"
-#import "EventTarget.h"
#import "ExceptionHandlers.h"
-#import "FoundationExtras.h"
-#import "Frame.h"
-#import "FrameView.h"
-#import "HTMLDocument.h"
#import "HTMLNames.h"
#import "HTMLPlugInElement.h"
-#import "Image.h"
-#import "IntRect.h"
-#import "NodeFilter.h"
-#import "NodeFilterCondition.h"
#import "NodeIterator.h"
-#import "NodeList.h"
-#import "ProcessingInstruction.h"
-#import "QualifiedName.h"
#import "Range.h"
#import "RenderImage.h"
#import "RenderView.h"
+#import "ScriptController.h"
#import "SimpleFontData.h"
-#import "Text.h"
#import "TreeWalker.h"
-#import "WebScriptObjectPrivate.h"
-#import <objc/objc-class.h>
+
#import <wtf/HashMap.h>
#if ENABLE(SVG)
-#import "SVGDocument.h"
#import "SVGElement.h"
+#import "SVGElementInstance.h"
#import "SVGNames.h"
#import "DOMSVG.h"
#endif
-namespace WebCore {
-
-class ObjCEventListener : public EventListener {
-public:
- static ObjCEventListener* find(id <DOMEventListener>);
- static ObjCEventListener* create(id <DOMEventListener>);
-
-private:
- ObjCEventListener(id <DOMEventListener>);
- virtual ~ObjCEventListener();
-
- virtual void handleEvent(Event*, bool isWindowEvent);
-
- id <DOMEventListener> m_listener;
-};
-
-typedef HashMap<id, ObjCEventListener*> ListenerMap;
-static ListenerMap* listenerMap;
-
-} // namespace WebCore
-
+using namespace JSC;
+using namespace WebCore;
//------------------------------------------------------------------------------------------
// DOMNode
@@ -188,10 +145,12 @@ static void createElementClassMap()
#if ENABLE(SVG)
addElementClass(SVGNames::aTag, [DOMSVGAElement class]);
+ addElementClass(SVGNames::altGlyphTag, [DOMSVGAltGlyphElement class]);
#if ENABLE(SVG_ANIMATION)
addElementClass(SVGNames::animateTag, [DOMSVGAnimateElement class]);
addElementClass(SVGNames::animateColorTag, [DOMSVGAnimateColorElement class]);
addElementClass(SVGNames::animateTransformTag, [DOMSVGAnimateTransformElement class]);
+ addElementClass(SVGNames::setTag, [DOMSVGSetElement class]);
#endif
addElementClass(SVGNames::circleTag, [DOMSVGCircleElement class]);
addElementClass(SVGNames::clipPathTag, [DOMSVGClipPathElement class]);
@@ -253,7 +212,6 @@ static void createElementClassMap()
addElementClass(SVGNames::radialGradientTag, [DOMSVGRadialGradientElement class]);
addElementClass(SVGNames::rectTag, [DOMSVGRectElement class]);
addElementClass(SVGNames::scriptTag, [DOMSVGScriptElement class]);
- addElementClass(SVGNames::setTag, [DOMSVGSetElement class]);
addElementClass(SVGNames::stopTag, [DOMSVGStopElement class]);
addElementClass(SVGNames::styleTag, [DOMSVGStyleElement class]);
addElementClass(SVGNames::svgTag, [DOMSVGSVGElement class]);
@@ -400,7 +358,7 @@ static NSArray *kit(const Vector<IntRect>& rects)
{
if (!eventTarget)
return nil;
-
+
// We don't have an ObjC binding for XMLHttpRequest
return [DOMNode _wrapNode:eventTarget->toNode()];
}
@@ -410,11 +368,11 @@ static NSArray *kit(const Vector<IntRect>& rects)
return reinterpret_cast<WebCore::Node*>(_internal);
}
-- (KJS::Bindings::RootObject*)_rootObject
+- (JSC::Bindings::RootObject*)_rootObject
{
if (WebCore::Node *n = [self _node]) {
if (WebCore::Frame* frame = n->document()->frame())
- return frame->bindingRootObject();
+ return frame->script()->bindingRootObject();
}
return 0;
}
@@ -450,67 +408,75 @@ static NSArray *kit(const Vector<IntRect>& rects)
@end
-@implementation DOMRange (DOMRangeExtensions)
+#if ENABLE(SVG)
+@implementation DOMSVGElementInstance (WebCoreInternal)
-- (NSRect)boundingBox
+- (id)_initWithSVGElementInstance:(WebCore::SVGElementInstance *)impl
{
- [self _range]->ownerDocument()->updateLayoutIgnorePendingStylesheets();
- return [self _range]->boundingBox();
+ ASSERT(impl);
+
+ [super _init];
+ _internal = reinterpret_cast<DOMObjectInternal*>(impl);
+ impl->ref();
+ WebCore::addDOMWrapper(self, impl);
+ return self;
}
-- (NSArray *)lineBoxRects
++ (DOMSVGElementInstance *)_wrapSVGElementInstance:(WebCore::SVGElementInstance *)impl
{
- Vector<WebCore::IntRect> rects;
- [self _range]->ownerDocument()->updateLayoutIgnorePendingStylesheets();
- [self _range]->addLineBoxRects(rects);
- return kit(rects);
+ if (!impl)
+ return nil;
+
+ id cachedInstance;
+ cachedInstance = WebCore::getDOMWrapper(impl);
+ if (cachedInstance)
+ return [[cachedInstance retain] autorelease];
+
+ return [[[self alloc] _initWithSVGElementInstance:impl] autorelease];
}
-@end
++ (id <DOMEventTarget>)_wrapEventTarget:(WebCore::EventTarget *)eventTarget
+{
+ if (!eventTarget)
+ return nil;
-// FIXME: this should be auto-generated
-@implementation DOMNode (DOMEventTarget)
+ return [DOMSVGElementInstance _wrapSVGElementInstance:eventTarget->toSVGElementInstance()];
+}
-- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
+- (WebCore::SVGElementInstance *)_SVGElementInstance
{
- if (![self _node]->isEventTargetNode())
- WebCore::raiseDOMException(DOM_NOT_SUPPORTED_ERR);
-
- WebCore::EventListener *wrapper = WebCore::ObjCEventListener::create(listener);
- WebCore::EventTargetNodeCast([self _node])->addEventListener(type, wrapper, useCapture);
- wrapper->deref();
+ return reinterpret_cast<WebCore::SVGElementInstance*>(_internal);
}
-- (void)addEventListener:(NSString *)type :(id <DOMEventListener>)listener :(BOOL)useCapture
+@end
+#endif
+
+@implementation DOMNode (DOMNodeExtensionsPendingPublic)
+
+- (NSImage *)renderedImage
{
- // FIXME: this method can be removed once Mail changes to use the new method <rdar://problem/4746649>
- [self addEventListener:type listener:listener useCapture:useCapture];
+ if (WebCore::Node *node = [self _node])
+ if (WebCore::Frame* frame = node->document()->frame())
+ return frame->nodeImage(node);
+ return nil;
}
-- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
-{
- if (![self _node]->isEventTargetNode())
- WebCore::raiseDOMException(DOM_NOT_SUPPORTED_ERR);
+@end
- if (WebCore::EventListener *wrapper = WebCore::ObjCEventListener::find(listener))
- WebCore::EventTargetNodeCast([self _node])->removeEventListener(type, wrapper, useCapture);
-}
+@implementation DOMRange (DOMRangeExtensions)
-- (void)removeEventListener:(NSString *)type :(id <DOMEventListener>)listener :(BOOL)useCapture
+- (NSRect)boundingBox
{
- // FIXME: this method can be removed once Mail changes to use the new method <rdar://problem/4746649>
- [self removeEventListener:type listener:listener useCapture:useCapture];
+ [self _range]->ownerDocument()->updateLayoutIgnorePendingStylesheets();
+ return [self _range]->boundingBox();
}
-- (BOOL)dispatchEvent:(DOMEvent *)event
+- (NSArray *)lineBoxRects
{
- if (![self _node]->isEventTargetNode())
- WebCore::raiseDOMException(DOM_NOT_SUPPORTED_ERR);
-
- WebCore::ExceptionCode ec = 0;
- BOOL result = WebCore::EventTargetNodeCast([self _node])->dispatchEvent([event _event], ec);
- WebCore::raiseOnDOMError(ec);
- return result;
+ Vector<WebCore::IntRect> rects;
+ [self _range]->ownerDocument()->updateLayoutIgnorePendingStylesheets();
+ [self _range]->addLineBoxRects(rects);
+ return kit(rects);
}
@end
@@ -576,13 +542,13 @@ static NSArray *kit(const Vector<IntRect>& rects)
ASSERT(name);
WebCore::Element* element = [self _element];
ASSERT(element);
- return WebCore::KURL(element->document()->completeURL(parseURL(element->getAttribute(name)).deprecatedString())).getNSURL();
+ return element->document()->completeURL(parseURL(element->getAttribute(name)));
}
// FIXME: this should be implemented in the implementation
- (void *)_NPObject
{
-#if USE(NPOBJECT)
+#if ENABLE(NETSCAPE_PLUGIN_API)
WebCore::Element* element = [self _element];
if (element->hasTagName(WebCore::HTMLNames::appletTag) || element->hasTagName(WebCore::HTMLNames::embedTag) || element->hasTagName(WebCore::HTMLNames::objectTag))
return static_cast<WebCore::HTMLPlugInElement*>(element)->getNPObject();
@@ -647,12 +613,12 @@ static NSArray *kit(const Vector<IntRect>& rects)
{
if (!impl)
return nil;
-
+
id cachedInstance;
cachedInstance = WebCore::getDOMWrapper(impl);
if (cachedInstance)
return [[cachedInstance retain] autorelease];
-
+
return [[[self alloc] _initWithNodeFilter:impl] autorelease];
}
@@ -681,130 +647,3 @@ static NSArray *kit(const Vector<IntRect>& rects)
}
@end
-
-
-//------------------------------------------------------------------------------------------
-// ObjCNodeFilterCondition
-
-class ObjCNodeFilterCondition : public WebCore::NodeFilterCondition {
-public:
- ObjCNodeFilterCondition(id <DOMNodeFilter>);
- virtual ~ObjCNodeFilterCondition();
- virtual short acceptNode(WebCore::Node*) const;
-
-private:
- ObjCNodeFilterCondition(const ObjCNodeFilterCondition&);
- ObjCNodeFilterCondition &operator=(const ObjCNodeFilterCondition&);
-
- id <DOMNodeFilter> m_filter;
-};
-
-ObjCNodeFilterCondition::ObjCNodeFilterCondition(id <DOMNodeFilter> filter)
- : m_filter(filter)
-{
- ASSERT(m_filter);
- HardRetain(m_filter);
-}
-
-ObjCNodeFilterCondition::~ObjCNodeFilterCondition()
-{
- HardRelease(m_filter);
-}
-
-short ObjCNodeFilterCondition::acceptNode(WebCore::Node* node) const
-{
- if (!node)
- return WebCore::NodeFilter::FILTER_REJECT;
- return [m_filter acceptNode:[DOMNode _wrapNode:node]];
-}
-
-
-//------------------------------------------------------------------------------------------
-// DOMDocument (DOMDocumentTraversal)
-
-// FIXME: this should be auto-generated in DOMDocument.mm
-@implementation DOMDocument (DOMDocumentTraversal)
-
-- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences
-{
- WebCore::NodeFilter* cppFilter = 0;
- if (filter)
- cppFilter = new WebCore::NodeFilter(new ObjCNodeFilterCondition(filter));
- WebCore::ExceptionCode ec = 0;
- RefPtr<WebCore::NodeIterator> impl = [self _document]->createNodeIterator([root _node], whatToShow, cppFilter, expandEntityReferences, ec);
- WebCore::raiseOnDOMError(ec);
- return [DOMNodeIterator _wrapNodeIterator:impl.get() filter:filter];
-}
-
-- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences
-{
- WebCore::NodeFilter* cppFilter = 0;
- if (filter)
- cppFilter = new WebCore::NodeFilter(new ObjCNodeFilterCondition(filter));
- WebCore::ExceptionCode ec = 0;
- RefPtr<WebCore::TreeWalker> impl = [self _document]->createTreeWalker([root _node], whatToShow, cppFilter, expandEntityReferences, ec);
- WebCore::raiseOnDOMError(ec);
- return [DOMTreeWalker _wrapTreeWalker:impl.get() filter:filter];
-}
-
-@end
-
-@implementation DOMDocument (DOMDocumentTraversalDeprecated)
-
-- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences
-{
- return [self createNodeIterator:root whatToShow:whatToShow filter:filter expandEntityReferences:expandEntityReferences];
-}
-
-- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences
-{
- return [self createTreeWalker:root whatToShow:whatToShow filter:filter expandEntityReferences:expandEntityReferences];
-}
-
-@end
-
-
-//------------------------------------------------------------------------------------------
-// ObjCEventListener
-
-namespace WebCore {
-
-ObjCEventListener* ObjCEventListener::find(id <DOMEventListener> listener)
-{
- if (ListenerMap* map = listenerMap)
- return map->get(listener);
- return 0;
-}
-
-ObjCEventListener *ObjCEventListener::create(id <DOMEventListener> listener)
-{
- ObjCEventListener* wrapper = find(listener);
- if (!wrapper)
- wrapper = new ObjCEventListener(listener);
- wrapper->ref();
- return wrapper;
-}
-
-ObjCEventListener::ObjCEventListener(id <DOMEventListener> listener)
- : m_listener([listener retain])
-{
- ListenerMap* map = listenerMap;
- if (!map) {
- map = new ListenerMap;
- listenerMap = map;
- }
- map->set(listener, this);
-}
-
-ObjCEventListener::~ObjCEventListener()
-{
- listenerMap->remove(m_listener);
- [m_listener release];
-}
-
-void ObjCEventListener::handleEvent(Event* event, bool)
-{
- [m_listener handleEvent:[DOMEvent _wrapEvent:event]];
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/objc/DOMAbstractView.mm b/WebCore/bindings/objc/DOMAbstractView.mm
new file mode 100644
index 0000000..c751903
--- /dev/null
+++ b/WebCore/bindings/objc/DOMAbstractView.mm
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "DOMAbstractView.h"
+
+#import "DOMDocument.h"
+#import "DOMInternal.h"
+#import "DOMWindow.h"
+#import "Document.h"
+#import "ExceptionHandlers.h"
+#import "Frame.h"
+#import "ThreadCheck.h"
+#import <wtf/GetPtr.h>
+
+#define IMPL reinterpret_cast<WebCore::Frame*>(_internal)
+
+@implementation DOMAbstractView
+
+- (void)dealloc
+{
+ { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheck(); }
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ [super finalize];
+}
+
+- (DOMDocument *)document
+{
+ if (!_internal)
+ return nil;
+ return [DOMDocument _wrapDocument:WTF::getPtr(IMPL->domWindow()->document())];
+}
+
+@end
+
+@implementation DOMAbstractView (Frame)
+
+- (void)_disconnectFrame
+{
+ ASSERT(_internal);
+ WebCore::removeDOMWrapper(_internal);
+ _internal = 0;
+}
+
+@end
+
+@implementation DOMAbstractView (WebCoreInternal)
+
+- (WebCore::DOMWindow *)_abstractView
+{
+ if (!_internal)
+ return nil;
+ return IMPL->domWindow();
+}
+
+- (id)_initWithFrame:(WebCore::Frame *)impl
+{
+ { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheck(); };
+ [super _init];
+ _internal = reinterpret_cast<DOMObjectInternal*>(impl);
+ WebCore::addDOMWrapper(self, impl);
+ return self;
+}
+
++ (DOMAbstractView *)_wrapAbstractView:(WebCore::DOMWindow *)impl
+{
+ { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheck(); };
+
+ if (!impl)
+ return nil;
+ WebCore::Frame* frame = impl->frame();
+ if (!frame)
+ return nil;
+ id cachedInstance;
+ cachedInstance = WebCore::getDOMWrapper(frame);
+ if (cachedInstance)
+ return [[cachedInstance retain] autorelease];
+ return [[[self alloc] _initWithFrame:frame] autorelease];
+}
+
+@end
diff --git a/WebCore/bindings/objc/DOMAbstractViewFrame.h b/WebCore/bindings/objc/DOMAbstractViewFrame.h
new file mode 100644
index 0000000..386a912
--- /dev/null
+++ b/WebCore/bindings/objc/DOMAbstractViewFrame.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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/DOMAbstractView.h>
+
+@interface DOMAbstractView (Frame)
+- (void)_disconnectFrame;
+@end
diff --git a/WebCore/bindings/objc/DOMCSS.h b/WebCore/bindings/objc/DOMCSS.h
index 7bae9ed..daaa8a0 100644
--- a/WebCore/bindings/objc/DOMCSS.h
+++ b/WebCore/bindings/objc/DOMCSS.h
@@ -48,6 +48,8 @@
#import <WebCore/DOMRGBColor.h>
#import <WebCore/DOMRect.h>
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_1_3
+
@interface DOMCSSStyleDeclaration (DOMCSS2Properties)
- (NSString *)azimuth;
- (void)setAzimuth:(NSString *)azimuth;
@@ -294,3 +296,5 @@
- (NSString *)zIndex;
- (void)setZIndex:(NSString *)zIndex;
@end
+
+#endif
diff --git a/WebCore/bindings/objc/DOMCSS.mm b/WebCore/bindings/objc/DOMCSS.mm
index 83ba748..4e9cd0c 100644
--- a/WebCore/bindings/objc/DOMCSS.mm
+++ b/WebCore/bindings/objc/DOMCSS.mm
@@ -141,6 +141,15 @@
case DOM_PAGE_RULE:
wrapperClass = [DOMCSSPageRule class];
break;
+ case DOM_VARIABLES_RULE:
+ wrapperClass = [DOMCSSVariablesRule class];
+ break;
+ case DOM_WEBKIT_KEYFRAMES_RULE:
+ wrapperClass = [DOMWebKitCSSKeyframesRule class];
+ break;
+ case DOM_WEBKIT_KEYFRAME_RULE:
+ wrapperClass = [DOMWebKitCSSKeyframeRule class];
+ break;
}
return [[[wrapperClass alloc] _initWithCSSRule:impl] autorelease];
}
diff --git a/WebCore/bindings/objc/DOMCustomXPathNSResolver.h b/WebCore/bindings/objc/DOMCustomXPathNSResolver.h
index 47cd939..2609e90 100644
--- a/WebCore/bindings/objc/DOMCustomXPathNSResolver.h
+++ b/WebCore/bindings/objc/DOMCustomXPathNSResolver.h
@@ -31,6 +31,7 @@
#include "XPathNSResolver.h"
#include "DOMXPathNSResolver.h"
+#include <wtf/PassRefPtr.h>
namespace WebCore {
@@ -38,13 +39,14 @@ namespace WebCore {
class DOMCustomXPathNSResolver : public XPathNSResolver {
public:
- DOMCustomXPathNSResolver(id <DOMXPathNSResolver>);
+ static PassRefPtr<DOMCustomXPathNSResolver> create(id <DOMXPathNSResolver> customResolver) { return adoptRef(new DOMCustomXPathNSResolver(customResolver)); }
virtual ~DOMCustomXPathNSResolver();
virtual String lookupNamespaceURI(const String& prefix);
private:
- id <DOMXPathNSResolver> m_customResolver; // DOMCustomXPathNSResolvers are always temporary, thus no need to GC protect the object.
+ DOMCustomXPathNSResolver(id <DOMXPathNSResolver>);
+ id <DOMXPathNSResolver> m_customResolver; // DOMCustomXPathNSResolvers are always temporary, thus no need to GC protect the object.
};
} // namespace WebCore
diff --git a/WebCore/bindings/objc/DOMEventException.h b/WebCore/bindings/objc/DOMEventException.h
index 4e805ad..a485955 100644
--- a/WebCore/bindings/objc/DOMEventException.h
+++ b/WebCore/bindings/objc/DOMEventException.h
@@ -24,6 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import <JavaScriptCore/WebKitAvailability.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_1_3
+
@class NSString;
extern NSString * const DOMEventException;
@@ -31,3 +35,5 @@ extern NSString * const DOMEventException;
enum DOMEventExceptionCode {
DOM_UNSPECIFIED_EVENT_TYPE_ERR = 0
};
+
+#endif
diff --git a/WebCore/bindings/objc/DOMEvents.h b/WebCore/bindings/objc/DOMEvents.h
index d7248a5..ba3bd3e 100644
--- a/WebCore/bindings/objc/DOMEvents.h
+++ b/WebCore/bindings/objc/DOMEvents.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2008 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
@@ -39,6 +39,3 @@
#import <WebCore/DOMOverflowEvent.h>
#import <WebCore/DOMUIEvent.h>
#import <WebCore/DOMWheelEvent.h>
-
-@interface DOMNode (DOMEventTarget) <DOMEventTarget>
-@end
diff --git a/WebCore/bindings/objc/DOMEvents.mm b/WebCore/bindings/objc/DOMEvents.mm
index 9901049..6f7f72d 100644
--- a/WebCore/bindings/objc/DOMEvents.mm
+++ b/WebCore/bindings/objc/DOMEvents.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2004, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2006 Jonas Witt <jonas.witt@gmail.com>
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
@@ -29,12 +29,16 @@
#import "DOMEvents.h"
#import "DOMInternal.h"
+#import "DOMMessageEvent.h"
#import "DOMPrivate.h"
+#import "DOMProgressEvent.h"
#import "Event.h"
#import "KeyboardEvent.h"
+#import "MessageEvent.h"
#import "MouseEvent.h"
#import "MutationEvent.h"
#import "OverflowEvent.h"
+#import "ProgressEvent.h"
#import "UIEvent.h"
#if ENABLE(SVG)
@@ -72,26 +76,31 @@
cachedInstance = WebCore::getDOMWrapper(impl);
if (cachedInstance)
return [[cachedInstance retain] autorelease];
-
+
Class wrapperClass = nil;
- if (impl->isWheelEvent())
- wrapperClass = [DOMWheelEvent class];
- else if (impl->isMouseEvent())
- wrapperClass = [DOMMouseEvent class];
- else if (impl->isMutationEvent())
- wrapperClass = [DOMMutationEvent class];
- else if (impl->isKeyboardEvent())
- wrapperClass = [DOMKeyboardEvent class];
- else if (impl->isTextEvent())
- wrapperClass = [DOMTextEvent class];
+ if (impl->isUIEvent()) {
+ if (impl->isKeyboardEvent())
+ wrapperClass = [DOMKeyboardEvent class];
+ else if (impl->isTextEvent())
+ wrapperClass = [DOMTextEvent class];
+ else if (impl->isMouseEvent())
+ wrapperClass = [DOMMouseEvent class];
+ else if (impl->isWheelEvent())
+ wrapperClass = [DOMWheelEvent class];
#if ENABLE(SVG)
- else if (impl->isSVGZoomEvent())
- wrapperClass = [DOMSVGZoomEvent class];
+ else if (impl->isSVGZoomEvent())
+ wrapperClass = [DOMSVGZoomEvent class];
#endif
- else if (impl->isUIEvent())
- wrapperClass = [DOMUIEvent class];
+ else
+ wrapperClass = [DOMUIEvent class];
+ } else if (impl->isMutationEvent())
+ wrapperClass = [DOMMutationEvent class];
else if (impl->isOverflowEvent())
wrapperClass = [DOMOverflowEvent class];
+ else if (impl->isMessageEvent())
+ wrapperClass = [DOMMessageEvent class];
+ else if (impl->isProgressEvent())
+ wrapperClass = [DOMProgressEvent class];
else
wrapperClass = [DOMEvent class];
diff --git a/WebCore/bindings/objc/DOMException.h b/WebCore/bindings/objc/DOMException.h
index 1efdf24..64d7194 100644
--- a/WebCore/bindings/objc/DOMException.h
+++ b/WebCore/bindings/objc/DOMException.h
@@ -24,12 +24,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import <JavaScriptCore/WebKitAvailability.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_1_3
+
@class NSString;
extern NSString * const DOMException;
-// DOM exception codes
-enum {
+enum DOMExceptionCode {
DOM_INDEX_SIZE_ERR = 1,
DOM_DOMSTRING_SIZE_ERR = 2,
DOM_HIERARCHY_REQUEST_ERR = 3,
@@ -46,3 +49,5 @@ enum {
DOM_NAMESPACE_ERR = 14,
DOM_INVALID_ACCESS_ERR = 15
};
+
+#endif
diff --git a/WebCore/bindings/objc/DOMExtensions.h b/WebCore/bindings/objc/DOMExtensions.h
index 8188c30..7748a22 100644
--- a/WebCore/bindings/objc/DOMExtensions.h
+++ b/WebCore/bindings/objc/DOMExtensions.h
@@ -48,15 +48,15 @@
@class NSURL;
@interface DOMNode (DOMNodeExtensions)
-- (NSRect)boundingBox;
-- (NSArray *)lineBoxRects;
+- (NSRect)boundingBox WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
+- (NSArray *)lineBoxRects WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
@end
@interface DOMElement (DOMElementAppKitExtensions)
-- (NSImage *)image;
+- (NSImage *)image WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
@end
@interface DOMHTMLDocument (DOMHTMLDocumentExtensions)
-- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL;
-- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text;
+- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
+- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
@end
diff --git a/WebCore/bindings/objc/DOMHTML.mm b/WebCore/bindings/objc/DOMHTML.mm
index e2fa509..59f2d7f 100644
--- a/WebCore/bindings/objc/DOMHTML.mm
+++ b/WebCore/bindings/objc/DOMHTML.mm
@@ -36,7 +36,6 @@
#import "HTMLDocument.h"
#import "HTMLInputElement.h"
#import "HTMLObjectElement.h"
-#import "KURL.h"
#import "Range.h"
#import "RenderTextControl.h"
#import "markup.h"
@@ -63,7 +62,7 @@
- (DOMDocumentFragment *)_createDocumentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString
{
- NSURL *baseURL = WebCore::KURL([self _document]->completeURL(WebCore::parseURL(baseURLString)).deprecatedString()).getNSURL();
+ NSURL *baseURL = [self _document]->completeURL(WebCore::parseURL(baseURLString));
return [self createDocumentFragmentWithMarkupString:markupString baseURL:baseURL];
}
@@ -116,7 +115,7 @@
if (![self _HTMLInputElement]->document()->view())
return result;
- NSView* view = [self _HTMLInputElement]->document()->view()->getDocumentView();
+ NSView* view = [self _HTMLInputElement]->document()->view()->documentView();
result = [view convertRect:result toView:nil];
result.origin = [[view window] convertBaseToScreen:result.origin];
return result;
diff --git a/WebCore/bindings/objc/DOMImplementationFront.cpp b/WebCore/bindings/objc/DOMImplementationFront.cpp
index 19a2d76..93db83b 100644
--- a/WebCore/bindings/objc/DOMImplementationFront.cpp
+++ b/WebCore/bindings/objc/DOMImplementationFront.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -64,9 +64,9 @@ PassRefPtr<Document> DOMImplementationFront::createDocument(const String& namesp
return reinterpret_cast<DOMImplementation*>(this)->createDocument(namespaceURI, qualifiedName, type, ec);
}
-DOMImplementationFront* DOMImplementationFront::getInterface(const String& feature) const
+DOMImplementationFront* DOMImplementationFront::getInterface(const String& feature)
{
- return reinterpret_cast<DOMImplementationFront*>(reinterpret_cast<const DOMImplementation*>(this)->getInterface(feature));
+ return reinterpret_cast<DOMImplementationFront*>(reinterpret_cast<DOMImplementation*>(this)->getInterface(feature));
}
PassRefPtr<CSSStyleSheet> DOMImplementationFront::createCSSStyleSheet(const String& title, const String& media, ExceptionCode& ec)
diff --git a/WebCore/bindings/objc/DOMImplementationFront.h b/WebCore/bindings/objc/DOMImplementationFront.h
index 14c1037..877a3b6 100644
--- a/WebCore/bindings/objc/DOMImplementationFront.h
+++ b/WebCore/bindings/objc/DOMImplementationFront.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -48,7 +48,7 @@ public:
bool hasFeature(const String& feature, const String& version) const;
PassRefPtr<DocumentType> createDocumentType(const String& qualifiedName, const String& publicId, const String& systemId, ExceptionCode&);
PassRefPtr<Document> createDocument(const String& namespaceURI, const String& qualifiedName, DocumentType*, ExceptionCode&);
- DOMImplementationFront* getInterface(const String& feature) const;
+ DOMImplementationFront* getInterface(const String& feature);
PassRefPtr<CSSStyleSheet> createCSSStyleSheet(const String& title, const String& media, ExceptionCode&);
PassRefPtr<HTMLDocument> createHTMLDocument(const String& title);
};
diff --git a/WebCore/bindings/objc/DOMInternal.h b/WebCore/bindings/objc/DOMInternal.h
index 5bd8c77..a1ca9fe 100644
--- a/WebCore/bindings/objc/DOMInternal.h
+++ b/WebCore/bindings/objc/DOMInternal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved.
* Copyright (C) 2006 James G. Speth (speth@end.com)
* Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
*
@@ -27,9 +27,7 @@
#import "DOM.h"
-#import "Color.h"
#import "DOMObject.h"
-#import "DOMRGBColor.h"
#import "HitTestResult.h"
#if ENABLE(XPATH)
@@ -56,6 +54,8 @@
#import "DOMCSSUnknownRuleInternal.h"
#import "DOMCSSValueInternal.h"
#import "DOMCSSValueListInternal.h"
+#import "DOMCSSVariablesRuleInternal.h"
+#import "DOMCSSVariablesDeclarationInternal.h"
#import "DOMCharacterDataInternal.h"
#import "DOMCommentInternal.h"
#import "DOMCounterInternal.h"
@@ -67,6 +67,8 @@
#import "DOMEntityInternal.h"
#import "DOMEntityReferenceInternal.h"
#import "DOMEventInternal.h"
+#import "DOMFileInternal.h"
+#import "DOMFileListInternal.h"
#import "DOMHTMLAnchorElementInternal.h"
#import "DOMHTMLAppletElementInternal.h"
#import "DOMHTMLAreaElementInternal.h"
@@ -127,6 +129,7 @@
#import "DOMHTMLUListElementInternal.h"
#import "DOMKeyboardEventInternal.h"
#import "DOMMediaListInternal.h"
+#import "DOMMessagePortInternal.h"
#import "DOMMouseEventInternal.h"
#import "DOMMutationEventInternal.h"
#import "DOMNamedNodeMapInternal.h"
@@ -136,18 +139,23 @@
#import "DOMNotationInternal.h"
#import "DOMOverflowEventInternal.h"
#import "DOMProcessingInstructionInternal.h"
+#import "DOMRGBColorInternal.h"
#import "DOMRangeInternal.h"
#import "DOMRectInternal.h"
#import "DOMStyleSheetInternal.h"
#import "DOMStyleSheetListInternal.h"
-#import "DOMTextInternal.h"
#import "DOMTextEventInternal.h"
+#import "DOMTextInternal.h"
#import "DOMTreeWalkerInternal.h"
#import "DOMUIEventInternal.h"
+#import "DOMWebKitCSSKeyframeRuleInternal.h"
+#import "DOMWebKitCSSKeyframesRuleInternal.h"
+#import "DOMWebKitCSSTransformValueInternal.h"
#import "DOMWheelEventInternal.h"
#if ENABLE(SVG)
#import "DOMSVGAElementInternal.h"
+#import "DOMSVGAltGlyphElementInternal.h"
#import "DOMSVGAngleInternal.h"
#import "DOMSVGAnimateColorElementInternal.h"
#import "DOMSVGAnimateElementInternal.h"
@@ -279,7 +287,7 @@
#import "DOMSVGZoomEventInternal.h"
#endif // ENABLE(SVG)
-namespace KJS {
+namespace JSC {
class JSObject;
namespace Bindings {
@@ -307,13 +315,6 @@ namespace WebCore {
- (id)_init;
@end
-// CSS Internal Interfaces
-
-@interface DOMRGBColor (WebCoreInternal)
-+ (DOMRGBColor *)_wrapRGBColor:(WebCore::RGBA32)value;
-- (WebCore::RGBA32)_RGBColor;
-@end
-
// Traversal Internal Interfaces
@interface DOMNodeFilter : DOMObject <DOMNodeFilter>
@@ -335,7 +336,7 @@ namespace WebCore {
namespace WebCore {
- id createDOMWrapper(KJS::JSObject*, PassRefPtr<KJS::Bindings::RootObject> origin, PassRefPtr<KJS::Bindings::RootObject> current);
+ id createDOMWrapper(JSC::JSObject*, PassRefPtr<JSC::Bindings::RootObject> origin, PassRefPtr<JSC::Bindings::RootObject> current);
NSObject* getDOMWrapper(DOMObjectInternal*);
void addDOMWrapper(NSObject* wrapper, DOMObjectInternal*);
diff --git a/WebCore/bindings/objc/DOMInternal.mm b/WebCore/bindings/objc/DOMInternal.mm
index afef8c8..f0b6305 100644
--- a/WebCore/bindings/objc/DOMInternal.mm
+++ b/WebCore/bindings/objc/DOMInternal.mm
@@ -37,7 +37,8 @@
#import "SVGException.h"
#import "WebScriptObjectPrivate.h"
#import "XPathEvaluator.h"
-#import "kjs_proxy.h"
+#import "ScriptController.h"
+#import "runtime_root.h"
//------------------------------------------------------------------------------------------
// Wrapping WebCore implementation objects
@@ -113,12 +114,12 @@ void removeDOMWrapper(DOMObjectInternal* impl)
if (!frame)
return;
- KJS::ExecState *exec = frame->scriptProxy()->globalObject()->globalExec();
+ JSC::ExecState *exec = frame->script()->globalObject()->globalExec();
// Get (or create) a cached JS object for the DOM node.
- KJS::JSObject *scriptImp = static_cast<KJS::JSObject*>(WebCore::toJS(exec, nodeImpl));
+ JSC::JSObject *scriptImp = asObject(WebCore::toJS(exec, nodeImpl));
- KJS::Bindings::RootObject* rootObject = frame->bindingRootObject();
+ JSC::Bindings::RootObject* rootObject = frame->script()->bindingRootObject();
[self _setImp:scriptImp originRootObject:rootObject rootObject:rootObject];
}
diff --git a/WebCore/bindings/objc/DOMObject.h b/WebCore/bindings/objc/DOMObject.h
index 22d739e..166637d 100644
--- a/WebCore/bindings/objc/DOMObject.h
+++ b/WebCore/bindings/objc/DOMObject.h
@@ -27,6 +27,8 @@
#import <WebCore/DOMException.h>
#import <WebCore/WebScriptObject.h>
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_1_3
+
@class DOMStyleSheet;
typedef unsigned long long DOMTimeStamp;
@@ -46,3 +48,5 @@ typedef struct DOMObjectInternal DOMObjectInternal;
- (DOMStyleSheet *)sheet;
#endif
@end
+
+#endif
diff --git a/WebCore/bindings/objc/DOMPrivate.h b/WebCore/bindings/objc/DOMPrivate.h
index 1322560..0ee5979 100644
--- a/WebCore/bindings/objc/DOMPrivate.h
+++ b/WebCore/bindings/objc/DOMPrivate.h
@@ -47,8 +47,6 @@
#import <WebCore/DOMHTMLFrameElementPrivate.h>
#import <WebCore/DOMHTMLImageElementPrivate.h>
#import <WebCore/DOMHTMLInputElementPrivate.h>
-#import <WebCore/DOMHTMLLabelElementPrivate.h>
-#import <WebCore/DOMHTMLLegendElementPrivate.h>
#import <WebCore/DOMHTMLLinkElementPrivate.h>
#import <WebCore/DOMHTMLOptionsCollectionPrivate.h>
#import <WebCore/DOMHTMLPreElementPrivate.h>
@@ -63,6 +61,10 @@
#import <WebCore/DOMUIEventPrivate.h>
#import <WebCore/DOMWheelEventPrivate.h>
+@interface DOMNode (DOMNodeExtensionsPendingPublic)
+- (NSImage *)renderedImage;
+@end
+
// FIXME: this should be removed as soon as all internal Apple uses of it have been replaced with
// calls to the public method - (NSColor *)color.
@interface DOMRGBColor (WebPrivate)
diff --git a/WebCore/bindings/objc/DOMRGBColor.mm b/WebCore/bindings/objc/DOMRGBColor.mm
index 8c35a9f..eca2c25 100644
--- a/WebCore/bindings/objc/DOMRGBColor.mm
+++ b/WebCore/bindings/objc/DOMRGBColor.mm
@@ -76,6 +76,9 @@ void removeWrapperForRGB(WebCore::RGBA32 value)
- (void)dealloc
{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([DOMRGBColor class], self))
+ return;
+
WebCore::removeWrapperForRGB(reinterpret_cast<uintptr_t>(_internal));
_internal = 0;
[super dealloc];
@@ -91,28 +94,28 @@ void removeWrapperForRGB(WebCore::RGBA32 value)
{
WebCore::RGBA32 rgb = reinterpret_cast<uintptr_t>(_internal);
int value = (rgb >> 16) & 0xFF;
- return [DOMCSSPrimitiveValue _wrapCSSPrimitiveValue:new WebCore::CSSPrimitiveValue(value, WebCore::CSSPrimitiveValue::CSS_NUMBER)];
+ return [DOMCSSPrimitiveValue _wrapCSSPrimitiveValue:WebCore::CSSPrimitiveValue::create(value, WebCore::CSSPrimitiveValue::CSS_NUMBER).get()];
}
- (DOMCSSPrimitiveValue *)green
{
WebCore::RGBA32 rgb = reinterpret_cast<uintptr_t>(_internal);
int value = (rgb >> 8) & 0xFF;
- return [DOMCSSPrimitiveValue _wrapCSSPrimitiveValue:new WebCore::CSSPrimitiveValue(value, WebCore::CSSPrimitiveValue::CSS_NUMBER)];
+ return [DOMCSSPrimitiveValue _wrapCSSPrimitiveValue:WebCore::CSSPrimitiveValue::create(value, WebCore::CSSPrimitiveValue::CSS_NUMBER).get()];
}
- (DOMCSSPrimitiveValue *)blue
{
WebCore::RGBA32 rgb = reinterpret_cast<uintptr_t>(_internal);
int value = rgb & 0xFF;
- return [DOMCSSPrimitiveValue _wrapCSSPrimitiveValue:new WebCore::CSSPrimitiveValue(value, WebCore::CSSPrimitiveValue::CSS_NUMBER)];
+ return [DOMCSSPrimitiveValue _wrapCSSPrimitiveValue:WebCore::CSSPrimitiveValue::create(value, WebCore::CSSPrimitiveValue::CSS_NUMBER).get()];
}
- (DOMCSSPrimitiveValue *)alpha
{
WebCore::RGBA32 rgb = reinterpret_cast<uintptr_t>(_internal);
float value = static_cast<float>(WebCore::Color(rgb).alpha()) / 0xFF;
- return [DOMCSSPrimitiveValue _wrapCSSPrimitiveValue:new WebCore::CSSPrimitiveValue(value, WebCore::CSSPrimitiveValue::CSS_NUMBER)];
+ return [DOMCSSPrimitiveValue _wrapCSSPrimitiveValue:WebCore::CSSPrimitiveValue::create(value, WebCore::CSSPrimitiveValue::CSS_NUMBER).get()];
}
diff --git a/WebCore/bindings/objc/DOMRangeException.h b/WebCore/bindings/objc/DOMRangeException.h
index a625d49..874a540 100644
--- a/WebCore/bindings/objc/DOMRangeException.h
+++ b/WebCore/bindings/objc/DOMRangeException.h
@@ -24,6 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import <JavaScriptCore/WebKitAvailability.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_1_3
+
@class NSString;
extern NSString * const DOMRangeException;
@@ -32,3 +36,5 @@ enum DOMRangeExceptionCode {
DOM_BAD_BOUNDARYPOINTS_ERR = 1,
DOM_INVALID_NODE_TYPE_ERR = 2
};
+
+#endif
diff --git a/WebCore/bindings/objc/DOMSVG.h b/WebCore/bindings/objc/DOMSVG.h
index 8a7388f..f1321d8 100644
--- a/WebCore/bindings/objc/DOMSVG.h
+++ b/WebCore/bindings/objc/DOMSVG.h
@@ -25,6 +25,7 @@
*/
#import <WebCore/DOMSVGAElement.h>
+#import <WebCore/DOMSVGAltGlyphElement.h>
#import <WebCore/DOMSVGAngle.h>
#import <WebCore/DOMSVGAnimateColorElement.h>
#import <WebCore/DOMSVGAnimateElement.h>
diff --git a/WebCore/bindings/objc/DOMSVGException.h b/WebCore/bindings/objc/DOMSVGException.h
index 1eb121a..b757978 100644
--- a/WebCore/bindings/objc/DOMSVGException.h
+++ b/WebCore/bindings/objc/DOMSVGException.h
@@ -24,6 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import <JavaScriptCore/WebKitAvailability.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
@class NSString;
extern NSString * const DOMSVGException;
@@ -33,3 +37,5 @@ enum DOMSVGException {
DOM_SVG_INVALID_VALUE_ERR = 1,
DOM_SVG_MATRIX_NOT_INVERTABLE = 2
};
+
+#endif
diff --git a/WebCore/bindings/objc/DOMTraversal.h b/WebCore/bindings/objc/DOMTraversal.h
index e2d291e..db9dea8 100644
--- a/WebCore/bindings/objc/DOMTraversal.h
+++ b/WebCore/bindings/objc/DOMTraversal.h
@@ -31,18 +31,3 @@
#import <WebCore/DOMNodeFilter.h>
#import <WebCore/DOMNodeIterator.h>
#import <WebCore/DOMTreeWalker.h>
-
-@interface DOMDocument (DOMDocumentTraversal)
-- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences;
-- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences;
-@end
-
-@interface DOMDocument (DOMDocumentTraversalDeprecated)
-#ifndef BUILDING_ON_TIGER
-- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
-- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
-#else
-- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences;
-- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences;
-#endif
-@end
diff --git a/WebCore/bindings/objc/DOMUtility.mm b/WebCore/bindings/objc/DOMUtility.mm
index 16204a3..e346c9e 100644
--- a/WebCore/bindings/objc/DOMUtility.mm
+++ b/WebCore/bindings/objc/DOMUtility.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2006 James G. Speth (speth@end.com)
*
* Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,8 @@
#import "JSCSSValue.h"
#import "JSCounter.h"
#import "JSDOMImplementation.h"
+#import "JSDOMWindow.h"
+#import "JSDOMWindowShell.h"
#import "JSEvent.h"
#import "JSHTMLCollection.h"
#import "JSHTMLOptionsCollection.h"
@@ -42,6 +44,7 @@
#import "JSNode.h"
#import "JSNodeIterator.h"
#import "JSNodeList.h"
+#import "JSRGBColor.h"
#import "JSRange.h"
#import "JSRect.h"
#import "JSStyleSheet.h"
@@ -51,9 +54,7 @@
#import "JSXPathResult.h"
#import "Node.h"
#import "WebScriptObjectPrivate.h"
-#import "kjs_css.h"
-#import "kjs_html.h"
-#import "kjs_window.h"
+#import "runtime_root.h"
#import <objc/objc-runtime.h>
// This file makes use of both the ObjC DOM API and the C++ DOM API, so we need to be careful about what
@@ -66,12 +67,12 @@
// Some day if the compiler is fixed, or if all the JS wrappers are named with a "JS" prefix,
// we could move the function into the WebCore namespace where it belongs.
-namespace KJS {
+namespace JSC {
-static inline id createDOMWrapper(KJS::JSObject* object)
+static inline id createDOMWrapper(JSC::JSObject* object)
{
#define WRAP(className) \
- if (object->inherits(&WebCore::JS##className::info)) \
+ if (object->inherits(&WebCore::JS##className::s_info)) \
return [DOM##className _wrap##className:static_cast<WebCore::JS##className*>(object)->impl()];
WRAP(CSSRule)
@@ -84,14 +85,18 @@ static inline id createDOMWrapper(KJS::JSObject* object)
WRAP(MediaList)
WRAP(NamedNodeMap)
WRAP(Node)
+ WRAP(NodeIterator)
WRAP(NodeList)
WRAP(RGBColor)
WRAP(Range)
WRAP(Rect)
WRAP(StyleSheet)
WRAP(StyleSheetList)
+ WRAP(TreeWalker)
+#if ENABLE(XPATH)
WRAP(XPathExpression)
WRAP(XPathResult)
+#endif
// This must be after the HTMLOptionsCollection check, because it's a subclass in the JavaScript
// binding, but not a subclass in the ObjC binding.
@@ -99,14 +104,11 @@ static inline id createDOMWrapper(KJS::JSObject* object)
#undef WRAP
- if (object->inherits(&Window::info))
- return [DOMAbstractView _wrapAbstractView:static_cast<Window*>(object)->impl()];
- if (object->inherits(&WebCore::JSDOMImplementation::info))
+ if (object->inherits(&WebCore::JSDOMWindowShell::s_info))
+ return [DOMAbstractView _wrapAbstractView:static_cast<WebCore::JSDOMWindowShell*>(object)->impl()];
+
+ if (object->inherits(&WebCore::JSDOMImplementation::s_info))
return [DOMImplementation _wrapDOMImplementation:implementationFront(static_cast<WebCore::JSDOMImplementation*>(object))];
- if (object->inherits(&WebCore::JSNodeIterator::info))
- return [DOMNodeIterator _wrapNodeIterator:static_cast<WebCore::JSNodeIterator*>(object)->impl() filter:nil];
- if (object->inherits(&WebCore::JSTreeWalker::info))
- return [DOMTreeWalker _wrapTreeWalker:static_cast<WebCore::JSTreeWalker*>(object)->impl() filter:nil];
return nil;
}
@@ -115,9 +117,9 @@ static inline id createDOMWrapper(KJS::JSObject* object)
namespace WebCore {
-id createDOMWrapper(KJS::JSObject* object, PassRefPtr<KJS::Bindings::RootObject> origin, PassRefPtr<KJS::Bindings::RootObject> current)
+id createDOMWrapper(JSC::JSObject* object, PassRefPtr<JSC::Bindings::RootObject> origin, PassRefPtr<JSC::Bindings::RootObject> current)
{
- id wrapper = KJS::createDOMWrapper(object);
+ id wrapper = JSC::createDOMWrapper(object);
if (![wrapper _hasImp]) // new wrapper, not from cache
[wrapper _setImp:object originRootObject:origin rootObject:current];
return wrapper;
diff --git a/WebCore/bindings/objc/DOMXPathException.h b/WebCore/bindings/objc/DOMXPathException.h
index 6db8292..32f95fb 100644
--- a/WebCore/bindings/objc/DOMXPathException.h
+++ b/WebCore/bindings/objc/DOMXPathException.h
@@ -24,6 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import <JavaScriptCore/WebKitAvailability.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_3_0
+
@class NSString;
extern NSString * const DOMXPathException;
@@ -32,3 +36,5 @@ enum DOMXPathExceptionCode {
DOM_INVALID_EXPRESSION_ERR = 51,
DOM_TYPE_ERR = 52
};
+
+#endif
diff --git a/WebCore/bindings/objc/ExceptionHandlers.h b/WebCore/bindings/objc/ExceptionHandlers.h
index 5f85b9b..911ae2c 100644
--- a/WebCore/bindings/objc/ExceptionHandlers.h
+++ b/WebCore/bindings/objc/ExceptionHandlers.h
@@ -26,7 +26,7 @@
#ifndef ExceptionHandlers_h
#define ExceptionHandlers_h
-#include <JavaScriptCore/Assertions.h>
+#include <wtf/Assertions.h>
#if !defined(NDEBUG) && !defined(DISABLE_THREAD_CHECK)
#define DOM_ASSERT_MAIN_THREAD() do \
diff --git a/WebCore/bindings/objc/ObjCEventListener.h b/WebCore/bindings/objc/ObjCEventListener.h
new file mode 100644
index 0000000..6056b01
--- /dev/null
+++ b/WebCore/bindings/objc/ObjCEventListener.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2004, 2006, 2008 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.
+ */
+
+#ifndef ObjCEventListener_h
+#define ObjCEventListener_h
+
+#include "EventListener.h"
+
+#include <wtf/PassRefPtr.h>
+
+@protocol DOMEventListener;
+
+namespace WebCore {
+
+ class ObjCEventListener : public EventListener {
+ public:
+ static PassRefPtr<ObjCEventListener> wrap(id <DOMEventListener>);
+
+ private:
+ static ObjCEventListener* find(id <DOMEventListener>);
+
+ ObjCEventListener(id <DOMEventListener>);
+ virtual ~ObjCEventListener();
+
+ virtual void handleEvent(Event*, bool isWindowEvent);
+
+ id <DOMEventListener> m_listener;
+ };
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/bindings/objc/ObjCEventListener.mm b/WebCore/bindings/objc/ObjCEventListener.mm
new file mode 100644
index 0000000..46c04c1
--- /dev/null
+++ b/WebCore/bindings/objc/ObjCEventListener.mm
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 James G. Speth (speth@end.com)
+ * 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 "ObjCEventListener.h"
+
+#import "DOMEventInternal.h"
+#import "DOMEventListener.h"
+#import "Event.h"
+#import "EventListener.h"
+
+#import <objc/objc-class.h>
+#import <wtf/HashMap.h>
+
+namespace WebCore {
+
+typedef HashMap<id, ObjCEventListener*> ListenerMap;
+static ListenerMap* listenerMap;
+
+ObjCEventListener* ObjCEventListener::find(id <DOMEventListener> listener)
+{
+ if (ListenerMap* map = listenerMap)
+ return map->get(listener);
+ return 0;
+}
+
+PassRefPtr<ObjCEventListener> ObjCEventListener::wrap(id <DOMEventListener> listener)
+{
+ RefPtr<ObjCEventListener> wrapper = find(listener);
+ if (wrapper)
+ return wrapper;
+ return adoptRef(new ObjCEventListener(listener));
+}
+
+ObjCEventListener::ObjCEventListener(id <DOMEventListener> listener)
+ : m_listener([listener retain])
+{
+ ListenerMap* map = listenerMap;
+ if (!map) {
+ map = new ListenerMap;
+ listenerMap = map;
+ }
+ map->set(listener, this);
+}
+
+ObjCEventListener::~ObjCEventListener()
+{
+ listenerMap->remove(m_listener);
+ [m_listener release];
+}
+
+void ObjCEventListener::handleEvent(Event* event, bool)
+{
+ [m_listener handleEvent:[DOMEvent _wrapEvent:event]];
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/objc/ObjCNodeFilterCondition.h b/WebCore/bindings/objc/ObjCNodeFilterCondition.h
new file mode 100644
index 0000000..e136bc4
--- /dev/null
+++ b/WebCore/bindings/objc/ObjCNodeFilterCondition.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2004, 2006, 2008 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.
+ */
+
+#ifndef ObjCNodeFilterCondition_h
+#define ObjCNodeFilterCondition_h
+
+#include "NodeFilterCondition.h"
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RetainPtr.h>
+
+@protocol DOMNodeFilter;
+
+namespace WebCore {
+ class Node;
+
+ class ObjCNodeFilterCondition : public NodeFilterCondition {
+ public:
+ static PassRefPtr<ObjCNodeFilterCondition> create(id <DOMNodeFilter> filter)
+ {
+ return adoptRef(new ObjCNodeFilterCondition(filter));
+ }
+
+ virtual short acceptNode(JSC::ExecState*, Node*) const;
+
+ private:
+ ObjCNodeFilterCondition(id <DOMNodeFilter> filter)
+ : m_filter(filter)
+ {
+ }
+
+ RetainPtr<id <DOMNodeFilter> > m_filter;
+ };
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/bindings/objc/ObjCNodeFilterCondition.mm b/WebCore/bindings/objc/ObjCNodeFilterCondition.mm
new file mode 100644
index 0000000..982cfe0
--- /dev/null
+++ b/WebCore/bindings/objc/ObjCNodeFilterCondition.mm
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 James G. Speth (speth@end.com)
+ * 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 "ObjCNodeFilterCondition.h"
+
+#import "DOMNodeFilter.h"
+#import "DOMNodeInternal.h"
+#import "NodeFilter.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+short ObjCNodeFilterCondition::acceptNode(ExecState*, Node* node) const
+{
+ if (!node)
+ return NodeFilter::FILTER_REJECT;
+ return [m_filter.get() acceptNode:[DOMNode _wrapNode:node]];
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/objc/PublicDOMInterfaces.h b/WebCore/bindings/objc/PublicDOMInterfaces.h
index 00591f6..349abaf 100644
--- a/WebCore/bindings/objc/PublicDOMInterfaces.h
+++ b/WebCore/bindings/objc/PublicDOMInterfaces.h
@@ -30,51 +30,51 @@
#error Do not include this header, instead include the appropriate DOM header.
#endif
-@interface DOMAttr : DOMNode
+@interface DOMAttr : DOMNode WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *name;
@property(readonly) BOOL specified;
@property(copy) NSString *value;
@property(readonly, retain) DOMElement *ownerElement;
-@property(readonly, retain) DOMCSSStyleDeclaration *style;
+@property(readonly, retain) DOMCSSStyleDeclaration *style AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMCDATASection : DOMText
+@interface DOMCDATASection : DOMText WEBKIT_VERSION_1_3
@end
-@interface DOMCharacterData : DOMNode
+@interface DOMCharacterData : DOMNode WEBKIT_VERSION_1_3
@property(copy) NSString *data;
@property(readonly) unsigned length;
- (NSString *)substringData:(unsigned)offset :(unsigned)length;
-- (NSString *)substringData:(unsigned)offset length:(unsigned)length;
+- (NSString *)substringData:(unsigned)offset length:(unsigned)length AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)appendData:(NSString *)data;
- (void)insertData:(unsigned)offset :(NSString *)data;
- (void)deleteData:(unsigned)offset :(unsigned)length;
- (void)replaceData:(unsigned)offset :(unsigned)length :(NSString *)data;
-- (void)insertData:(unsigned)offset data:(NSString *)data;
-- (void)deleteData:(unsigned)offset length:(unsigned)length;
-- (void)replaceData:(unsigned)offset length:(unsigned)length data:(NSString *)data;
+- (void)insertData:(unsigned)offset data:(NSString *)data AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (void)deleteData:(unsigned)offset length:(unsigned)length AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (void)replaceData:(unsigned)offset length:(unsigned)length data:(NSString *)data AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMComment : DOMCharacterData
+@interface DOMComment : DOMCharacterData WEBKIT_VERSION_1_3
@end
-@interface DOMImplementation : DOMObject
+@interface DOMImplementation : DOMObject WEBKIT_VERSION_1_3
- (BOOL)hasFeature:(NSString *)feature :(NSString *)version;
- (DOMDocumentType *)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId;
- (DOMDocument *)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(DOMDocumentType *)doctype;
- (DOMCSSStyleSheet *)createCSSStyleSheet:(NSString *)title :(NSString *)media;
-- (BOOL)hasFeature:(NSString *)feature version:(NSString *)version;
-- (DOMDocumentType *)createDocumentType:(NSString *)qualifiedName publicId:(NSString *)publicId systemId:(NSString *)systemId;
-- (DOMDocument *)createDocument:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName doctype:(DOMDocumentType *)doctype;
-- (DOMCSSStyleSheet *)createCSSStyleSheet:(NSString *)title media:(NSString *)media;
-- (DOMHTMLDocument *)createHTMLDocument:(NSString *)title;
+- (BOOL)hasFeature:(NSString *)feature version:(NSString *)version AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMDocumentType *)createDocumentType:(NSString *)qualifiedName publicId:(NSString *)publicId systemId:(NSString *)systemId AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMDocument *)createDocument:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName doctype:(DOMDocumentType *)doctype AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMCSSStyleSheet *)createCSSStyleSheet:(NSString *)title media:(NSString *)media AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMHTMLDocument *)createHTMLDocument:(NSString *)title AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMAbstractView : DOMObject
+@interface DOMAbstractView : DOMObject WEBKIT_VERSION_1_3
@property(readonly, retain) DOMDocument *document;
@end
-@interface DOMDocument : DOMNode
+@interface DOMDocument : DOMNode WEBKIT_VERSION_1_3
@property(readonly, retain) DOMDocumentType *doctype;
@property(readonly, retain) DOMImplementation *implementation;
@property(readonly, retain) DOMElement *documentElement;
@@ -97,7 +97,7 @@
- (DOMComment *)createComment:(NSString *)data;
- (DOMCDATASection *)createCDATASection:(NSString *)data;
- (DOMProcessingInstruction *)createProcessingInstruction:(NSString *)target :(NSString *)data;
-- (DOMProcessingInstruction *)createProcessingInstruction:(NSString *)target data:(NSString *)data;
+- (DOMProcessingInstruction *)createProcessingInstruction:(NSString *)target data:(NSString *)data AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMAttr *)createAttribute:(NSString *)name;
- (DOMEntityReference *)createEntityReference:(NSString *)name;
- (DOMNodeList *)getElementsByTagName:(NSString *)tagname;
@@ -105,35 +105,39 @@
- (DOMElement *)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
- (DOMAttr *)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
- (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
-- (DOMNode *)importNode:(DOMNode *)importedNode deep:(BOOL)deep;
-- (DOMNode *)adoptNode:(DOMNode *)source;
-- (DOMElement *)createElementNS:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName;
-- (DOMAttr *)createAttributeNS:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName;
-- (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI localName:(NSString *)localName;
+- (DOMNode *)importNode:(DOMNode *)importedNode deep:(BOOL)deep AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMNode *)adoptNode:(DOMNode *)source AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMElement *)createElementNS:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMAttr *)createAttributeNS:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI localName:(NSString *)localName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMElement *)getElementById:(NSString *)elementId;
- (DOMEvent *)createEvent:(NSString *)eventType;
- (DOMRange *)createRange;
-- (DOMCSSStyleDeclaration *)createCSSStyleDeclaration;
+- (DOMCSSStyleDeclaration *)createCSSStyleDeclaration AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMCSSStyleDeclaration *)getOverrideStyle:(DOMElement *)element :(NSString *)pseudoElement;
-- (DOMCSSStyleDeclaration *)getOverrideStyle:(DOMElement *)element pseudoElement:(NSString *)pseudoElement;
+- (DOMCSSStyleDeclaration *)getOverrideStyle:(DOMElement *)element pseudoElement:(NSString *)pseudoElement AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)element :(NSString *)pseudoElement;
-- (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)element pseudoElement:(NSString *)pseudoElement;
-- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)element pseudoElement:(NSString *)pseudoElement;
-- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)element pseudoElement:(NSString *)pseudoElement authorOnly:(BOOL)authorOnly;
+- (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)element pseudoElement:(NSString *)pseudoElement AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)element pseudoElement:(NSString *)pseudoElement AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)element pseudoElement:(NSString *)pseudoElement authorOnly:(BOOL)authorOnly AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMNodeList *)getElementsByName:(NSString *)elementName;
-#ifdef ENABLE_XPATH
-- (DOMXPathExpression *)createExpression:(NSString *)expression :(id <DOMXPathNSResolver>)resolver;
-- (DOMXPathExpression *)createExpression:(NSString *)expression resolver:(id <DOMXPathNSResolver>)resolver;
-- (id <DOMXPathNSResolver>)createNSResolver:(DOMNode *)nodeResolver;
-- (DOMXPathResult *)evaluate:(NSString *)expression :(DOMNode *)contextNode :(id <DOMXPathNSResolver>)resolver :(unsigned short)type :(DOMXPathResult *)inResult;
-- (DOMXPathResult *)evaluate:(NSString *)expression contextNode:(DOMNode *)contextNode resolver:(id <DOMXPathNSResolver>)resolver type:(unsigned short)type inResult:(DOMXPathResult *)inResult;
+- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences;
+- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences;
+#if ENABLE_XPATH
+- (DOMXPathExpression *)createExpression:(NSString *)expression :(id <DOMXPathNSResolver>)resolver AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED;
+- (DOMXPathExpression *)createExpression:(NSString *)expression resolver:(id <DOMXPathNSResolver>)resolver AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (id <DOMXPathNSResolver>)createNSResolver:(DOMNode *)nodeResolver AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMXPathResult *)evaluate:(NSString *)expression :(DOMNode *)contextNode :(id <DOMXPathNSResolver>)resolver :(unsigned short)type :(DOMXPathResult *)inResult AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED;
+- (DOMXPathResult *)evaluate:(NSString *)expression contextNode:(DOMNode *)contextNode resolver:(id <DOMXPathNSResolver>)resolver type:(unsigned short)type inResult:(DOMXPathResult *)inResult AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
#endif
@end
-@interface DOMDocumentFragment : DOMNode
+@interface DOMDocumentFragment : DOMNode WEBKIT_VERSION_1_3
@end
-@interface DOMDocumentType : DOMNode
+@interface DOMDocumentType : DOMNode WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *name;
@property(readonly, retain) DOMNamedNodeMap *entities;
@property(readonly, retain) DOMNamedNodeMap *notations;
@@ -142,7 +146,7 @@
@property(readonly, copy) NSString *internalSubset;
@end
-@interface DOMElement : DOMNode
+@interface DOMElement : DOMNode WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *tagName;
@property(readonly, retain) DOMCSSStyleDeclaration *style;
@property(readonly) int offsetLeft;
@@ -158,7 +162,7 @@
@property(readonly) int scrollHeight;
- (NSString *)getAttribute:(NSString *)name;
- (void)setAttribute:(NSString *)name :(NSString *)value;
-- (void)setAttribute:(NSString *)name value:(NSString *)value;
+- (void)setAttribute:(NSString *)name value:(NSString *)value AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)removeAttribute:(NSString *)name;
- (DOMAttr *)getAttributeNode:(NSString *)name;
- (DOMAttr *)setAttributeNode:(DOMAttr *)newAttr;
@@ -169,44 +173,42 @@
- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
- (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
- (DOMAttr *)getAttributeNodeNS:(NSString *)namespaceURI :(NSString *)localName;
-- (NSString *)getAttributeNS:(NSString *)namespaceURI localName:(NSString *)localName;
-- (void)setAttributeNS:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName value:(NSString *)value;
-- (void)removeAttributeNS:(NSString *)namespaceURI localName:(NSString *)localName;
-- (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI localName:(NSString *)localName;
-- (DOMAttr *)getAttributeNodeNS:(NSString *)namespaceURI localName:(NSString *)localName;
+- (NSString *)getAttributeNS:(NSString *)namespaceURI localName:(NSString *)localName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (void)setAttributeNS:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName value:(NSString *)value AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (void)removeAttributeNS:(NSString *)namespaceURI localName:(NSString *)localName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI localName:(NSString *)localName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMAttr *)getAttributeNodeNS:(NSString *)namespaceURI localName:(NSString *)localName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMAttr *)setAttributeNodeNS:(DOMAttr *)newAttr;
- (BOOL)hasAttribute:(NSString *)name;
- (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
-- (BOOL)hasAttributeNS:(NSString *)namespaceURI localName:(NSString *)localName;
-- (void)focus;
-- (void)blur;
-- (void)scrollIntoView:(BOOL)alignWithTop;
-- (void)scrollIntoViewIfNeeded:(BOOL)centerIfNeeded;
+- (BOOL)hasAttributeNS:(NSString *)namespaceURI localName:(NSString *)localName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (void)scrollIntoView:(BOOL)alignWithTop AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (void)scrollIntoViewIfNeeded:(BOOL)centerIfNeeded AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMEntity : DOMNode
+@interface DOMEntity : DOMNode WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *publicId;
@property(readonly, copy) NSString *systemId;
@property(readonly, copy) NSString *notationName;
@end
-@interface DOMEntityReference : DOMNode
+@interface DOMEntityReference : DOMNode WEBKIT_VERSION_1_3
@end
-@interface DOMNamedNodeMap : DOMObject
+@interface DOMNamedNodeMap : DOMObject WEBKIT_VERSION_1_3
@property(readonly) unsigned length;
- (DOMNode *)getNamedItem:(NSString *)name;
- (DOMNode *)setNamedItem:(DOMNode *)node;
- (DOMNode *)removeNamedItem:(NSString *)name;
- (DOMNode *)item:(unsigned)index;
- (DOMNode *)getNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
-- (DOMNode *)getNamedItemNS:(NSString *)namespaceURI localName:(NSString *)localName;
+- (DOMNode *)getNamedItemNS:(NSString *)namespaceURI localName:(NSString *)localName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMNode *)setNamedItemNS:(DOMNode *)node;
- (DOMNode *)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
-- (DOMNode *)removeNamedItemNS:(NSString *)namespaceURI localName:(NSString *)localName;
+- (DOMNode *)removeNamedItemNS:(NSString *)namespaceURI localName:(NSString *)localName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMNode : DOMObject
+@interface DOMNode : DOMObject WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *nodeName;
@property(copy) NSString *nodeValue;
@property(readonly) unsigned short nodeType;
@@ -221,43 +223,43 @@
@property(readonly, copy) NSString *namespaceURI;
@property(copy) NSString *prefix;
@property(readonly, copy) NSString *localName;
-@property(copy) NSString *textContent;
+@property(copy) NSString *textContent AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMNode *)insertBefore:(DOMNode *)newChild :(DOMNode *)refChild;
-- (DOMNode *)insertBefore:(DOMNode *)newChild refChild:(DOMNode *)refChild;
+- (DOMNode *)insertBefore:(DOMNode *)newChild refChild:(DOMNode *)refChild AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMNode *)replaceChild:(DOMNode *)newChild :(DOMNode *)oldChild;
-- (DOMNode *)replaceChild:(DOMNode *)newChild oldChild:(DOMNode *)oldChild;
+- (DOMNode *)replaceChild:(DOMNode *)newChild oldChild:(DOMNode *)oldChild AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (DOMNode *)removeChild:(DOMNode *)oldChild;
- (DOMNode *)appendChild:(DOMNode *)newChild;
- (BOOL)hasChildNodes;
- (DOMNode *)cloneNode:(BOOL)deep;
- (void)normalize;
- (BOOL)isSupported:(NSString *)feature :(NSString *)version;
-- (BOOL)isSupported:(NSString *)feature version:(NSString *)version;
+- (BOOL)isSupported:(NSString *)feature version:(NSString *)version AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (BOOL)hasAttributes;
-- (BOOL)isSameNode:(DOMNode *)other;
-- (BOOL)isEqualNode:(DOMNode *)other;
+- (BOOL)isSameNode:(DOMNode *)other AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (BOOL)isEqualNode:(DOMNode *)other AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMNodeList : DOMObject
+@interface DOMNodeList : DOMObject WEBKIT_VERSION_1_3
@property(readonly) unsigned length;
- (DOMNode *)item:(unsigned)index;
@end
-@interface DOMNotation : DOMNode
+@interface DOMNotation : DOMNode WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *publicId;
@property(readonly, copy) NSString *systemId;
@end
-@interface DOMProcessingInstruction : DOMNode
+@interface DOMProcessingInstruction : DOMNode WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *target;
@property(copy) NSString *data;
@end
-@interface DOMText : DOMCharacterData
+@interface DOMText : DOMCharacterData WEBKIT_VERSION_1_3
- (DOMText *)splitText:(unsigned)offset;
@end
-@interface DOMHTMLAnchorElement : DOMHTMLElement
+@interface DOMHTMLAnchorElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *accessKey;
@property(copy) NSString *charset;
@property(copy) NSString *coords;
@@ -267,15 +269,12 @@
@property(copy) NSString *rel;
@property(copy) NSString *rev;
@property(copy) NSString *shape;
-@property int tabIndex;
@property(copy) NSString *target;
@property(copy) NSString *type;
-@property(readonly, copy) NSURL *absoluteLinkURL;
-- (void)blur;
-- (void)focus;
+@property(readonly, copy) NSURL *absoluteLinkURL AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMHTMLAppletElement : DOMHTMLElement
+@interface DOMHTMLAppletElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@property(copy) NSString *alt;
@property(copy) NSString *archive;
@@ -289,34 +288,33 @@
@property(copy) NSString *width;
@end
-@interface DOMHTMLAreaElement : DOMHTMLElement
+@interface DOMHTMLAreaElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *accessKey;
@property(copy) NSString *alt;
@property(copy) NSString *coords;
@property(copy) NSString *href;
@property BOOL noHref;
@property(copy) NSString *shape;
-@property int tabIndex;
@property(copy) NSString *target;
-@property(readonly, copy) NSURL *absoluteLinkURL;
+@property(readonly, copy) NSURL *absoluteLinkURL AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMHTMLBRElement : DOMHTMLElement
+@interface DOMHTMLBRElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *clear;
@end
-@interface DOMHTMLBaseElement : DOMHTMLElement
+@interface DOMHTMLBaseElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *href;
@property(copy) NSString *target;
@end
-@interface DOMHTMLBaseFontElement : DOMHTMLElement
+@interface DOMHTMLBaseFontElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *color;
@property(copy) NSString *face;
@property(copy) NSString *size;
@end
-@interface DOMHTMLBodyElement : DOMHTMLElement
+@interface DOMHTMLBodyElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *aLink;
@property(copy) NSString *background;
@property(copy) NSString *bgColor;
@@ -325,47 +323,46 @@
@property(copy) NSString *vLink;
@end
-@interface DOMHTMLButtonElement : DOMHTMLElement
+@interface DOMHTMLButtonElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly, retain) DOMHTMLFormElement *form;
@property(copy) NSString *accessKey;
@property BOOL disabled;
@property(copy) NSString *name;
-@property int tabIndex;
@property(readonly, copy) NSString *type;
@property(copy) NSString *value;
@end
-@interface DOMHTMLCanvasElement : DOMHTMLElement
+@interface DOMHTMLCanvasElement : DOMHTMLElement WEBKIT_VERSION_3_0
@property int height;
@property int width;
@end
-@interface DOMHTMLCollection : DOMObject
+@interface DOMHTMLCollection : DOMObject WEBKIT_VERSION_1_3
@property(readonly) unsigned length;
- (DOMNode *)item:(unsigned)index;
- (DOMNode *)namedItem:(NSString *)name;
@end
-@interface DOMHTMLDListElement : DOMHTMLElement
+@interface DOMHTMLDListElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property BOOL compact;
@end
-@interface DOMHTMLDirectoryElement : DOMHTMLElement
+@interface DOMHTMLDirectoryElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property BOOL compact;
@end
-@interface DOMHTMLDivElement : DOMHTMLElement
+@interface DOMHTMLDivElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@end
-@interface DOMHTMLDocument : DOMDocument
+@interface DOMHTMLDocument : DOMDocument WEBKIT_VERSION_1_3
- (void)open;
- (void)close;
- (void)write:(NSString *)text;
- (void)writeln:(NSString *)text;
@end
-@interface DOMHTMLElement : DOMElement
+@interface DOMHTMLElement : DOMElement WEBKIT_VERSION_1_3
@property(copy) NSString *title;
@property(copy) NSString *idName;
@property(copy) NSString *lang;
@@ -378,10 +375,13 @@
@property(readonly, retain) DOMHTMLCollection *children;
@property(copy) NSString *contentEditable;
@property(readonly) BOOL isContentEditable;
-@property(readonly, copy) NSString *titleDisplayString;
+@property(readonly, copy) NSString *titleDisplayString AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+@property int tabIndex;
+- (void)blur;
+- (void)focus;
@end
-@interface DOMHTMLEmbedElement : DOMHTMLElement
+@interface DOMHTMLEmbedElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@property int height;
@property(copy) NSString *name;
@@ -390,17 +390,17 @@
@property int width;
@end
-@interface DOMHTMLFieldSetElement : DOMHTMLElement
+@interface DOMHTMLFieldSetElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly, retain) DOMHTMLFormElement *form;
@end
-@interface DOMHTMLFontElement : DOMHTMLElement
+@interface DOMHTMLFontElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *color;
@property(copy) NSString *face;
@property(copy) NSString *size;
@end
-@interface DOMHTMLFormElement : DOMHTMLElement
+@interface DOMHTMLFormElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly, retain) DOMHTMLCollection *elements;
@property(readonly) int length;
@property(copy) NSString *name;
@@ -413,7 +413,7 @@
- (void)reset;
@end
-@interface DOMHTMLFrameElement : DOMHTMLElement
+@interface DOMHTMLFrameElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *frameBorder;
@property(copy) NSString *longDesc;
@property(copy) NSString *marginHeight;
@@ -425,31 +425,31 @@
@property(readonly, retain) DOMDocument *contentDocument;
@end
-@interface DOMHTMLFrameSetElement : DOMHTMLElement
+@interface DOMHTMLFrameSetElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *cols;
@property(copy) NSString *rows;
@end
-@interface DOMHTMLHRElement : DOMHTMLElement
+@interface DOMHTMLHRElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@property BOOL noShade;
@property(copy) NSString *size;
@property(copy) NSString *width;
@end
-@interface DOMHTMLHeadElement : DOMHTMLElement
+@interface DOMHTMLHeadElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *profile;
@end
-@interface DOMHTMLHeadingElement : DOMHTMLElement
+@interface DOMHTMLHeadingElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@end
-@interface DOMHTMLHtmlElement : DOMHTMLElement
+@interface DOMHTMLHtmlElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *version;
@end
-@interface DOMHTMLIFrameElement : DOMHTMLElement
+@interface DOMHTMLIFrameElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@property(copy) NSString *frameBorder;
@property(copy) NSString *height;
@@ -463,7 +463,7 @@
@property(readonly, retain) DOMDocument *contentDocument;
@end
-@interface DOMHTMLImageElement : DOMHTMLElement
+@interface DOMHTMLImageElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *name;
@property(copy) NSString *align;
@property(copy) NSString *alt;
@@ -476,11 +476,11 @@
@property(copy) NSString *useMap;
@property int vspace;
@property int width;
-@property(readonly, copy) NSString *altDisplayString;
-@property(readonly, copy) NSURL *absoluteImageURL;
+@property(readonly, copy) NSString *altDisplayString AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+@property(readonly, copy) NSURL *absoluteImageURL AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMHTMLInputElement : DOMHTMLElement
+@interface DOMHTMLInputElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *defaultValue;
@property BOOL defaultChecked;
@property(readonly, retain) DOMHTMLFormElement *form;
@@ -495,41 +495,38 @@
@property BOOL readOnly;
@property(copy) NSString *size;
@property(copy) NSString *src;
-@property int tabIndex;
@property(copy) NSString *type;
@property(copy) NSString *useMap;
@property(copy) NSString *value;
-@property(readonly, copy) NSString *altDisplayString;
-@property(readonly, copy) NSURL *absoluteImageURL;
-- (void)blur;
-- (void)focus;
+@property(readonly, copy) NSString *altDisplayString AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+@property(readonly, copy) NSURL *absoluteImageURL AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)select;
- (void)click;
@end
-@interface DOMHTMLIsIndexElement : DOMHTMLInputElement
+@interface DOMHTMLIsIndexElement : DOMHTMLInputElement WEBKIT_VERSION_1_3
@property(readonly, retain) DOMHTMLFormElement *form;
@property(copy) NSString *prompt;
@end
-@interface DOMHTMLLIElement : DOMHTMLElement
+@interface DOMHTMLLIElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *type;
@property int value;
@end
-@interface DOMHTMLLabelElement : DOMHTMLElement
+@interface DOMHTMLLabelElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly, retain) DOMHTMLFormElement *form;
@property(copy) NSString *accessKey;
@property(copy) NSString *htmlFor;
@end
-@interface DOMHTMLLegendElement : DOMHTMLElement
+@interface DOMHTMLLegendElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly, retain) DOMHTMLFormElement *form;
@property(copy) NSString *accessKey;
@property(copy) NSString *align;
@end
-@interface DOMHTMLLinkElement : DOMHTMLElement
+@interface DOMHTMLLinkElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property BOOL disabled;
@property(copy) NSString *charset;
@property(copy) NSString *href;
@@ -539,42 +536,42 @@
@property(copy) NSString *rev;
@property(copy) NSString *target;
@property(copy) NSString *type;
-@property(readonly, copy) NSURL *absoluteLinkURL;
+@property(readonly, copy) NSURL *absoluteLinkURL AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMHTMLMapElement : DOMHTMLElement
+@interface DOMHTMLMapElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly, retain) DOMHTMLCollection *areas;
@property(copy) NSString *name;
@end
-@interface DOMHTMLMarqueeElement : DOMHTMLElement
+@interface DOMHTMLMarqueeElement : DOMHTMLElement WEBKIT_VERSION_3_0
- (void)start;
- (void)stop;
@end
-@interface DOMHTMLMenuElement : DOMHTMLElement
+@interface DOMHTMLMenuElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property BOOL compact;
@end
-@interface DOMHTMLMetaElement : DOMHTMLElement
+@interface DOMHTMLMetaElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *content;
@property(copy) NSString *httpEquiv;
@property(copy) NSString *name;
@property(copy) NSString *scheme;
@end
-@interface DOMHTMLModElement : DOMHTMLElement
+@interface DOMHTMLModElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *cite;
@property(copy) NSString *dateTime;
@end
-@interface DOMHTMLOListElement : DOMHTMLElement
+@interface DOMHTMLOListElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property BOOL compact;
@property int start;
@property(copy) NSString *type;
@end
-@interface DOMHTMLObjectElement : DOMHTMLElement
+@interface DOMHTMLObjectElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly, retain) DOMHTMLFormElement *form;
@property(copy) NSString *code;
@property(copy) NSString *align;
@@ -588,21 +585,20 @@
@property int hspace;
@property(copy) NSString *name;
@property(copy) NSString *standby;
-@property int tabIndex;
@property(copy) NSString *type;
@property(copy) NSString *useMap;
@property int vspace;
@property(copy) NSString *width;
@property(readonly, retain) DOMDocument *contentDocument;
-@property(readonly, copy) NSURL *absoluteImageURL;
+@property(readonly, copy) NSURL *absoluteImageURL AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMHTMLOptGroupElement : DOMHTMLElement
+@interface DOMHTMLOptGroupElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property BOOL disabled;
@property(copy) NSString *label;
@end
-@interface DOMHTMLOptionElement : DOMHTMLElement
+@interface DOMHTMLOptionElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly, retain) DOMHTMLFormElement *form;
@property BOOL defaultSelected;
@property(readonly, copy) NSString *text;
@@ -613,32 +609,32 @@
@property(copy) NSString *value;
@end
-@interface DOMHTMLOptionsCollection : DOMObject
+@interface DOMHTMLOptionsCollection : DOMObject WEBKIT_VERSION_1_3
@property unsigned length;
- (DOMNode *)item:(unsigned)index;
- (DOMNode *)namedItem:(NSString *)name;
@end
-@interface DOMHTMLParagraphElement : DOMHTMLElement
+@interface DOMHTMLParagraphElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@end
-@interface DOMHTMLParamElement : DOMHTMLElement
+@interface DOMHTMLParamElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *name;
@property(copy) NSString *type;
@property(copy) NSString *value;
@property(copy) NSString *valueType;
@end
-@interface DOMHTMLPreElement : DOMHTMLElement
+@interface DOMHTMLPreElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property int width;
@end
-@interface DOMHTMLQuoteElement : DOMHTMLElement
+@interface DOMHTMLQuoteElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *cite;
@end
-@interface DOMHTMLScriptElement : DOMHTMLElement
+@interface DOMHTMLScriptElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *text;
@property(copy) NSString *htmlFor;
@property(copy) NSString *event;
@@ -648,7 +644,7 @@
@property(copy) NSString *type;
@end
-@interface DOMHTMLSelectElement : DOMHTMLElement
+@interface DOMHTMLSelectElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *type;
@property int selectedIndex;
@property(copy) NSString *value;
@@ -659,25 +655,22 @@
@property BOOL multiple;
@property(copy) NSString *name;
@property int size;
-@property int tabIndex;
- (void)add:(DOMHTMLElement *)element :(DOMHTMLElement *)before;
-- (void)add:(DOMHTMLElement *)element before:(DOMHTMLElement *)before;
+- (void)add:(DOMHTMLElement *)element before:(DOMHTMLElement *)before AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)remove:(int)index;
-- (void)blur;
-- (void)focus;
@end
-@interface DOMHTMLStyleElement : DOMHTMLElement
+@interface DOMHTMLStyleElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property BOOL disabled;
@property(copy) NSString *media;
@property(copy) NSString *type;
@end
-@interface DOMHTMLTableCaptionElement : DOMHTMLElement
+@interface DOMHTMLTableCaptionElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@end
-@interface DOMHTMLTableCellElement : DOMHTMLElement
+@interface DOMHTMLTableCellElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly) int cellIndex;
@property(copy) NSString *abbr;
@property(copy) NSString *align;
@@ -695,7 +688,7 @@
@property(copy) NSString *width;
@end
-@interface DOMHTMLTableColElement : DOMHTMLElement
+@interface DOMHTMLTableColElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@property(copy) NSString *ch;
@property(copy) NSString *chOff;
@@ -704,7 +697,7 @@
@property(copy) NSString *width;
@end
-@interface DOMHTMLTableElement : DOMHTMLElement
+@interface DOMHTMLTableElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(retain) DOMHTMLTableCaptionElement *caption;
@property(retain) DOMHTMLTableSectionElement *tHead;
@property(retain) DOMHTMLTableSectionElement *tFoot;
@@ -729,7 +722,7 @@
- (void)deleteRow:(int)index;
@end
-@interface DOMHTMLTableRowElement : DOMHTMLElement
+@interface DOMHTMLTableRowElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(readonly) int rowIndex;
@property(readonly) int sectionRowIndex;
@property(readonly, retain) DOMHTMLCollection *cells;
@@ -742,7 +735,7 @@
- (void)deleteCell:(int)index;
@end
-@interface DOMHTMLTableSectionElement : DOMHTMLElement
+@interface DOMHTMLTableSectionElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *align;
@property(copy) NSString *ch;
@property(copy) NSString *chOff;
@@ -752,7 +745,7 @@
- (void)deleteRow:(int)index;
@end
-@interface DOMHTMLTextAreaElement : DOMHTMLElement
+@interface DOMHTMLTextAreaElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *defaultValue;
@property(readonly, retain) DOMHTMLFormElement *form;
@property(copy) NSString *accessKey;
@@ -761,89 +754,86 @@
@property(copy) NSString *name;
@property BOOL readOnly;
@property int rows;
-@property int tabIndex;
@property(readonly, copy) NSString *type;
@property(copy) NSString *value;
-- (void)blur;
-- (void)focus;
- (void)select;
@end
-@interface DOMHTMLTitleElement : DOMHTMLElement
+@interface DOMHTMLTitleElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property(copy) NSString *text;
@end
-@interface DOMHTMLUListElement : DOMHTMLElement
+@interface DOMHTMLUListElement : DOMHTMLElement WEBKIT_VERSION_1_3
@property BOOL compact;
@property(copy) NSString *type;
@end
-@interface DOMStyleSheetList : DOMObject
+@interface DOMStyleSheetList : DOMObject WEBKIT_VERSION_1_3
@property(readonly) unsigned length;
- (DOMStyleSheet *)item:(unsigned)index;
@end
-@interface DOMCSSCharsetRule : DOMCSSRule
+@interface DOMCSSCharsetRule : DOMCSSRule WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *encoding;
@end
-@interface DOMCSSFontFaceRule : DOMCSSRule
+@interface DOMCSSFontFaceRule : DOMCSSRule WEBKIT_VERSION_1_3
@property(readonly, retain) DOMCSSStyleDeclaration *style;
@end
-@interface DOMCSSImportRule : DOMCSSRule
+@interface DOMCSSImportRule : DOMCSSRule WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *href;
@property(readonly, retain) DOMMediaList *media;
@property(readonly, retain) DOMCSSStyleSheet *styleSheet;
@end
-@interface DOMCSSMediaRule : DOMCSSRule
+@interface DOMCSSMediaRule : DOMCSSRule WEBKIT_VERSION_1_3
@property(readonly, retain) DOMMediaList *media;
@property(readonly, retain) DOMCSSRuleList *cssRules;
- (unsigned)insertRule:(NSString *)rule :(unsigned)index;
-- (unsigned)insertRule:(NSString *)rule index:(unsigned)index;
+- (unsigned)insertRule:(NSString *)rule index:(unsigned)index AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)deleteRule:(unsigned)index;
@end
-@interface DOMCSSPageRule : DOMCSSRule
+@interface DOMCSSPageRule : DOMCSSRule WEBKIT_VERSION_1_3
@property(copy) NSString *selectorText;
@property(readonly, retain) DOMCSSStyleDeclaration *style;
@end
-@interface DOMCSSPrimitiveValue : DOMCSSValue
+@interface DOMCSSPrimitiveValue : DOMCSSValue WEBKIT_VERSION_1_3
@property(readonly) unsigned short primitiveType;
- (void)setFloatValue:(unsigned short)unitType :(float)floatValue;
-- (void)setFloatValue:(unsigned short)unitType floatValue:(float)floatValue;
+- (void)setFloatValue:(unsigned short)unitType floatValue:(float)floatValue AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (float)getFloatValue:(unsigned short)unitType;
- (void)setStringValue:(unsigned short)stringType :(NSString *)stringValue;
-- (void)setStringValue:(unsigned short)stringType stringValue:(NSString *)stringValue;
+- (void)setStringValue:(unsigned short)stringType stringValue:(NSString *)stringValue AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (NSString *)getStringValue;
- (DOMCounter *)getCounterValue;
- (DOMRect *)getRectValue;
- (DOMRGBColor *)getRGBColorValue;
@end
-@interface DOMRGBColor : DOMObject
+@interface DOMRGBColor : DOMObject WEBKIT_VERSION_1_3
@property(readonly, retain) DOMCSSPrimitiveValue *red;
@property(readonly, retain) DOMCSSPrimitiveValue *green;
@property(readonly, retain) DOMCSSPrimitiveValue *blue;
@property(readonly, retain) DOMCSSPrimitiveValue *alpha;
-@property(readonly, copy) NSColor *color;
+@property(readonly, copy) NSColor *color AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMCSSRule : DOMObject
+@interface DOMCSSRule : DOMObject WEBKIT_VERSION_1_3
@property(readonly) unsigned short type;
@property(copy) NSString *cssText;
@property(readonly, retain) DOMCSSStyleSheet *parentStyleSheet;
@property(readonly, retain) DOMCSSRule *parentRule;
@end
-@interface DOMCSSRuleList : DOMObject
+@interface DOMCSSRuleList : DOMObject WEBKIT_VERSION_1_3
@property(readonly) unsigned length;
- (DOMCSSRule *)item:(unsigned)index;
@end
-@interface DOMCSSStyleDeclaration : DOMObject
+@interface DOMCSSStyleDeclaration : DOMObject WEBKIT_VERSION_1_3
@property(copy) NSString *cssText;
@property(readonly) unsigned length;
@property(readonly, retain) DOMCSSRule *parentRule;
@@ -852,18 +842,18 @@
- (NSString *)removeProperty:(NSString *)propertyName;
- (NSString *)getPropertyPriority:(NSString *)propertyName;
- (void)setProperty:(NSString *)propertyName :(NSString *)value :(NSString *)priority;
-- (void)setProperty:(NSString *)propertyName value:(NSString *)value priority:(NSString *)priority;
+- (void)setProperty:(NSString *)propertyName value:(NSString *)value priority:(NSString *)priority AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (NSString *)item:(unsigned)index;
-- (NSString *)getPropertyShorthand:(NSString *)propertyName;
-- (BOOL)isPropertyImplicit:(NSString *)propertyName;
+- (NSString *)getPropertyShorthand:(NSString *)propertyName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (BOOL)isPropertyImplicit:(NSString *)propertyName AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
-@interface DOMCSSStyleRule : DOMCSSRule
+@interface DOMCSSStyleRule : DOMCSSRule WEBKIT_VERSION_1_3
@property(copy) NSString *selectorText;
@property(readonly, retain) DOMCSSStyleDeclaration *style;
@end
-@interface DOMStyleSheet : DOMObject
+@interface DOMStyleSheet : DOMObject WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *type;
@property BOOL disabled;
@property(readonly, retain) DOMNode *ownerNode;
@@ -873,41 +863,41 @@
@property(readonly, retain) DOMMediaList *media;
@end
-@interface DOMCSSStyleSheet : DOMStyleSheet
+@interface DOMCSSStyleSheet : DOMStyleSheet WEBKIT_VERSION_1_3
@property(readonly, retain) DOMCSSRule *ownerRule;
@property(readonly, retain) DOMCSSRuleList *cssRules;
- (unsigned)insertRule:(NSString *)rule :(unsigned)index;
-- (unsigned)insertRule:(NSString *)rule index:(unsigned)index;
+- (unsigned)insertRule:(NSString *)rule index:(unsigned)index AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)deleteRule:(unsigned)index;
@end
-@interface DOMCSSValue : DOMObject
+@interface DOMCSSValue : DOMObject WEBKIT_VERSION_1_3
@property(copy) NSString *cssText;
@property(readonly) unsigned short cssValueType;
@end
-@interface DOMCSSValueList : DOMCSSValue
+@interface DOMCSSValueList : DOMCSSValue WEBKIT_VERSION_1_3
@property(readonly) unsigned length;
- (DOMCSSValue *)item:(unsigned)index;
@end
-@interface DOMCSSUnknownRule : DOMCSSRule
+@interface DOMCSSUnknownRule : DOMCSSRule WEBKIT_VERSION_1_3
@end
-@interface DOMCounter : DOMObject
+@interface DOMCounter : DOMObject WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *identifier;
@property(readonly, copy) NSString *listStyle;
@property(readonly, copy) NSString *separator;
@end
-@interface DOMRect : DOMObject
+@interface DOMRect : DOMObject WEBKIT_VERSION_1_3
@property(readonly, retain) DOMCSSPrimitiveValue *top;
@property(readonly, retain) DOMCSSPrimitiveValue *right;
@property(readonly, retain) DOMCSSPrimitiveValue *bottom;
@property(readonly, retain) DOMCSSPrimitiveValue *left;
@end
-@interface DOMEvent : DOMObject
+@interface DOMEvent : DOMObject WEBKIT_VERSION_1_3
@property(readonly, copy) NSString *type;
@property(readonly, retain) id <DOMEventTarget> target;
@property(readonly, retain) id <DOMEventTarget> currentTarget;
@@ -917,35 +907,35 @@
@property(readonly) DOMTimeStamp timeStamp;
- (void)stopPropagation;
- (void)preventDefault;
-- (void)initEvent:(NSString *)eventTypeArg canBubbleArg:(BOOL)canBubbleArg cancelableArg:(BOOL)cancelableArg;
+- (void)initEvent:(NSString *)eventTypeArg canBubbleArg:(BOOL)canBubbleArg cancelableArg:(BOOL)cancelableArg AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)initEvent:(NSString *)eventTypeArg :(BOOL)canBubbleArg :(BOOL)cancelableArg;
@end
-@interface DOMUIEvent : DOMEvent
+@interface DOMUIEvent : DOMEvent WEBKIT_VERSION_1_3
@property(readonly, retain) DOMAbstractView *view;
@property(readonly) int detail;
-- (void)initUIEvent:(NSString *)type canBubble:(BOOL)canBubble cancelable:(BOOL)cancelable view:(DOMAbstractView *)view detail:(int)detail;
+- (void)initUIEvent:(NSString *)type canBubble:(BOOL)canBubble cancelable:(BOOL)cancelable view:(DOMAbstractView *)view detail:(int)detail AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)initUIEvent:(NSString *)type :(BOOL)canBubble :(BOOL)cancelable :(DOMAbstractView *)view :(int)detail;
@end
-@interface DOMMutationEvent : DOMEvent
+@interface DOMMutationEvent : DOMEvent WEBKIT_VERSION_1_3
@property(readonly, retain) DOMNode *relatedNode;
@property(readonly, copy) NSString *prevValue;
@property(readonly, copy) NSString *newValue;
@property(readonly, copy) NSString *attrName;
@property(readonly) unsigned short attrChange;
-- (void)initMutationEvent:(NSString *)type canBubble:(BOOL)canBubble cancelable:(BOOL)cancelable relatedNode:(DOMNode *)relatedNode prevValue:(NSString *)prevValue newValue:(NSString *)newValue attrName:(NSString *)attrName attrChange:(unsigned short)attrChange;
+- (void)initMutationEvent:(NSString *)type canBubble:(BOOL)canBubble cancelable:(BOOL)cancelable relatedNode:(DOMNode *)relatedNode prevValue:(NSString *)prevValue newValue:(NSString *)newValue attrName:(NSString *)attrName attrChange:(unsigned short)attrChange AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)initMutationEvent:(NSString *)type :(BOOL)canBubble :(BOOL)cancelable :(DOMNode *)relatedNode :(NSString *)prevValue :(NSString *)newValue :(NSString *)attrName :(unsigned short)attrChange;
@end
-@interface DOMOverflowEvent : DOMEvent
+@interface DOMOverflowEvent : DOMEvent WEBKIT_VERSION_3_0
@property(readonly) unsigned short orient;
@property(readonly) BOOL horizontalOverflow;
@property(readonly) BOOL verticalOverflow;
- (void)initOverflowEvent:(unsigned short)orient horizontalOverflow:(BOOL)horizontalOverflow verticalOverflow:(BOOL)verticalOverflow;
@end
-@interface DOMWheelEvent : DOMUIEvent
+@interface DOMWheelEvent : DOMUIEvent WEBKIT_VERSION_3_0
@property(readonly) int screenX;
@property(readonly) int screenY;
@property(readonly) int clientX;
@@ -958,7 +948,7 @@
@property(readonly) int wheelDelta;
@end
-@interface DOMKeyboardEvent : DOMUIEvent
+@interface DOMKeyboardEvent : DOMUIEvent WEBKIT_VERSION_3_0
@property(readonly, copy) NSString *keyIdentifier;
@property(readonly) unsigned keyLocation;
@property(readonly) BOOL ctrlKey;
@@ -970,7 +960,7 @@
- (BOOL)getModifierState:(NSString *)keyIdentifierArg;
@end
-@interface DOMMouseEvent : DOMUIEvent
+@interface DOMMouseEvent : DOMUIEvent WEBKIT_VERSION_1_3
@property(readonly) int screenX;
@property(readonly) int screenY;
@property(readonly) int clientX;
@@ -981,21 +971,21 @@
@property(readonly) BOOL metaKey;
@property(readonly) unsigned short button;
@property(readonly, retain) id <DOMEventTarget> relatedTarget;
-- (void)initMouseEvent:(NSString *)type canBubble:(BOOL)canBubble cancelable:(BOOL)cancelable view:(DOMAbstractView *)view detail:(int)detail screenX:(int)screenX screenY:(int)screenY clientX:(int)clientX clientY:(int)clientY ctrlKey:(BOOL)ctrlKey altKey:(BOOL)altKey shiftKey:(BOOL)shiftKey metaKey:(BOOL)metaKey button:(unsigned short)button relatedTarget:(id <DOMEventTarget>)relatedTarget;
+- (void)initMouseEvent:(NSString *)type canBubble:(BOOL)canBubble cancelable:(BOOL)cancelable view:(DOMAbstractView *)view detail:(int)detail screenX:(int)screenX screenY:(int)screenY clientX:(int)clientX clientY:(int)clientY ctrlKey:(BOOL)ctrlKey altKey:(BOOL)altKey shiftKey:(BOOL)shiftKey metaKey:(BOOL)metaKey button:(unsigned short)button relatedTarget:(id <DOMEventTarget>)relatedTarget AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)initMouseEvent:(NSString *)type :(BOOL)canBubble :(BOOL)cancelable :(DOMAbstractView *)view :(int)detail :(int)screenX :(int)screenY :(int)clientX :(int)clientY :(BOOL)ctrlKey :(BOOL)altKey :(BOOL)shiftKey :(BOOL)metaKey :(unsigned short)button :(id <DOMEventTarget>)relatedTarget;
@end
-@interface DOMRange : DOMObject
+@interface DOMRange : DOMObject WEBKIT_VERSION_1_3
@property(readonly, retain) DOMNode *startContainer;
@property(readonly) int startOffset;
@property(readonly, retain) DOMNode *endContainer;
@property(readonly) int endOffset;
@property(readonly) BOOL collapsed;
@property(readonly, retain) DOMNode *commonAncestorContainer;
-@property(readonly, copy) NSString *text;
-- (void)setStart:(DOMNode *)refNode offset:(int)offset;
+@property(readonly, copy) NSString *text AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (void)setStart:(DOMNode *)refNode offset:(int)offset AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)setStart:(DOMNode *)refNode :(int)offset;
-- (void)setEnd:(DOMNode *)refNode offset:(int)offset;
+- (void)setEnd:(DOMNode *)refNode offset:(int)offset AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)setEnd:(DOMNode *)refNode :(int)offset;
- (void)setStartBefore:(DOMNode *)refNode;
- (void)setStartAfter:(DOMNode *)refNode;
@@ -1004,7 +994,7 @@
- (void)collapse:(BOOL)toStart;
- (void)selectNode:(DOMNode *)refNode;
- (void)selectNodeContents:(DOMNode *)refNode;
-- (short)compareBoundaryPoints:(unsigned short)how sourceRange:(DOMRange *)sourceRange;
+- (short)compareBoundaryPoints:(unsigned short)how sourceRange:(DOMRange *)sourceRange AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (short)compareBoundaryPoints:(unsigned short)how :(DOMRange *)sourceRange;
- (void)deleteContents;
- (DOMDocumentFragment *)extractContents;
@@ -1016,7 +1006,7 @@
- (void)detach;
@end
-@interface DOMNodeIterator : DOMObject
+@interface DOMNodeIterator : DOMObject WEBKIT_VERSION_1_3
@property(readonly, retain) DOMNode *root;
@property(readonly) unsigned whatToShow;
@property(readonly, retain) id <DOMNodeFilter> filter;
@@ -1026,7 +1016,7 @@
- (void)detach;
@end
-@interface DOMMediaList : DOMObject
+@interface DOMMediaList : DOMObject WEBKIT_VERSION_1_3
@property(copy) NSString *mediaText;
@property(readonly) unsigned length;
- (NSString *)item:(unsigned)index;
@@ -1034,7 +1024,7 @@
- (void)appendMedium:(NSString *)newMedium;
@end
-@interface DOMTreeWalker : DOMObject
+@interface DOMTreeWalker : DOMObject WEBKIT_VERSION_1_3
@property(readonly, retain) DOMNode *root;
@property(readonly) unsigned whatToShow;
@property(readonly, retain) id <DOMNodeFilter> filter;
@@ -1049,7 +1039,7 @@
- (DOMNode *)nextNode;
@end
-@interface DOMXPathResult : DOMObject
+@interface DOMXPathResult : DOMObject WEBKIT_VERSION_3_0
@property(readonly) unsigned short resultType;
@property(readonly) double numberValue;
@property(readonly, copy) NSString *stringValue;
@@ -1061,32 +1051,29 @@
- (DOMNode *)snapshotItem:(unsigned)index;
@end
-@interface DOMXPathExpression : DOMObject
-// We should be able to remove the old style version of this method
-// once we can verify that all the internal Apple usages have switched
-// to the new style, because this has never been in a public release.
-- (DOMXPathResult *)evaluate:(DOMNode *)contextNode type:(unsigned short)type inResult:(DOMXPathResult *)inResult;
-- (DOMXPathResult *)evaluate:(DOMNode *)contextNode :(unsigned short)type :(DOMXPathResult *)inResult;
+@interface DOMXPathExpression : DOMObject WEBKIT_VERSION_3_0
+- (DOMXPathResult *)evaluate:(DOMNode *)contextNode type:(unsigned short)type inResult:(DOMXPathResult *)inResult AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (DOMXPathResult *)evaluate:(DOMNode *)contextNode :(unsigned short)type :(DOMXPathResult *)inResult AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED;
@end
// Protocols
-@protocol DOMEventListener <NSObject>
+@protocol DOMEventListener <NSObject> WEBKIT_VERSION_1_3
- (void)handleEvent:(DOMEvent *)evt;
@end
-@protocol DOMEventTarget <NSObject, NSCopying>
+@protocol DOMEventTarget <NSObject, NSCopying> WEBKIT_VERSION_1_3
- (void)addEventListener:(NSString *)type :(id <DOMEventListener>)listener :(BOOL)useCapture;
- (void)removeEventListener:(NSString *)type :(id <DOMEventListener>)listener :(BOOL)useCapture;
-- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
-- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
+- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (BOOL)dispatchEvent:(DOMEvent *)event;
@end
-@protocol DOMNodeFilter <NSObject>
+@protocol DOMNodeFilter <NSObject> WEBKIT_VERSION_1_3
- (short)acceptNode:(DOMNode *)n;
@end
-@protocol DOMXPathNSResolver <NSObject>
+@protocol DOMXPathNSResolver <NSObject> WEBKIT_VERSION_3_0
- (NSString *)lookupNamespaceURI:(NSString *)prefix;
@end
diff --git a/WebCore/bindings/objc/WebScriptObject.h b/WebCore/bindings/objc/WebScriptObject.h
index 9ad04ac..f75f458 100644
--- a/WebCore/bindings/objc/WebScriptObject.h
+++ b/WebCore/bindings/objc/WebScriptObject.h
@@ -1,11 +1,33 @@
/*
- Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
-
- Public header file.
+ * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
+ *
+ * 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 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 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 <Foundation/Foundation.h>
#import <JavaScriptCore/JSBase.h>
+#import <JavaScriptCore/WebKitAvailability.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_1_3
// NSObject (WebScripting) -----------------------------------------------------
@@ -212,7 +234,7 @@
@discussion Use this method to bridge between the WebScriptObject and
JavaScriptCore APIs.
*/
-- (JSObjectRef)JSObject;
+- (JSObjectRef)JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
/*!
@method callWebScriptMethod:withArguments:
@@ -292,3 +314,5 @@
+ (WebUndefined *)undefined;
@end
+
+#endif
diff --git a/WebCore/bindings/objc/WebScriptObject.mm b/WebCore/bindings/objc/WebScriptObject.mm
index 4f1168b..6262b97 100644
--- a/WebCore/bindings/objc/WebScriptObject.mm
+++ b/WebCore/bindings/objc/WebScriptObject.mm
@@ -26,30 +26,34 @@
#import "config.h"
#import "WebScriptObjectPrivate.h"
+#import "Console.h"
#import "DOMInternal.h"
+#import "DOMWindow.h"
#import "Frame.h"
+#import "JSDOMWindow.h"
+#import "JSDOMWindowCustom.h"
#import "PlatformString.h"
+#import "StringSourceProvider.h"
#import "WebCoreObjCExtras.h"
-#import "WebCoreFrameBridge.h"
-#import <JavaScriptCore/ExecState.h>
-#import <JavaScriptCore/objc_instance.h>
-#import <JavaScriptCore/runtime_object.h>
+#import "objc_instance.h"
+#import "runtime.h"
+#import "runtime_object.h"
+#import "runtime_root.h"
#import <JavaScriptCore/APICast.h>
-#import <JavaScriptCore/JSGlobalObject.h>
-#import <JavaScriptCore/interpreter.h>
+#import <runtime/ExecState.h>
+#import <runtime/JSGlobalObject.h>
+#import <runtime/JSLock.h>
+#import <kjs/completion.h>
+#import <kjs/interpreter.h>
+
+#ifdef BUILDING_ON_TIGER
+typedef unsigned NSUInteger;
+#endif
-using namespace KJS;
-using namespace KJS::Bindings;
+using namespace JSC;
+using namespace JSC::Bindings;
using namespace WebCore;
-#define LOG_EXCEPTION(exec) \
- if (Interpreter::shouldPrintExceptions()) \
- printf("%s:%d:[%d] JavaScript exception: %s\n", __FILE__, __LINE__, getpid(), exec->exception()->toObject(exec)->get(exec, exec->propertyNames().message)->toString(exec).ascii());
-
-@interface WebFrame
-- (WebCoreFrameBridge *)_bridge; // implemented in WebKit
-@end
-
namespace WebCore {
typedef HashMap<JSObject*, NSObject*> JSWrapperMap;
@@ -76,13 +80,21 @@ void removeJSWrapper(JSObject* impl)
JSWrapperCache->remove(impl);
}
-id createJSWrapper(KJS::JSObject* object, PassRefPtr<KJS::Bindings::RootObject> origin, PassRefPtr<KJS::Bindings::RootObject> root)
+id createJSWrapper(JSC::JSObject* object, PassRefPtr<JSC::Bindings::RootObject> origin, PassRefPtr<JSC::Bindings::RootObject> root)
{
if (id wrapper = getJSWrapper(object))
return [[wrapper retain] autorelease];
return [[[WebScriptObject alloc] _initWithJSObject:object originRootObject:origin rootObject:root] autorelease];
}
+static void addExceptionToConsole(ExecState* exec)
+{
+ JSDOMWindow* window = asJSDOMWindow(exec->dynamicGlobalObject());
+ if (!window || !exec->hadException())
+ return;
+ window->impl()->console()->reportCurrentException(exec);
+}
+
} // namespace WebCore
@implementation WebScriptObjectPrivate
@@ -158,7 +170,7 @@ static void _didExecute(WebScriptObject *obj)
_private->originRootObject = originRootObject.releaseRef();
}
-- (id)_initWithJSObject:(KJS::JSObject*)imp originRootObject:(PassRefPtr<KJS::Bindings::RootObject>)originRootObject rootObject:(PassRefPtr<KJS::Bindings::RootObject>)rootObject
+- (id)_initWithJSObject:(JSC::JSObject*)imp originRootObject:(PassRefPtr<JSC::Bindings::RootObject>)originRootObject rootObject:(PassRefPtr<JSC::Bindings::RootObject>)rootObject
{
ASSERT(imp);
@@ -212,6 +224,9 @@ static void _didExecute(WebScriptObject *obj)
- (void)dealloc
{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebScriptObject class], self))
+ return;
+
if (_private->imp)
WebCore::removeJSWrapper(_private->imp);
@@ -248,22 +263,11 @@ static void _didExecute(WebScriptObject *obj)
+ (BOOL)throwException:(NSString *)exceptionMessage
{
- JSLock lock;
-
- // This code assumes that we only ever have one running interpreter. A
- // good assumption for now, as we depend on that elsewhere. However,
- // in the future we may have the ability to run multiple interpreters,
- // in which case this will have to change.
-
- if (ExecState::activeExecStates().size()) {
- throwError(ExecState::activeExecStates().last(), GeneralError, exceptionMessage);
- return YES;
- }
-
- return NO;
+ ObjcInstance::setGlobalException(exceptionMessage);
+ return YES;
}
-static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* rootObject, List& aList)
+static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* rootObject, ArgList& aList)
{
int i, numObjects = array ? [array count] : 0;
@@ -278,35 +282,30 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
if (![self _isSafeScript])
return nil;
+ JSLock lock(false);
+
// Look up the function object.
ExecState* exec = [self _rootObject]->globalObject()->globalExec();
ASSERT(!exec->hadException());
- JSLock lock;
-
- JSValue* func = [self _imp]->get(exec, String(name));
-
- if (!func || !func->isObject())
- // Maybe throw an exception here?
- return 0;
-
- // Call the function object.
- JSObject *funcImp = static_cast<JSObject*>(func);
- if (!funcImp->implementsCall())
- return 0;
+ JSValue* function = [self _imp]->get(exec, Identifier(exec, String(name)));
+ CallData callData;
+ CallType callType = function->getCallData(callData);
+ if (callType == CallTypeNone)
+ return nil;
- List argList;
+ ArgList argList;
getListFromNSArray(exec, args, [self _rootObject], argList);
if (![self _isSafeScript])
return nil;
[self _rootObject]->globalObject()->startTimeoutCheck();
- JSValue *result = funcImp->call(exec, [self _imp], argList);
+ JSValue* result = call(exec, function, callType, callData, [self _imp], argList);
[self _rootObject]->globalObject()->stopTimeoutCheck();
if (exec->hadException()) {
- LOG_EXCEPTION(exec);
+ addExceptionToConsole(exec);
result = jsUndefined();
exec->clearException();
}
@@ -327,11 +326,11 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
ExecState* exec = [self _rootObject]->globalObject()->globalExec();
ASSERT(!exec->hadException());
- JSValue *result;
- JSLock lock;
+ JSValue* result;
+ JSLock lock(false);
[self _rootObject]->globalObject()->startTimeoutCheck();
- Completion completion = Interpreter::evaluate([self _rootObject]->globalObject()->globalExec(), UString(), 0, String(script));
+ Completion completion = Interpreter::evaluate([self _rootObject]->globalObject()->globalExec(), [self _rootObject]->globalObject()->globalScopeChain(), makeSource(String(script)));
[self _rootObject]->globalObject()->stopTimeoutCheck();
ComplType type = completion.complType();
@@ -343,7 +342,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
result = jsUndefined();
if (exec->hadException()) {
- LOG_EXCEPTION(exec);
+ addExceptionToConsole(exec);
result = jsUndefined();
exec->clearException();
}
@@ -363,11 +362,13 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
ExecState* exec = [self _rootObject]->globalObject()->globalExec();
ASSERT(!exec->hadException());
- JSLock lock;
- [self _imp]->put(exec, String(key), convertObjcValueToValue(exec, &value, ObjcObjectType, [self _rootObject]));
+ JSLock lock(false);
+
+ PutPropertySlot slot;
+ [self _imp]->put(exec, Identifier(exec, String(key)), convertObjcValueToValue(exec, &value, ObjcObjectType, [self _rootObject]), slot);
if (exec->hadException()) {
- LOG_EXCEPTION(exec);
+ addExceptionToConsole(exec);
exec->clearException();
}
@@ -387,12 +388,12 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
// Need to scope this lock to ensure that we release the lock before calling
// [super valueForKey:key] which might throw an exception and bypass the JSLock destructor,
// leaving the lock permanently held
- JSLock lock;
+ JSLock lock(false);
- JSValue *result = [self _imp]->get(exec, String(key));
+ JSValue* result = [self _imp]->get(exec, Identifier(exec, String(key)));
if (exec->hadException()) {
- LOG_EXCEPTION(exec);
+ addExceptionToConsole(exec);
result = jsUndefined();
exec->clearException();
}
@@ -403,7 +404,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
if ([resultObj isKindOfClass:[WebUndefined class]])
resultObj = [super valueForKey:key]; // defaults to throwing an exception
- JSLock lock;
+ JSLock lock(false);
_didExecute(self);
return resultObj;
@@ -417,11 +418,11 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
ExecState* exec = [self _rootObject]->globalObject()->globalExec();
ASSERT(!exec->hadException());
- JSLock lock;
- [self _imp]->deleteProperty(exec, String(key));
+ JSLock lock(false);
+ [self _imp]->deleteProperty(exec, Identifier(exec, String(key)));
if (exec->hadException()) {
- LOG_EXCEPTION(exec);
+ addExceptionToConsole(exec);
exec->clearException();
}
@@ -434,7 +435,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
// This is a workaround for a gcc 3.3 internal compiler error.
return @"Undefined";
- JSLock lock;
+ JSLock lock(false);
ExecState* exec = [self _rootObject]->globalObject()->globalExec();
id result = convertValueToObjcValue(exec, [self _imp], ObjcObjectType).objectValue;
@@ -454,11 +455,11 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
ExecState* exec = [self _rootObject]->globalObject()->globalExec();
ASSERT(!exec->hadException());
- JSLock lock;
- JSValue *result = [self _imp]->get(exec, index);
+ JSLock lock(false);
+ JSValue* result = [self _imp]->get(exec, index);
if (exec->hadException()) {
- LOG_EXCEPTION(exec);
+ addExceptionToConsole(exec);
result = jsUndefined();
exec->clearException();
}
@@ -478,11 +479,11 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
ExecState* exec = [self _rootObject]->globalObject()->globalExec();
ASSERT(!exec->hadException());
- JSLock lock;
+ JSLock lock(false);
[self _imp]->put(exec, index, convertObjcValueToValue(exec, &value, ObjcObjectType, [self _rootObject]));
if (exec->hadException()) {
- LOG_EXCEPTION(exec);
+ addExceptionToConsole(exec);
exec->clearException();
}
@@ -493,18 +494,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
{
if (![self _rootObject])
return;
-
- JSLock lock;
-
- ExecState* exec = 0;
- JSObject* globalObject = [self _rootObject]->globalObject();
- ExecStateStack::const_iterator end = ExecState::activeExecStates().end();
- for (ExecStateStack::const_iterator it = ExecState::activeExecStates().begin(); it != end; ++it)
- if ((*it)->dynamicGlobalObject() == globalObject)
- exec = *it;
-
- if (exec)
- throwError(exec, GeneralError, description);
+ ObjcInstance::setGlobalException(description, [self _rootObject]->globalObject());
}
- (JSObjectRef)JSObject
@@ -518,17 +508,17 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
+ (id)_convertValueToObjcValue:(JSValue*)value originRootObject:(RootObject*)originRootObject rootObject:(RootObject*)rootObject
{
if (value->isObject()) {
- JSObject* object = static_cast<JSObject*>(value);
+ JSObject* object = asObject(value);
ExecState* exec = rootObject->globalObject()->globalExec();
- JSLock lock;
+ JSLock lock(false);
- if (object->classInfo() != &RuntimeObjectImp::info) {
- JSValue* runtimeObject = object->get(exec, "__apple_runtime_object");
+ if (object->classInfo() != &RuntimeObjectImp::s_info) {
+ JSValue* runtimeObject = object->get(exec, Identifier(exec, "__apple_runtime_object"));
if (runtimeObject && runtimeObject->isObject())
- object = static_cast<RuntimeObjectImp*>(runtimeObject);
+ object = asObject(runtimeObject);
}
- if (object->classInfo() == &RuntimeObjectImp::info) {
+ if (object->classInfo() == &RuntimeObjectImp::s_info) {
RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(object);
ObjcInstance *instance = static_cast<ObjcInstance*>(imp->getInternalInstance());
if (instance)
@@ -540,8 +530,8 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
}
if (value->isString()) {
- UString u = value->getString();
- return [NSString stringWithCharacters:(const unichar*)u.data() length:u.size()];
+ const UString& u = asString(value)->value();
+ return [NSString stringWithCharacters:u.data() length:u.size()];
}
if (value->isNumber())
@@ -629,7 +619,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
{
}
-- (unsigned)retainCount
+- (NSUInteger)retainCount
{
return UINT_MAX;
}
diff --git a/WebCore/bindings/objc/WebScriptObjectPrivate.h b/WebCore/bindings/objc/WebScriptObjectPrivate.h
index 53982ad..569d6f6 100644
--- a/WebCore/bindings/objc/WebScriptObjectPrivate.h
+++ b/WebCore/bindings/objc/WebScriptObjectPrivate.h
@@ -1,43 +1,70 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
+ *
+ * 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 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 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.
+ */
+
#ifndef _WEB_SCRIPT_OBJECT_PRIVATE_H_
#define _WEB_SCRIPT_OBJECT_PRIVATE_H_
#import "WebScriptObject.h"
+#import <runtime/JSValue.h>
+#import <wtf/PassRefPtr.h>
-#include <JavaScriptCore/internal.h>
-#include <JavaScriptCore/object.h>
-#include <JavaScriptCore/runtime_root.h>
-#include <JavaScriptCore/APICast.h>
-
+namespace JSC {
+
+ class JSObject;
+
+ namespace Bindings {
+ class RootObject;
+ }
+}
namespace WebCore {
- NSObject* getJSWrapper(KJS::JSObject*);
- void addJSWrapper(NSObject* wrapper, KJS::JSObject*);
- void removeJSWrapper(KJS::JSObject*);
- id createJSWrapper(KJS::JSObject*, PassRefPtr<KJS::Bindings::RootObject> origin, PassRefPtr<KJS::Bindings::RootObject> root);
+ NSObject* getJSWrapper(JSC::JSObject*);
+ void addJSWrapper(NSObject* wrapper, JSC::JSObject*);
+ void removeJSWrapper(JSC::JSObject*);
+ id createJSWrapper(JSC::JSObject*, PassRefPtr<JSC::Bindings::RootObject> origin, PassRefPtr<JSC::Bindings::RootObject> root);
}
@interface WebScriptObject (Private)
-+ (id)_convertValueToObjcValue:(KJS::JSValue*)value originRootObject:(KJS::Bindings::RootObject*)originRootObject rootObject:(KJS::Bindings::RootObject*)rootObject;
-+ (id)scriptObjectForJSObject:(JSObjectRef)jsObject originRootObject:(KJS::Bindings::RootObject*)originRootObject rootObject:(KJS::Bindings::RootObject*)rootObject;
++ (id)_convertValueToObjcValue:(JSC::JSValue*)value originRootObject:(JSC::Bindings::RootObject*)originRootObject rootObject:(JSC::Bindings::RootObject*)rootObject;
++ (id)scriptObjectForJSObject:(JSObjectRef)jsObject originRootObject:(JSC::Bindings::RootObject*)originRootObject rootObject:(JSC::Bindings::RootObject*)rootObject;
- (id)_init;
-- (id)_initWithJSObject:(KJS::JSObject*)imp originRootObject:(PassRefPtr<KJS::Bindings::RootObject>)originRootObject rootObject:(PassRefPtr<KJS::Bindings::RootObject>)rootObject;
-- (void)_setImp:(KJS::JSObject*)imp originRootObject:(PassRefPtr<KJS::Bindings::RootObject>)originRootObject rootObject:(PassRefPtr<KJS::Bindings::RootObject>)rootObject;
-- (void)_setOriginRootObject:(PassRefPtr<KJS::Bindings::RootObject>)originRootObject andRootObject:(PassRefPtr<KJS::Bindings::RootObject>)rootObject;
+- (id)_initWithJSObject:(JSC::JSObject*)imp originRootObject:(PassRefPtr<JSC::Bindings::RootObject>)originRootObject rootObject:(PassRefPtr<JSC::Bindings::RootObject>)rootObject;
+- (void)_setImp:(JSC::JSObject*)imp originRootObject:(PassRefPtr<JSC::Bindings::RootObject>)originRootObject rootObject:(PassRefPtr<JSC::Bindings::RootObject>)rootObject;
+- (void)_setOriginRootObject:(PassRefPtr<JSC::Bindings::RootObject>)originRootObject andRootObject:(PassRefPtr<JSC::Bindings::RootObject>)rootObject;
- (void)_initializeScriptDOMNodeImp;
-- (KJS::JSObject *)_imp;
+- (JSC::JSObject *)_imp;
- (BOOL)_hasImp;
-- (KJS::Bindings::RootObject*)_rootObject;
-- (KJS::Bindings::RootObject*)_originRootObject;
+- (JSC::Bindings::RootObject*)_rootObject;
+- (JSC::Bindings::RootObject*)_originRootObject;
@end
@interface WebScriptObjectPrivate : NSObject
{
@public
- KJS::JSObject *imp;
- KJS::Bindings::RootObject* rootObject;
- KJS::Bindings::RootObject* originRootObject;
+ JSC::JSObject *imp;
+ JSC::Bindings::RootObject* rootObject;
+ JSC::Bindings::RootObject* originRootObject;
BOOL isCreatedByDOMWrapper;
}
@end