Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ebd918eb
Commit
ebd918eb
authored
Sep 19, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added get_styleSheets implementation.
parent
5071f124
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
207 additions
and
4 deletions
+207
-4
htmldoc.c
dlls/mshtml/htmldoc.c
+33
-3
htmlstylesheet.c
dlls/mshtml/htmlstylesheet.c
+151
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsiface.idl
dlls/mshtml/nsiface.idl
+22
-0
No files found.
dlls/mshtml/htmldoc.c
View file @
ebd918eb
...
...
@@ -951,10 +951,40 @@ static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTML
}
static
HRESULT
WINAPI
HTMLDocument_get_styleSheets
(
IHTMLDocument2
*
iface
,
IHTMLStyleSheetsCollection
**
p
)
IHTMLStyleSheetsCollection
**
p
)
{
FIXME
(
"(%p)->(%p)
\n
"
,
iface
,
p
);
return
E_NOTIMPL
;
HTMLDocument
*
This
=
HTMLDOC_THIS
(
iface
);
nsIDOMStyleSheetList
*
nsstylelist
;
nsIDOMDocumentStyle
*
nsdocstyle
;
nsIDOMDocument
*
nsdoc
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
*
p
=
NULL
;
if
(
!
This
->
nscontainer
)
return
S_OK
;
nsres
=
nsIWebNavigation_GetDocument
(
This
->
nscontainer
->
navigation
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetDocument failed: %08x
\n
"
,
nsres
);
return
S_OK
;
}
if
(
NS_FAILED
(
nsres
)
||
!
nsdoc
)
return
S_OK
;
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMDocumentStyle
,
(
void
**
)
&
nsdocstyle
);
nsIDOMDocument_Release
(
nsdoc
);
nsIDOMDocumentStyle_GetStyleSheets
(
nsdocstyle
,
&
nsstylelist
);
nsIDOMDocumentStyle_Release
(
nsdocstyle
);
*
p
=
HTMLStyleSheetsCollection_Create
(
nsstylelist
);
nsIDOMDocumentStyle_Release
(
nsstylelist
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDocument_put_onbeforeupdate
(
IHTMLDocument2
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/htmlstylesheet.c
View file @
ebd918eb
...
...
@@ -41,7 +41,157 @@ typedef struct {
LONG
ref
;
}
HTMLStyleSheet
;
#define HTMLSTYLESHEET(x) ((IHTMLStyleSheet*) &(x)->lpHTMLStyleSheetVtbl);
typedef
struct
{
const
IHTMLStyleSheetsCollectionVtbl
*
lpHTMLStyleSheetsCollectionVtbl
;
LONG
ref
;
nsIDOMStyleSheetList
*
nslist
;
}
HTMLStyleSheetsCollection
;
#define HTMLSTYLESHEET(x) ((IHTMLStyleSheet*) &(x)->lpHTMLStyleSheetVtbl);
#define HTMLSTYLESHEETSCOL(x) ((IHTMLStyleSheetsCollection*) &(x)->lpHTMLStyleSheetsCollectionVtbl);
#define HTMLSTYLESHEETSCOL_THIS(iface) \
DEFINE_THIS(HTMLStyleSheetsCollection, HTMLStyleSheetsCollection, iface)
static
HRESULT
WINAPI
HTMLStyleSheetsCollection_QueryInterface
(
IHTMLStyleSheetsCollection
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
HTMLSTYLESHEETSCOL
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IDispatch
,
riid
))
{
TRACE
(
"(%p)->(IID_IDispatch %p)
\n
"
,
This
,
ppv
);
*
ppv
=
HTMLSTYLESHEETSCOL
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IHTMLStyleSheetsCollection
,
riid
))
{
TRACE
(
"(%p)->(IID_IHTMLStyleSheetsCollection %p)
\n
"
,
This
,
ppv
);
*
ppv
=
HTMLSTYLESHEETSCOL
(
This
);
}
if
(
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
WARN
(
"unsupported %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
HTMLStyleSheetsCollection_AddRef
(
IHTMLStyleSheetsCollection
*
iface
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
HTMLStyleSheetsCollection_Release
(
IHTMLStyleSheetsCollection
*
iface
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
mshtml_free
(
This
);
return
ref
;
}
static
HRESULT
WINAPI
HTMLStyleSheetsCollection_GetTypeInfoCount
(
IHTMLStyleSheetsCollection
*
iface
,
UINT
*
pctinfo
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pctinfo
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLStyleSheetsCollection_GetTypeInfo
(
IHTMLStyleSheetsCollection
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
FIXME
(
"(%p)->(%u %u %p)
\n
"
,
This
,
iTInfo
,
lcid
,
ppTInfo
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLStyleSheetsCollection_GetIDsOfNames
(
IHTMLStyleSheetsCollection
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
FIXME
(
"(%p)->(%s %p %u %u %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
rgszNames
,
cNames
,
lcid
,
rgDispId
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLStyleSheetsCollection_Invoke
(
IHTMLStyleSheetsCollection
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
FIXME
(
"(%p)->(%d %s %d %d %p %p %p %p)
\n
"
,
This
,
dispIdMember
,
debugstr_guid
(
riid
),
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLStyleSheetsCollection_get_length
(
IHTMLStyleSheetsCollection
*
iface
,
long
*
p
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLStyleSheetsCollection_get__newEnum
(
IHTMLStyleSheetsCollection
*
iface
,
IUnknown
**
p
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLStyleSheetsCollection_item
(
IHTMLStyleSheetsCollection
*
iface
,
VARIANT
*
pvarIndex
,
VARIANT
*
pvarResult
)
{
HTMLStyleSheetsCollection
*
This
=
HTMLSTYLESHEETSCOL_THIS
(
iface
);
FIXME
(
"(%p)->(%p %p)
\n
"
,
This
,
pvarIndex
,
pvarResult
);
return
E_NOTIMPL
;
}
#undef HTMLSTYLESHEETSCOL_THIS
static
const
IHTMLStyleSheetsCollectionVtbl
HTMLStyleSheetsCollectionVtbl
=
{
HTMLStyleSheetsCollection_QueryInterface
,
HTMLStyleSheetsCollection_AddRef
,
HTMLStyleSheetsCollection_Release
,
HTMLStyleSheetsCollection_GetTypeInfoCount
,
HTMLStyleSheetsCollection_GetTypeInfo
,
HTMLStyleSheetsCollection_GetIDsOfNames
,
HTMLStyleSheetsCollection_Invoke
,
HTMLStyleSheetsCollection_get_length
,
HTMLStyleSheetsCollection_get__newEnum
,
HTMLStyleSheetsCollection_item
};
IHTMLStyleSheetsCollection
*
HTMLStyleSheetsCollection_Create
(
nsIDOMStyleSheetList
*
nslist
)
{
HTMLStyleSheetsCollection
*
ret
=
mshtml_alloc
(
sizeof
(
HTMLStyleSheetsCollection
));
ret
->
lpHTMLStyleSheetsCollectionVtbl
=
&
HTMLStyleSheetsCollectionVtbl
;
ret
->
ref
=
1
;
if
(
nslist
)
nsIDOMStyleSheetList_AddRef
(
nslist
);
ret
->
nslist
=
nslist
;
return
HTMLSTYLESHEETSCOL
(
ret
);
}
#define HTMLSTYLESHEET_THIS(iface) DEFINE_THIS(HTMLStyleSheet, HTMLStyleSheet, iface)
...
...
dlls/mshtml/mshtml_private.h
View file @
ebd918eb
...
...
@@ -406,6 +406,7 @@ IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument*,nsISelection*);
IHTMLTxtRange
*
HTMLTxtRange_Create
(
HTMLDocument
*
,
nsIDOMRange
*
);
IHTMLStyle
*
HTMLStyle_Create
(
nsIDOMCSSStyleDeclaration
*
);
IHTMLStyleSheet
*
HTMLStyleSheet_Create
(
void
);
IHTMLStyleSheetsCollection
*
HTMLStyleSheetsCollection_Create
(
nsIDOMStyleSheetList
*
);
void
detach_selection
(
HTMLDocument
*
);
void
detach_ranges
(
HTMLDocument
*
);
...
...
dlls/mshtml/nsiface.idl
View file @
ebd918eb
...
...
@@ -123,6 +123,7 @@ typedef nsISupports nsIPrincipal;
typedef nsISupports nsIAtom;
typedef nsISupports nsISupportsArray;
typedef nsISupports nsIContentFilter;
typedef nsISupports nsIDOMStyleSheet;
[
object,
...
...
@@ -571,6 +572,17 @@ interface nsIDOMCSSStyleDeclaration : nsISupports
[
object,
uuid(a6cf9081-15b3-11d2-932e-00805f8add32)
/* FROZEN */
]
interface nsIDOMStyleSheetList : nsISupports
{
nsresult GetLength(PRUint32 *aLength);
nsresult Item(PRUint32 index, nsIDOMStyleSheet **_retval);
}
[
object,
uuid(a6cf907d-15b3-11d2-932e-00805f8add32)
/* FROZEN */
]
...
...
@@ -824,6 +836,16 @@ interface nsIDOMHTMLDocument : nsIDOMDocument
[
object,
uuid(3d9f4973-dd2e-48f5-b5f7-2634e09eadd9)
/* FROZEN */
]
interface nsIDOMDocumentStyle : nsISupports
{
nsresult GetStyleSheets(nsIDOMStyleSheetList **aStyleSheets);
}
[
object,
uuid(a6cf90ce-15b3-11d2-932e-00805f8add32)
/* FROZEN */
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment