Changeset 138747 in webkit
- Timestamp:
- Jan 3, 2013, 3:01:23 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r138746 r138747 1 2013-01-03 Dan Bernstein <mitz@apple.com> 2 3 No way to obtain a DOMNode given a JS wrapper for a Node 4 https://bugs.webkit.org/show_bug.cgi?id=106033 5 6 Reviewed by Sam Weinig. 7 8 Test: TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm. 9 10 * bindings/objc/DOM.mm: 11 (+[DOMNode _nodeFromJSWrapper:]): Added. If the given JSObjectRef is a wrapper for a Node, 12 returns the Objective-C wrapper for that node. Note that Objective-C wrappers are always 13 for the main world, regardless of which world the given JS wrapper comes from. 14 * bindings/objc/DOMPrivate.h: Added declaration of the above. 15 1 16 2013-01-03 Uday Kiran <udaykiran@motorola.com> 2 17 -
trunk/Source/WebCore/bindings/objc/DOM.mm
r132282 r138747 41 41 #import "HTMLParserIdioms.h" 42 42 #import "Image.h" 43 #import "JSNode.h" 43 44 #import "NodeFilter.h" 44 45 #import "RenderImage.h" 45 46 #import "WebScriptObjectPrivate.h" 47 #import <JavaScriptCore/APICast.h> 46 48 #import <wtf/HashMap.h> 47 49 … … 390 392 @end 391 393 394 @implementation DOMNode (WebPrivate) 395 396 + (id)_nodeFromJSWrapper:(JSObjectRef)jsWrapper 397 { 398 JSObject* object = toJS(jsWrapper); 399 400 if (!object->inherits(&JSNode::s_info)) 401 return nil; 402 403 WebCore::Node* node = jsCast<JSNode*>(object)->impl(); 404 return kit(node); 405 } 406 407 @end 408 392 409 @implementation DOMRange (DOMRangeExtensions) 393 410 -
trunk/Source/WebCore/bindings/objc/DOMPrivate.h
r112424 r138747 30 30 - (NSImage *)renderedImage; 31 31 - (NSArray *)textRects; 32 @end 33 34 @interface DOMNode (WebPrivate) 35 + (id)_nodeFromJSWrapper:(JSObjectRef)jsWrapper; 32 36 @end 33 37 -
trunk/Tools/ChangeLog
r138736 r138747 1 2013-01-03 Dan Bernstein <mitz@apple.com> 2 3 No way to obtain a DOMNode given a JS wrapper for a Node 4 https://bugs.webkit.org/show_bug.cgi?id=106033 5 6 Added a test for +[DOMNode _nodeFromJSWrapper:]. 7 8 Reviewed by Sam Weinig. 9 10 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 11 * TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm: Added. 12 (TestWebKitAPI): 13 (TestWebKitAPI::TEST): 14 1 15 2013-01-03 Emil A Eklund <eae@chromium.org> 2 16 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r138104 r138747 46 46 37200B9213A16230007A4FAD /* VectorReverse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37200B9113A16230007A4FAD /* VectorReverse.cpp */; }; 47 47 3722C8691461E03E00C45D00 /* RenderedImageFromDOMRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */; }; 48 3751AF7C169518F800764319 /* DOMNodeFromJSObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3751AF7A169518F800764319 /* DOMNodeFromJSObject.mm */; }; 48 49 3776BC63150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */; }; 49 50 378E64731632646D00B6C676 /* InjectedBundleFrameHitTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378E64711632646D00B6C676 /* InjectedBundleFrameHitTest.cpp */; }; … … 295 296 37200B9113A16230007A4FAD /* VectorReverse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VectorReverse.cpp; path = WTF/VectorReverse.cpp; sourceTree = "<group>"; }; 296 297 3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderedImageFromDOMRange.mm; sourceTree = "<group>"; }; 298 3751AF7A169518F800764319 /* DOMNodeFromJSObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMNodeFromJSObject.mm; sourceTree = "<group>"; }; 297 299 3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeviceScaleFactorInDashboardRegions.mm; sourceTree = "<group>"; }; 298 300 378E64711632646D00B6C676 /* InjectedBundleFrameHitTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleFrameHitTest.cpp; sourceTree = "<group>"; }; … … 758 760 26DF5A5D15A29BAA003689C2 /* CancelLoadFromResourceLoadDelegate.mm */, 759 761 5142B2701517C88B00C32B19 /* ContextMenuCanCopyURL.mm */, 762 3751AF7A169518F800764319 /* DOMNodeFromJSObject.mm */, 760 763 37DC678B140D7C5000ABCCDB /* DOMRangeOfString.mm */, 761 764 C07E6CAE13FD67650038B22B /* DynamicDeviceScaleFactor.mm */, … … 1043 1046 4BB4160216815B2600824238 /* JSWrapperForNodeInWebFrame.mm in Sources */, 1044 1047 4BB4160416815F9100824238 /* ElementAtPointInWebFrame.mm in Sources */, 1048 3751AF7C169518F800764319 /* DOMNodeFromJSObject.mm in Sources */, 1045 1049 ); 1046 1050 runOnlyForDeploymentPostprocessing = 0;
Note:
See TracChangeset
for help on using the changeset viewer.