diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
| commit | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch) | |
| tree | d49911209b132da58d838efa852daf28d516df21 /WebCore/bindings/objc | |
| parent | 87eb0cb35bad8784770ebc807e6c982432e47107 (diff) | |
| download | external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2 | |
Initial Contribution
Diffstat (limited to 'WebCore/bindings/objc')
| -rw-r--r-- | WebCore/bindings/objc/DOM.mm | 39 | ||||
| -rw-r--r-- | WebCore/bindings/objc/DOMCustomXPathNSResolver.h | 6 | ||||
| -rw-r--r-- | WebCore/bindings/objc/DOMEvents.mm | 46 | ||||
| -rw-r--r-- | WebCore/bindings/objc/DOMHTML.mm | 3 | ||||
| -rw-r--r-- | WebCore/bindings/objc/WebScriptObject.h | 25 | ||||
| -rw-r--r-- | WebCore/bindings/objc/WebScriptObjectPrivate.h | 26 |
6 files changed, 42 insertions, 103 deletions
diff --git a/WebCore/bindings/objc/DOM.mm b/WebCore/bindings/objc/DOM.mm index 4c2605e..93deb23 100644 --- a/WebCore/bindings/objc/DOM.mm +++ b/WebCore/bindings/objc/DOM.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. * Copyright (C) 2006 James G. Speth (speth@end.com) * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) * @@ -74,9 +74,6 @@ #import "DOMSVG.h" #endif -using namespace KJS; -using namespace WebCore; - namespace WebCore { class ObjCEventListener : public EventListener { @@ -579,7 +576,7 @@ static NSArray *kit(const Vector<IntRect>& rects) ASSERT(name); WebCore::Element* element = [self _element]; ASSERT(element); - return element->document()->completeURL(parseURL(element->getAttribute(name))); + return WebCore::KURL(element->document()->completeURL(parseURL(element->getAttribute(name)).deprecatedString())).getNSURL(); } // FIXME: this should be implemented in the implementation @@ -685,16 +682,15 @@ static NSArray *kit(const Vector<IntRect>& rects) @end + //------------------------------------------------------------------------------------------ // ObjCNodeFilterCondition -namespace WebCore { - -class ObjCNodeFilterCondition : public NodeFilterCondition { +class ObjCNodeFilterCondition : public WebCore::NodeFilterCondition { public: ObjCNodeFilterCondition(id <DOMNodeFilter>); virtual ~ObjCNodeFilterCondition(); - virtual short acceptNode(Node*, JSValue*& exception) const; + virtual short acceptNode(WebCore::Node*) const; private: ObjCNodeFilterCondition(const ObjCNodeFilterCondition&); @@ -715,14 +711,13 @@ ObjCNodeFilterCondition::~ObjCNodeFilterCondition() HardRelease(m_filter); } -short ObjCNodeFilterCondition::acceptNode(Node* node, JSValue*&) const +short ObjCNodeFilterCondition::acceptNode(WebCore::Node* node) const { if (!node) - return NodeFilter::FILTER_REJECT; + return WebCore::NodeFilter::FILTER_REJECT; return [m_filter acceptNode:[DOMNode _wrapNode:node]]; } -} // namespace WebCore //------------------------------------------------------------------------------------------ // DOMDocument (DOMDocumentTraversal) @@ -732,23 +727,23 @@ short ObjCNodeFilterCondition::acceptNode(Node* node, JSValue*&) const - (DOMNodeIterator *)createNodeIterator:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences { - RefPtr<NodeFilter> cppFilter; + WebCore::NodeFilter* cppFilter = 0; if (filter) - cppFilter = new NodeFilter(new ObjCNodeFilterCondition(filter)); - ExceptionCode ec = 0; - RefPtr<NodeIterator> impl = [self _document]->createNodeIterator([root _node], whatToShow, cppFilter.release(), expandEntityReferences, ec); - raiseOnDOMError(ec); + 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 { - RefPtr<NodeFilter> cppFilter; + WebCore::NodeFilter* cppFilter = 0; if (filter) - cppFilter = new NodeFilter(new ObjCNodeFilterCondition(filter)); - ExceptionCode ec = 0; - RefPtr<TreeWalker> impl = [self _document]->createTreeWalker([root _node], whatToShow, cppFilter.release(), expandEntityReferences, ec); - raiseOnDOMError(ec); + 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]; } diff --git a/WebCore/bindings/objc/DOMCustomXPathNSResolver.h b/WebCore/bindings/objc/DOMCustomXPathNSResolver.h index 2609e90..47cd939 100644 --- a/WebCore/bindings/objc/DOMCustomXPathNSResolver.h +++ b/WebCore/bindings/objc/DOMCustomXPathNSResolver.h @@ -31,7 +31,6 @@ #include "XPathNSResolver.h" #include "DOMXPathNSResolver.h" -#include <wtf/PassRefPtr.h> namespace WebCore { @@ -39,14 +38,13 @@ namespace WebCore { class DOMCustomXPathNSResolver : public XPathNSResolver { public: - static PassRefPtr<DOMCustomXPathNSResolver> create(id <DOMXPathNSResolver> customResolver) { return adoptRef(new DOMCustomXPathNSResolver(customResolver)); } + DOMCustomXPathNSResolver(id <DOMXPathNSResolver>); virtual ~DOMCustomXPathNSResolver(); virtual String lookupNamespaceURI(const String& prefix); private: - DOMCustomXPathNSResolver(id <DOMXPathNSResolver>); - id <DOMXPathNSResolver> m_customResolver; // DOMCustomXPathNSResolvers are always temporary, thus no need to GC protect the object. + id <DOMXPathNSResolver> m_customResolver; // DOMCustomXPathNSResolvers are always temporary, thus no need to GC protect the object. }; } // namespace WebCore diff --git a/WebCore/bindings/objc/DOMEvents.mm b/WebCore/bindings/objc/DOMEvents.mm index 3b95006..9901049 100644 --- a/WebCore/bindings/objc/DOMEvents.mm +++ b/WebCore/bindings/objc/DOMEvents.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. * Copyright (C) 2006 Jonas Witt <jonas.witt@gmail.com> * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> * @@ -30,20 +30,13 @@ #import "DOMInternal.h" #import "DOMPrivate.h" -#import "DOMProgressEvent.h" #import "Event.h" #import "KeyboardEvent.h" #import "MouseEvent.h" #import "MutationEvent.h" #import "OverflowEvent.h" -#import "ProgressEvent.h" #import "UIEvent.h" -#if ENABLE(CROSS_DOCUMENT_MESSAGING) -#import "DOMMessageEvent.h" -#import "MessageEvent.h" -#endif - #if ENABLE(SVG) #import "DOMSVGZoomEvent.h" #import "SVGZoomEvent.h" @@ -79,33 +72,26 @@ cachedInstance = WebCore::getDOMWrapper(impl); if (cachedInstance) return [[cachedInstance retain] autorelease]; - + Class wrapperClass = nil; - 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 (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 ENABLE(SVG) - else if (impl->isSVGZoomEvent()) - wrapperClass = [DOMSVGZoomEvent class]; + else if (impl->isSVGZoomEvent()) + wrapperClass = [DOMSVGZoomEvent class]; #endif - else - wrapperClass = [DOMUIEvent class]; - } else if (impl->isMutationEvent()) - wrapperClass = [DOMMutationEvent class]; + else if (impl->isUIEvent()) + wrapperClass = [DOMUIEvent class]; else if (impl->isOverflowEvent()) wrapperClass = [DOMOverflowEvent class]; -#if ENABLE(CROSS_DOCUMENT_MESSAGING) - else if (impl->isMessageEvent()) - wrapperClass = [DOMMessageEvent class]; -#endif - else if (impl->isProgressEvent()) - wrapperClass = [DOMProgressEvent class]; else wrapperClass = [DOMEvent class]; diff --git a/WebCore/bindings/objc/DOMHTML.mm b/WebCore/bindings/objc/DOMHTML.mm index bf50e1b..e2fa509 100644 --- a/WebCore/bindings/objc/DOMHTML.mm +++ b/WebCore/bindings/objc/DOMHTML.mm @@ -36,6 +36,7 @@ #import "HTMLDocument.h" #import "HTMLInputElement.h" #import "HTMLObjectElement.h" +#import "KURL.h" #import "Range.h" #import "RenderTextControl.h" #import "markup.h" @@ -62,7 +63,7 @@ - (DOMDocumentFragment *)_createDocumentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString { - NSURL *baseURL = [self _document]->completeURL(WebCore::parseURL(baseURLString)); + NSURL *baseURL = WebCore::KURL([self _document]->completeURL(WebCore::parseURL(baseURLString)).deprecatedString()).getNSURL(); return [self createDocumentFragmentWithMarkupString:markupString baseURL:baseURL]; } diff --git a/WebCore/bindings/objc/WebScriptObject.h b/WebCore/bindings/objc/WebScriptObject.h index 3af774c..9ad04ac 100644 --- a/WebCore/bindings/objc/WebScriptObject.h +++ b/WebCore/bindings/objc/WebScriptObject.h @@ -1,26 +1,7 @@ /* - * 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. + Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. + + Public header file. */ #import <Foundation/Foundation.h> diff --git a/WebCore/bindings/objc/WebScriptObjectPrivate.h b/WebCore/bindings/objc/WebScriptObjectPrivate.h index 421209d..53982ad 100644 --- a/WebCore/bindings/objc/WebScriptObjectPrivate.h +++ b/WebCore/bindings/objc/WebScriptObjectPrivate.h @@ -1,28 +1,6 @@ /* - * 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. - */ - + Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. +*/ #ifndef _WEB_SCRIPT_OBJECT_PRIVATE_H_ #define _WEB_SCRIPT_OBJECT_PRIVATE_H_ |
