1 /* 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006 James G. Speth (speth@end.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28 #import "DOM.h" 29 30 #import "DOMObject.h" 31 #import "HitTestResult.h" 32 33 #if ENABLE(XPATH) 34 #import "DOMXPathExpressionInternal.h" 35 #import "DOMXPathNSResolver.h" 36 #import "DOMXPathResultInternal.h" 37 #endif // ENABLE(XPATH) 38 39 // Auto-generated internal interfaces 40 #import "DOMAbstractViewInternal.h" 41 #import "DOMAttrInternal.h" 42 #import "DOMCDATASectionInternal.h" 43 #import "DOMCSSCharsetRuleInternal.h" 44 #import "DOMCSSFontFaceRuleInternal.h" 45 #import "DOMCSSImportRuleInternal.h" 46 #import "DOMCSSMediaRuleInternal.h" 47 #import "DOMCSSPageRuleInternal.h" 48 #import "DOMCSSPrimitiveValueInternal.h" 49 #import "DOMCSSRuleInternal.h" 50 #import "DOMCSSRuleListInternal.h" 51 #import "DOMCSSStyleDeclarationInternal.h" 52 #import "DOMCSSStyleRuleInternal.h" 53 #import "DOMCSSStyleSheetInternal.h" 54 #import "DOMCSSUnknownRuleInternal.h" 55 #import "DOMCSSValueInternal.h" 56 #import "DOMCSSValueListInternal.h" 57 #import "DOMCSSVariablesRuleInternal.h" 58 #import "DOMCSSVariablesDeclarationInternal.h" 59 #import "DOMCharacterDataInternal.h" 60 #import "DOMCommentInternal.h" 61 #import "DOMCounterInternal.h" 62 #import "DOMDOMImplementationInternal.h" 63 #import "DOMDocumentFragmentInternal.h" 64 #import "DOMDocumentInternal.h" 65 #import "DOMDocumentTypeInternal.h" 66 #import "DOMElementInternal.h" 67 #import "DOMEntityInternal.h" 68 #import "DOMEntityReferenceInternal.h" 69 #import "DOMEventInternal.h" 70 #import "DOMFileInternal.h" 71 #import "DOMFileListInternal.h" 72 #import "DOMHTMLAnchorElementInternal.h" 73 #import "DOMHTMLAppletElementInternal.h" 74 #import "DOMHTMLAreaElementInternal.h" 75 #import "DOMHTMLBRElementInternal.h" 76 #import "DOMHTMLBaseElementInternal.h" 77 #import "DOMHTMLBaseFontElementInternal.h" 78 #import "DOMHTMLBodyElementInternal.h" 79 #import "DOMHTMLButtonElementInternal.h" 80 #import "DOMHTMLCollectionInternal.h" 81 #import "DOMHTMLDListElementInternal.h" 82 #import "DOMHTMLDirectoryElementInternal.h" 83 #import "DOMHTMLDivElementInternal.h" 84 #import "DOMHTMLDocumentInternal.h" 85 #import "DOMHTMLElementInternal.h" 86 #import "DOMHTMLEmbedElementInternal.h" 87 #import "DOMHTMLFieldSetElementInternal.h" 88 #import "DOMHTMLFontElementInternal.h" 89 #import "DOMHTMLFormElementInternal.h" 90 #import "DOMHTMLFrameElementInternal.h" 91 #import "DOMHTMLFrameSetElementInternal.h" 92 #import "DOMHTMLHRElementInternal.h" 93 #import "DOMHTMLHeadElementInternal.h" 94 #import "DOMHTMLHeadingElementInternal.h" 95 #import "DOMHTMLHtmlElementInternal.h" 96 #import "DOMHTMLIFrameElementInternal.h" 97 #import "DOMHTMLImageElementInternal.h" 98 #import "DOMHTMLInputElementInternal.h" 99 #import "DOMHTMLIsIndexElementInternal.h" 100 #import "DOMHTMLLIElementInternal.h" 101 #import "DOMHTMLLabelElementInternal.h" 102 #import "DOMHTMLLegendElementInternal.h" 103 #import "DOMHTMLLinkElementInternal.h" 104 #import "DOMHTMLMapElementInternal.h" 105 #import "DOMHTMLMarqueeElementInternal.h" 106 #import "DOMHTMLMenuElementInternal.h" 107 #import "DOMHTMLMetaElementInternal.h" 108 #import "DOMHTMLModElementInternal.h" 109 #import "DOMHTMLOListElementInternal.h" 110 #import "DOMHTMLObjectElementInternal.h" 111 #import "DOMHTMLOptGroupElementInternal.h" 112 #import "DOMHTMLOptionElementInternal.h" 113 #import "DOMHTMLOptionsCollectionInternal.h" 114 #import "DOMHTMLParagraphElementInternal.h" 115 #import "DOMHTMLParamElementInternal.h" 116 #import "DOMHTMLPreElementInternal.h" 117 #import "DOMHTMLQuoteElementInternal.h" 118 #import "DOMHTMLScriptElementInternal.h" 119 #import "DOMHTMLSelectElementInternal.h" 120 #import "DOMHTMLStyleElementInternal.h" 121 #import "DOMHTMLTableCaptionElementInternal.h" 122 #import "DOMHTMLTableCellElementInternal.h" 123 #import "DOMHTMLTableColElementInternal.h" 124 #import "DOMHTMLTableElementInternal.h" 125 #import "DOMHTMLTableRowElementInternal.h" 126 #import "DOMHTMLTableSectionElementInternal.h" 127 #import "DOMHTMLTextAreaElementInternal.h" 128 #import "DOMHTMLTitleElementInternal.h" 129 #import "DOMHTMLUListElementInternal.h" 130 #import "DOMKeyboardEventInternal.h" 131 #import "DOMMediaListInternal.h" 132 #import "DOMMessagePortInternal.h" 133 #import "DOMMouseEventInternal.h" 134 #import "DOMMutationEventInternal.h" 135 #import "DOMNamedNodeMapInternal.h" 136 #import "DOMNodeInternal.h" 137 #import "DOMNodeIteratorInternal.h" 138 #import "DOMNodeListInternal.h" 139 #import "DOMNotationInternal.h" 140 #import "DOMOverflowEventInternal.h" 141 #import "DOMProcessingInstructionInternal.h" 142 #import "DOMRGBColorInternal.h" 143 #import "DOMRangeInternal.h" 144 #import "DOMRectInternal.h" 145 #import "DOMStyleSheetInternal.h" 146 #import "DOMStyleSheetListInternal.h" 147 #import "DOMTextEventInternal.h" 148 #import "DOMTextInternal.h" 149 #import "DOMTreeWalkerInternal.h" 150 #import "DOMUIEventInternal.h" 151 #import "DOMWebKitCSSKeyframeRuleInternal.h" 152 #import "DOMWebKitCSSKeyframesRuleInternal.h" 153 #import "DOMWebKitCSSMatrixInternal.h" 154 #import "DOMWebKitCSSTransformValueInternal.h" 155 #import "DOMWheelEventInternal.h" 156 157 #if ENABLE(SVG) 158 #import "DOMSVGAElementInternal.h" 159 #import "DOMSVGAltGlyphElementInternal.h" 160 #import "DOMSVGAngleInternal.h" 161 #import "DOMSVGAnimateColorElementInternal.h" 162 #import "DOMSVGAnimateElementInternal.h" 163 #import "DOMSVGAnimateTransformElementInternal.h" 164 #import "DOMSVGAnimatedAngleInternal.h" 165 #import "DOMSVGAnimatedBooleanInternal.h" 166 #import "DOMSVGAnimatedEnumerationInternal.h" 167 #import "DOMSVGAnimatedIntegerInternal.h" 168 #import "DOMSVGAnimatedLengthInternal.h" 169 #import "DOMSVGAnimatedLengthListInternal.h" 170 #import "DOMSVGAnimatedNumberInternal.h" 171 #import "DOMSVGAnimatedNumberListInternal.h" 172 #import "DOMSVGAnimatedPreserveAspectRatioInternal.h" 173 #import "DOMSVGAnimatedRectInternal.h" 174 #import "DOMSVGAnimatedStringInternal.h" 175 #import "DOMSVGAnimatedTransformListInternal.h" 176 #import "DOMSVGAnimationElementInternal.h" 177 #import "DOMSVGCircleElementInternal.h" 178 #import "DOMSVGClipPathElementInternal.h" 179 #import "DOMSVGColorInternal.h" 180 #import "DOMSVGComponentTransferFunctionElementInternal.h" 181 #import "DOMSVGCursorElementInternal.h" 182 #import "DOMSVGDefsElementInternal.h" 183 #import "DOMSVGDefinitionSrcElementInternal.h" 184 #import "DOMSVGDescElementInternal.h" 185 #import "DOMSVGDocumentInternal.h" 186 #import "DOMSVGElementInternal.h" 187 #import "DOMSVGElementInstanceInternal.h" 188 #import "DOMSVGElementInstanceListInternal.h" 189 #import "DOMSVGEllipseElementInternal.h" 190 #import "DOMSVGFEBlendElementInternal.h" 191 #import "DOMSVGFEColorMatrixElementInternal.h" 192 #import "DOMSVGFEComponentTransferElementInternal.h" 193 #import "DOMSVGFECompositeElementInternal.h" 194 #import "DOMSVGFEDiffuseLightingElementInternal.h" 195 #import "DOMSVGFEDisplacementMapElementInternal.h" 196 #import "DOMSVGFEDistantLightElementInternal.h" 197 #import "DOMSVGFEFloodElementInternal.h" 198 #import "DOMSVGFEFuncAElementInternal.h" 199 #import "DOMSVGFEFuncBElementInternal.h" 200 #import "DOMSVGFEFuncGElementInternal.h" 201 #import "DOMSVGFEFuncRElementInternal.h" 202 #import "DOMSVGFEGaussianBlurElementInternal.h" 203 #import "DOMSVGFEImageElementInternal.h" 204 #import "DOMSVGFEMergeElementInternal.h" 205 #import "DOMSVGFEMergeNodeElementInternal.h" 206 #import "DOMSVGFEOffsetElementInternal.h" 207 #import "DOMSVGFEPointLightElementInternal.h" 208 #import "DOMSVGFESpecularLightingElementInternal.h" 209 #import "DOMSVGFESpotLightElementInternal.h" 210 #import "DOMSVGFETileElementInternal.h" 211 #import "DOMSVGFETurbulenceElementInternal.h" 212 #import "DOMSVGFilterElementInternal.h" 213 #import "DOMSVGFontElementInternal.h" 214 #import "DOMSVGFontFaceElementInternal.h" 215 #import "DOMSVGFontFaceFormatElementInternal.h" 216 #import "DOMSVGFontFaceNameElementInternal.h" 217 #import "DOMSVGFontFaceSrcElementInternal.h" 218 #import "DOMSVGFontFaceUriElementInternal.h" 219 #import "DOMSVGForeignObjectElementInternal.h" 220 #import "DOMSVGGElementInternal.h" 221 #import "DOMSVGGlyphElementInternal.h" 222 #import "DOMSVGGradientElementInternal.h" 223 #import "DOMSVGImageElementInternal.h" 224 #import "DOMSVGLengthInternal.h" 225 #import "DOMSVGLengthListInternal.h" 226 #import "DOMSVGLineElementInternal.h" 227 #import "DOMSVGLinearGradientElementInternal.h" 228 #import "DOMSVGMarkerElementInternal.h" 229 #import "DOMSVGMaskElementInternal.h" 230 #import "DOMSVGMatrixInternal.h" 231 #import "DOMSVGMetadataElementInternal.h" 232 #import "DOMSVGMissingGlyphElementInternal.h" 233 #import "DOMSVGNumberInternal.h" 234 #import "DOMSVGNumberListInternal.h" 235 #import "DOMSVGPaintInternal.h" 236 #import "DOMSVGPathElementInternal.h" 237 #import "DOMSVGPathSegArcAbsInternal.h" 238 #import "DOMSVGPathSegArcRelInternal.h" 239 #import "DOMSVGPathSegClosePathInternal.h" 240 #import "DOMSVGPathSegCurvetoCubicAbsInternal.h" 241 #import "DOMSVGPathSegCurvetoCubicRelInternal.h" 242 #import "DOMSVGPathSegCurvetoCubicSmoothAbsInternal.h" 243 #import "DOMSVGPathSegCurvetoCubicSmoothRelInternal.h" 244 #import "DOMSVGPathSegCurvetoQuadraticAbsInternal.h" 245 #import "DOMSVGPathSegCurvetoQuadraticRelInternal.h" 246 #import "DOMSVGPathSegCurvetoQuadraticSmoothAbsInternal.h" 247 #import "DOMSVGPathSegCurvetoQuadraticSmoothRelInternal.h" 248 #import "DOMSVGPathSegInternal.h" 249 #import "DOMSVGPathSegLinetoAbsInternal.h" 250 #import "DOMSVGPathSegLinetoHorizontalAbsInternal.h" 251 #import "DOMSVGPathSegLinetoHorizontalRelInternal.h" 252 #import "DOMSVGPathSegLinetoRelInternal.h" 253 #import "DOMSVGPathSegLinetoVerticalAbsInternal.h" 254 #import "DOMSVGPathSegLinetoVerticalRelInternal.h" 255 #import "DOMSVGPathSegListInternal.h" 256 #import "DOMSVGPathSegMovetoAbsInternal.h" 257 #import "DOMSVGPathSegMovetoRelInternal.h" 258 #import "DOMSVGPatternElementInternal.h" 259 #import "DOMSVGPointInternal.h" 260 #import "DOMSVGPointListInternal.h" 261 #import "DOMSVGPolygonElementInternal.h" 262 #import "DOMSVGPolylineElementInternal.h" 263 #import "DOMSVGPreserveAspectRatioInternal.h" 264 #import "DOMSVGRadialGradientElementInternal.h" 265 #import "DOMSVGRectElementInternal.h" 266 #import "DOMSVGRectInternal.h" 267 #import "DOMSVGRenderingIntentInternal.h" 268 #import "DOMSVGSVGElementInternal.h" 269 #import "DOMSVGScriptElementInternal.h" 270 #import "DOMSVGSetElementInternal.h" 271 #import "DOMSVGStopElementInternal.h" 272 #import "DOMSVGStringListInternal.h" 273 #import "DOMSVGStyleElementInternal.h" 274 #import "DOMSVGSwitchElementInternal.h" 275 #import "DOMSVGSymbolElementInternal.h" 276 #import "DOMSVGTRefElementInternal.h" 277 #import "DOMSVGTSpanElementInternal.h" 278 #import "DOMSVGTextContentElementInternal.h" 279 #import "DOMSVGTextElementInternal.h" 280 #import "DOMSVGTextPathElementInternal.h" 281 #import "DOMSVGTextPositioningElementInternal.h" 282 #import "DOMSVGTitleElementInternal.h" 283 #import "DOMSVGTransformInternal.h" 284 #import "DOMSVGTransformListInternal.h" 285 #import "DOMSVGUnitTypesInternal.h" 286 #import "DOMSVGUseElementInternal.h" 287 #import "DOMSVGViewElementInternal.h" 288 #import "DOMSVGZoomEventInternal.h" 289 #endif // ENABLE(SVG) 290 291 namespace JSC { 292 class JSObject; 293 294 namespace Bindings { 295 class RootObject; 296 } 297 } 298 299 namespace WebCore { 300 class NodeFilter; 301 302 #if ENABLE(SVG) 303 class TransformationMatrix; 304 class FloatPoint; 305 class FloatRect; 306 #endif // ENABLE(SVG) 307 308 #if ENABLE(XPATH) 309 class XPathNSResolver; 310 #endif // ENABLE(XPATH) 311 } 312 313 // Core Internal Interfaces 314 315 @interface DOMObject (WebCoreInternal) 316 - (id)_init; 317 @end 318 319 // Traversal Internal Interfaces 320 321 @interface DOMNodeFilter : DOMObject <DOMNodeFilter> 322 + (DOMNodeFilter *)_wrapNodeFilter:(WebCore::NodeFilter *)impl; 323 @end 324 325 #if ENABLE(XPATH) 326 327 // XPath Internal Interfaces 328 329 @interface DOMNativeXPathNSResolver : DOMObject <DOMXPathNSResolver> 330 + (DOMNativeXPathNSResolver *)_wrapXPathNSResolver:(WebCore::XPathNSResolver *)impl; 331 - (WebCore::XPathNSResolver *)_xpathNSResolver; 332 @end 333 334 #endif // ENABLE(XPATH) 335 336 // Helper functions for DOM wrappers and gluing to Objective-C 337 338 namespace WebCore { 339 340 // Create an NSMapTable mapping from pointers to ObjC objects held with zeroing weak references. 341 NSMapTable* createWrapperCache(); 342 NSMapTable* createWrapperCacheWithIntegerKeys(); // Same, but from integers to ObjC objects. 343 344 id createDOMWrapper(JSC::JSObject*, PassRefPtr<JSC::Bindings::RootObject> origin, PassRefPtr<JSC::Bindings::RootObject> current); 345 346 NSObject* getDOMWrapper(DOMObjectInternal*); 347 void addDOMWrapper(NSObject* wrapper, DOMObjectInternal*); 348 void removeDOMWrapper(DOMObjectInternal*); 349 350 template <class Source> getDOMWrapper(Source impl)351 inline id getDOMWrapper(Source impl) 352 { 353 return getDOMWrapper(reinterpret_cast<DOMObjectInternal*>(impl)); 354 } 355 356 template <class Source> addDOMWrapper(NSObject * wrapper,Source impl)357 inline void addDOMWrapper(NSObject* wrapper, Source impl) 358 { 359 addDOMWrapper(wrapper, reinterpret_cast<DOMObjectInternal*>(impl)); 360 } 361 362 } // namespace WebCore 363