diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 039893e4c1a..46838d679c7 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -471,8 +471,10 @@ static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p
static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p)
{
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return IHTMLWindow2_get_frames(&This->window->IHTMLWindow2_iface, p);
}
static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 6ceb9ea79cc..8df47ccde7b 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5913,6 +5913,14 @@ static void test_frameset(IHTMLDocument2 *doc)
test_frames_collection(frames, "fr1");
IHTMLFramesCollection2_Release(frames);
+ hres = IHTMLDocument2_get_frames(doc, &frames);
+ ok(hres == S_OK, "IHTMLDocument2_get_frames failed: 0x%08x\n", hres);
+ if(FAILED(hres))
+ return;
+
+ test_frames_collection(frames, "fr1");
+ IHTMLFramesCollection2_Release(frames);
+
/* test using IHTMLWindow2 inheritance */
test_frames_collection((IHTMLFramesCollection2*)window, "fr2");