Commit 4b302f9c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Store nsIDOMCSSStyleSheet in HTMLStyleSheet object if available.

parent 03218d6d
...@@ -1046,7 +1046,7 @@ static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR ...@@ -1046,7 +1046,7 @@ static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR
FIXME("(%p)->(%s %ld %p) semi-stub\n", This, debugstr_w(bstrHref), lIndex, ppnewStyleSheet); FIXME("(%p)->(%s %ld %p) semi-stub\n", This, debugstr_w(bstrHref), lIndex, ppnewStyleSheet);
*ppnewStyleSheet = HTMLStyleSheet_Create(); *ppnewStyleSheet = HTMLStyleSheet_Create(NULL);
return S_OK; return S_OK;
} }
......
...@@ -38,7 +38,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); ...@@ -38,7 +38,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
typedef struct { typedef struct {
const IHTMLStyleSheetVtbl *lpHTMLStyleSheetVtbl; const IHTMLStyleSheetVtbl *lpHTMLStyleSheetVtbl;
LONG ref; LONG ref;
nsIDOMCSSStyleSheet *nsstylesheet;
} HTMLStyleSheet; } HTMLStyleSheet;
typedef struct { typedef struct {
...@@ -470,12 +473,21 @@ static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl = { ...@@ -470,12 +473,21 @@ static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl = {
HTMLStyleSheet_get_rules HTMLStyleSheet_get_rules
}; };
IHTMLStyleSheet *HTMLStyleSheet_Create(void) IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet *nsstylesheet)
{ {
HTMLStyleSheet *ret = mshtml_alloc(sizeof(HTMLStyleSheet)); HTMLStyleSheet *ret = mshtml_alloc(sizeof(HTMLStyleSheet));
nsresult nsres;
ret->lpHTMLStyleSheetVtbl = &HTMLStyleSheetVtbl; ret->lpHTMLStyleSheetVtbl = &HTMLStyleSheetVtbl;
ret->ref = 1; ret->ref = 1;
ret->nsstylesheet = NULL;
if(nsstylesheet) {
nsres = nsIDOMStyleSheet_QueryInterface(nsstylesheet, &IID_nsIDOMCSSStyleSheet,
(void**)&ret->nsstylesheet);
if(NS_FAILED(nsres))
ERR("Could not get nsICSSStyleSheet interface: %08x\n", nsres);
}
return HTMLSTYLESHEET(ret); return HTMLSTYLESHEET(ret);
} }
...@@ -430,7 +430,7 @@ void set_current_mon(HTMLDocument*,IMoniker*); ...@@ -430,7 +430,7 @@ void set_current_mon(HTMLDocument*,IMoniker*);
IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument*,nsISelection*); IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument*,nsISelection*);
IHTMLTxtRange *HTMLTxtRange_Create(HTMLDocument*,nsIDOMRange*); IHTMLTxtRange *HTMLTxtRange_Create(HTMLDocument*,nsIDOMRange*);
IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration*); IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration*);
IHTMLStyleSheet *HTMLStyleSheet_Create(void); IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*);
IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*); IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*);
void detach_selection(HTMLDocument*); void detach_selection(HTMLDocument*);
......
...@@ -123,7 +123,8 @@ typedef nsISupports nsIPrincipal; ...@@ -123,7 +123,8 @@ typedef nsISupports nsIPrincipal;
typedef nsISupports nsIAtom; typedef nsISupports nsIAtom;
typedef nsISupports nsISupportsArray; typedef nsISupports nsISupportsArray;
typedef nsISupports nsIContentFilter; typedef nsISupports nsIContentFilter;
typedef nsISupports nsIDOMStyleSheet; typedef nsISupports nsIDOMMediaList;
typedef nsISupports nsIDOMCSSRuleList;
[ [
object, object,
...@@ -572,6 +573,36 @@ interface nsIDOMCSSStyleDeclaration : nsISupports ...@@ -572,6 +573,36 @@ interface nsIDOMCSSStyleDeclaration : nsISupports
[ [
object, object,
uuid(a6cf9080-15b3-11d2-932e-00805f8add32)
/* FROZEN */
]
interface nsIDOMStyleSheet : nsISupports
{
nsresult GetType(nsAString *aType);
nsresult GetDisabled(PRBool *aDisabled);
nsresult SetDisabled(PRBool aDisabled);
nsresult GetOwnerNode(nsIDOMNode **aOwnerNode);
nsresult GetParentStyleSheet(nsIDOMStyleSheet **aParentStyleSheet);
nsresult GetHref(nsAString *aHref);
nsresult GetTitle(nsAString *aTitle);
nsresult GetMedia(nsIDOMMediaList **aMedia);
}
[
object,
uuid(a6cf90c2-15b3-11d2-932e-00805f8add32)
/* FROZEN */
]
interface nsIDOMCSSStyleSheet : nsIDOMStyleSheet
{
nsresult GetOwnerRule(nsIDOMCSSRule **aOwnerRule);
nsresult GetCssRules(nsIDOMCSSRuleList **aCssRules);
nsresult InsertRule(const nsAString *rule, PRUint32 index, PRUint32 *_retval);
nsresult DeleteRule(PRUint32 index);
}
[
object,
uuid(a6cf9081-15b3-11d2-932e-00805f8add32) uuid(a6cf9081-15b3-11d2-932e-00805f8add32)
/* FROZEN */ /* FROZEN */
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment