diff --git a/package.json b/package.json index edd62eb04c..8ea026706c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "playwright": { "chromium_revision": "724623", "firefox_revision": "1007", - "webkit_revision": "1042" + "webkit_revision": "1043" }, "scripts": { "unit": "node test/test.js", diff --git a/src/webkit/FrameManager.ts b/src/webkit/FrameManager.ts index dbccef357b..74d5d661c8 100644 --- a/src/webkit/FrameManager.ts +++ b/src/webkit/FrameManager.ts @@ -384,7 +384,12 @@ export class FrameManager implements PageDelegate { } async getContentFrame(handle: dom.ElementHandle): Promise { - throw new Error('contentFrame() is not implemented'); + const nodeInfo = await this._session.send('DOM.describeNode', { + objectId: toRemoteObject(handle).objectId + }); + if (!nodeInfo.contentFrameId) + return null; + return this._page._frameManager.frame(nodeInfo.contentFrameId); } isElementHandle(remoteObject: any): boolean { diff --git a/test/elementhandle.spec.js b/test/elementhandle.spec.js index 97d83a1c3e..eb62711245 100644 --- a/test/elementhandle.spec.js +++ b/test/elementhandle.spec.js @@ -67,7 +67,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { }); }); - describe.skip(WEBKIT)('ElementHandle.contentFrame', function() { + describe('ElementHandle.contentFrame', function() { it('should work', async({page,server}) => { await page.goto(server.EMPTY_PAGE); await utils.attachFrame(page, 'frame1', server.EMPTY_PAGE);