2012-10-15 11:16:30 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
2016-06-23 15:32:56 +02:00
|
|
|
#include "htmlevent.h"
|
2012-10-15 11:16:30 +02:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2017-04-13 16:05:11 +02:00
|
|
|
struct HTMLLinkElement {
|
2012-10-15 11:16:30 +02:00
|
|
|
HTMLElement element;
|
|
|
|
IHTMLLinkElement IHTMLLinkElement_iface;
|
2012-10-15 11:16:51 +02:00
|
|
|
|
|
|
|
nsIDOMHTMLLinkElement *nslink;
|
2017-04-13 16:05:11 +02:00
|
|
|
};
|
2012-10-15 11:16:30 +02:00
|
|
|
|
|
|
|
static inline HTMLLinkElement *impl_from_IHTMLLinkElement(IHTMLLinkElement *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLLinkElement, IHTMLLinkElement_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_QueryInterface(IHTMLLinkElement *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLLinkElement_AddRef(IHTMLLinkElement *iface)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLLinkElement_Release(IHTMLLinkElement *iface)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_GetTypeInfoCount(IHTMLLinkElement *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_GetTypeInfo(IHTMLLinkElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
2012-10-15 11:16:30 +02:00
|
|
|
ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_GetIDsOfNames(IHTMLLinkElement *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
2012-10-15 11:16:30 +02:00
|
|
|
cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_Invoke(IHTMLLinkElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
2012-10-15 11:16:30 +02:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_put_href(IHTMLLinkElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2012-10-15 11:17:42 +02:00
|
|
|
nsAString href_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&href_str, v);
|
|
|
|
nsres = nsIDOMHTMLLinkElement_SetHref(This->nslink, &href_str);
|
|
|
|
nsAString_Finish(&href_str);
|
|
|
|
|
|
|
|
return NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_href(IHTMLLinkElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2012-10-15 11:17:42 +02:00
|
|
|
nsAString href_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&href_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLLinkElement_GetHref(This->nslink, &href_str);
|
|
|
|
return return_nsstr(nsres, &href_str, p);
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_put_rel(IHTMLLinkElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2012-10-15 11:17:10 +02:00
|
|
|
nsAString rel_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&rel_str, v);
|
|
|
|
nsres = nsIDOMHTMLLinkElement_SetRel(This->nslink, &rel_str);
|
|
|
|
nsAString_Finish(&rel_str);
|
|
|
|
|
|
|
|
return NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_rel(IHTMLLinkElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2012-10-15 11:17:10 +02:00
|
|
|
nsAString rel_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&rel_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLLinkElement_GetRel(This->nslink, &rel_str);
|
|
|
|
return return_nsstr(nsres, &rel_str, p);
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_put_rev(IHTMLLinkElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2014-08-22 14:48:48 +02:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&nsstr, v);
|
|
|
|
nsres = nsIDOMHTMLLinkElement_SetRev(This->nslink, &nsstr);
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("SetRev failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_rev(IHTMLLinkElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2014-08-22 14:48:48 +02:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
nsres = nsIDOMHTMLLinkElement_GetRev(This->nslink, &nsstr);
|
|
|
|
return return_nsstr(nsres, &nsstr, p);
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_put_type(IHTMLLinkElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2012-10-15 11:17:24 +02:00
|
|
|
nsAString type_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&type_str, v);
|
|
|
|
nsres = nsIDOMHTMLLinkElement_SetType(This->nslink, &type_str);
|
|
|
|
nsAString_Finish(&type_str);
|
|
|
|
|
|
|
|
return NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_type(IHTMLLinkElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2012-10-15 11:17:24 +02:00
|
|
|
nsAString type_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&type_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLLinkElement_GetType(This->nslink, &type_str);
|
|
|
|
return return_nsstr(nsres, &type_str, p);
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_readyState(IHTMLLinkElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_put_onreadystatechange(IHTMLLinkElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_onreadystatechange(IHTMLLinkElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_put_onload(IHTMLLinkElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2016-06-23 15:32:56 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_node_event(&This->element.node, EVENTID_LOAD, &v);
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_onload(IHTMLLinkElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2016-06-23 15:32:56 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_node_event(&This->element.node, EVENTID_LOAD, p);
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_put_onerror(IHTMLLinkElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_onerror(IHTMLLinkElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_styleSheet(IHTMLLinkElement *iface, IHTMLStyleSheet **p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_put_disabled(IHTMLLinkElement *iface, VARIANT_BOOL v)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2012-10-15 11:16:51 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, v);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLLinkElement_SetDisabled(This->nslink, !!v);
|
|
|
|
return SUCCEEDED(nsres) ? S_OK : E_FAIL;
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_disabled(IHTMLLinkElement *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2012-10-15 11:16:51 +02:00
|
|
|
cpp_bool ret;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLLinkElement_GetDisabled(This->nslink, &ret);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
return E_FAIL;
|
|
|
|
|
2017-11-02 16:48:02 +01:00
|
|
|
*p = variant_bool(ret);
|
2012-10-15 11:16:51 +02:00
|
|
|
return S_OK;
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_put_media(IHTMLLinkElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2014-05-19 15:45:05 +02:00
|
|
|
nsresult nsres;
|
|
|
|
nsAString str;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&str, v);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLLinkElement_SetMedia(This->nslink, &str);
|
|
|
|
nsAString_Finish(&str);
|
|
|
|
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Set Media(%s) failed: %08x\n", debugstr_w(v), nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLLinkElement_get_media(IHTMLLinkElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
|
2014-05-19 15:45:05 +02:00
|
|
|
nsresult nsres;
|
|
|
|
nsAString str;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&str, NULL);
|
|
|
|
nsres = nsIDOMHTMLLinkElement_GetMedia(This->nslink, &str);
|
|
|
|
|
|
|
|
return return_nsstr(nsres, &str, p);
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLLinkElementVtbl HTMLLinkElementVtbl = {
|
|
|
|
HTMLLinkElement_QueryInterface,
|
|
|
|
HTMLLinkElement_AddRef,
|
|
|
|
HTMLLinkElement_Release,
|
|
|
|
HTMLLinkElement_GetTypeInfoCount,
|
|
|
|
HTMLLinkElement_GetTypeInfo,
|
|
|
|
HTMLLinkElement_GetIDsOfNames,
|
|
|
|
HTMLLinkElement_Invoke,
|
|
|
|
HTMLLinkElement_put_href,
|
|
|
|
HTMLLinkElement_get_href,
|
|
|
|
HTMLLinkElement_put_rel,
|
|
|
|
HTMLLinkElement_get_rel,
|
|
|
|
HTMLLinkElement_put_rev,
|
|
|
|
HTMLLinkElement_get_rev,
|
|
|
|
HTMLLinkElement_put_type,
|
|
|
|
HTMLLinkElement_get_type,
|
|
|
|
HTMLLinkElement_get_readyState,
|
|
|
|
HTMLLinkElement_put_onreadystatechange,
|
|
|
|
HTMLLinkElement_get_onreadystatechange,
|
|
|
|
HTMLLinkElement_put_onload,
|
|
|
|
HTMLLinkElement_get_onload,
|
|
|
|
HTMLLinkElement_put_onerror,
|
|
|
|
HTMLLinkElement_get_onerror,
|
|
|
|
HTMLLinkElement_get_styleSheet,
|
|
|
|
HTMLLinkElement_put_disabled,
|
|
|
|
HTMLLinkElement_get_disabled,
|
|
|
|
HTMLLinkElement_put_media,
|
|
|
|
HTMLLinkElement_get_media
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline HTMLLinkElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLLinkElement, element.node);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT HTMLLinkElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IHTMLLinkElement, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLLinkElement %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IHTMLLinkElement_iface;
|
|
|
|
}else {
|
|
|
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-10-15 11:16:51 +02:00
|
|
|
static HRESULT HTMLLinkElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
|
2012-10-15 11:16:30 +02:00
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_HTMLDOMNode(iface);
|
2012-10-15 11:16:51 +02:00
|
|
|
return IHTMLLinkElement_put_disabled(&This->IHTMLLinkElement_iface, v);
|
|
|
|
}
|
2012-10-15 11:16:30 +02:00
|
|
|
|
2012-10-15 11:16:51 +02:00
|
|
|
static HRESULT HTMLLinkElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
return IHTMLLinkElement_get_disabled(&This->IHTMLLinkElement_iface, p);
|
2012-10-15 11:16:30 +02:00
|
|
|
}
|
|
|
|
|
2014-09-24 16:05:40 +02:00
|
|
|
static void HTMLLinkElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nslink)
|
|
|
|
note_cc_edge((nsISupports*)This->nslink, "This->nslink", cb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLLinkElement_unlink(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
HTMLLinkElement *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nslink) {
|
|
|
|
nsIDOMHTMLLinkElement *nslink = This->nslink;
|
|
|
|
|
|
|
|
This->nslink = NULL;
|
|
|
|
nsIDOMHTMLLinkElement_Release(nslink);
|
|
|
|
}
|
|
|
|
}
|
2012-10-15 11:16:30 +02:00
|
|
|
static const NodeImplVtbl HTMLLinkElementImplVtbl = {
|
2017-04-21 13:50:49 +02:00
|
|
|
&CLSID_HTMLLinkElement,
|
2012-10-15 11:16:30 +02:00
|
|
|
HTMLLinkElement_QI,
|
2012-10-15 11:16:51 +02:00
|
|
|
HTMLElement_destructor,
|
2013-03-15 15:01:53 +01:00
|
|
|
HTMLElement_cpc,
|
2012-10-15 11:16:30 +02:00
|
|
|
HTMLElement_clone,
|
|
|
|
HTMLElement_handle_event,
|
2012-10-15 11:16:51 +02:00
|
|
|
HTMLElement_get_attr_col,
|
|
|
|
NULL,
|
|
|
|
HTMLLinkElementImpl_put_disabled,
|
|
|
|
HTMLLinkElementImpl_get_disabled,
|
2014-09-24 16:05:40 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
HTMLLinkElement_traverse,
|
|
|
|
HTMLLinkElement_unlink
|
2012-10-15 11:16:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t HTMLLinkElement_iface_tids[] = {
|
|
|
|
HTMLELEMENT_TIDS,
|
|
|
|
IHTMLLinkElement_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLLinkElement_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLLinkElement_tid,
|
2016-07-07 12:50:18 +02:00
|
|
|
HTMLLinkElement_iface_tids,
|
|
|
|
HTMLElement_init_dispex_info
|
2012-10-15 11:16:30 +02:00
|
|
|
};
|
|
|
|
|
2018-02-12 01:29:41 +01:00
|
|
|
HRESULT HTMLLinkElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
|
2012-10-15 11:16:30 +02:00
|
|
|
{
|
|
|
|
HTMLLinkElement *ret;
|
2012-10-15 11:16:51 +02:00
|
|
|
nsresult nsres;
|
2012-10-15 11:16:30 +02:00
|
|
|
|
|
|
|
ret = heap_alloc_zero(sizeof(*ret));
|
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
ret->IHTMLLinkElement_iface.lpVtbl = &HTMLLinkElementVtbl;
|
|
|
|
ret->element.node.vtbl = &HTMLLinkElementImplVtbl;
|
|
|
|
|
|
|
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLLinkElement_dispex);
|
|
|
|
|
2018-02-12 01:29:41 +01:00
|
|
|
nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLLinkElement, (void**)&ret->nslink);
|
2014-09-24 16:05:40 +02:00
|
|
|
assert(nsres == NS_OK);
|
2012-10-15 11:16:51 +02:00
|
|
|
|
2012-10-15 11:16:30 +02:00
|
|
|
*elem = &ret->element;
|
|
|
|
return S_OK;
|
|
|
|
}
|