Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5962a0ea
Commit
5962a0ea
authored
Apr 05, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLStyleElement2 implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ecf9c499
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
0 deletions
+93
-0
htmlstyleelem.c
dlls/mshtml/htmlstyleelem.c
+81
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
dom.c
dlls/mshtml/tests/dom.c
+11
-0
No files found.
dlls/mshtml/htmlstyleelem.c
View file @
5962a0ea
...
...
@@ -37,6 +37,7 @@ struct HTMLStyleElement {
HTMLElement
element
;
IHTMLStyleElement
IHTMLStyleElement_iface
;
IHTMLStyleElement2
IHTMLStyleElement2_iface
;
nsIDOMHTMLStyleElement
*
nsstyle
;
IHTMLStyleSheet
*
style_sheet
;
...
...
@@ -282,6 +283,82 @@ static const IHTMLStyleElementVtbl HTMLStyleElementVtbl = {
HTMLStyleElement_get_media
};
static
inline
HTMLStyleElement
*
impl_from_IHTMLStyleElement2
(
IHTMLStyleElement2
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLStyleElement
,
IHTMLStyleElement2_iface
);
}
static
HRESULT
WINAPI
HTMLStyleElement2_QueryInterface
(
IHTMLStyleElement2
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLStyleElement
*
This
=
impl_from_IHTMLStyleElement2
(
iface
);
return
IHTMLDOMNode_QueryInterface
(
&
This
->
element
.
node
.
IHTMLDOMNode_iface
,
riid
,
ppv
);
}
static
ULONG
WINAPI
HTMLStyleElement2_AddRef
(
IHTMLStyleElement2
*
iface
)
{
HTMLStyleElement
*
This
=
impl_from_IHTMLStyleElement2
(
iface
);
return
IHTMLDOMNode_AddRef
(
&
This
->
element
.
node
.
IHTMLDOMNode_iface
);
}
static
ULONG
WINAPI
HTMLStyleElement2_Release
(
IHTMLStyleElement2
*
iface
)
{
HTMLStyleElement
*
This
=
impl_from_IHTMLStyleElement2
(
iface
);
return
IHTMLDOMNode_Release
(
&
This
->
element
.
node
.
IHTMLDOMNode_iface
);
}
static
HRESULT
WINAPI
HTMLStyleElement2_GetTypeInfoCount
(
IHTMLStyleElement2
*
iface
,
UINT
*
pctinfo
)
{
HTMLStyleElement
*
This
=
impl_from_IHTMLStyleElement2
(
iface
);
return
IDispatchEx_GetTypeInfoCount
(
&
This
->
element
.
node
.
event_target
.
dispex
.
IDispatchEx_iface
,
pctinfo
);
}
static
HRESULT
WINAPI
HTMLStyleElement2_GetTypeInfo
(
IHTMLStyleElement2
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
HTMLStyleElement
*
This
=
impl_from_IHTMLStyleElement2
(
iface
);
return
IDispatchEx_GetTypeInfo
(
&
This
->
element
.
node
.
event_target
.
dispex
.
IDispatchEx_iface
,
iTInfo
,
lcid
,
ppTInfo
);
}
static
HRESULT
WINAPI
HTMLStyleElement2_GetIDsOfNames
(
IHTMLStyleElement2
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
HTMLStyleElement
*
This
=
impl_from_IHTMLStyleElement2
(
iface
);
return
IDispatchEx_GetIDsOfNames
(
&
This
->
element
.
node
.
event_target
.
dispex
.
IDispatchEx_iface
,
riid
,
rgszNames
,
cNames
,
lcid
,
rgDispId
);
}
static
HRESULT
WINAPI
HTMLStyleElement2_Invoke
(
IHTMLStyleElement2
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
HTMLStyleElement
*
This
=
impl_from_IHTMLStyleElement2
(
iface
);
return
IDispatchEx_Invoke
(
&
This
->
element
.
node
.
event_target
.
dispex
.
IDispatchEx_iface
,
dispIdMember
,
riid
,
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
}
static
HRESULT
WINAPI
HTMLStyleElement2_get_sheet
(
IHTMLStyleElement2
*
iface
,
IHTMLStyleSheet
**
p
)
{
HTMLStyleElement
*
This
=
impl_from_IHTMLStyleElement2
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
IHTMLStyleElement_get_styleSheet
(
&
This
->
IHTMLStyleElement_iface
,
p
);
}
static
const
IHTMLStyleElement2Vtbl
HTMLStyleElement2Vtbl
=
{
HTMLStyleElement2_QueryInterface
,
HTMLStyleElement2_AddRef
,
HTMLStyleElement2_Release
,
HTMLStyleElement2_GetTypeInfoCount
,
HTMLStyleElement2_GetTypeInfo
,
HTMLStyleElement2_GetIDsOfNames
,
HTMLStyleElement2_Invoke
,
HTMLStyleElement2_get_sheet
};
static
inline
HTMLStyleElement
*
impl_from_HTMLDOMNode
(
HTMLDOMNode
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLStyleElement
,
element
.
node
);
...
...
@@ -300,6 +377,9 @@ static HRESULT HTMLStyleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
}
else
if
(
IsEqualGUID
(
&
IID_IHTMLStyleElement
,
riid
))
{
TRACE
(
"(%p)->(IID_IHTMLStyleElement %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IHTMLStyleElement_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IHTMLStyleElement2
,
riid
))
{
TRACE
(
"(%p)->(IID_IHTMLStyleElement2 %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IHTMLStyleElement2_iface
;
}
else
{
return
HTMLElement_QI
(
&
This
->
element
.
node
,
riid
,
ppv
);
}
...
...
@@ -382,6 +462,7 @@ HRESULT HTMLStyleElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HT
return
E_OUTOFMEMORY
;
ret
->
IHTMLStyleElement_iface
.
lpVtbl
=
&
HTMLStyleElementVtbl
;
ret
->
IHTMLStyleElement2_iface
.
lpVtbl
=
&
HTMLStyleElement2Vtbl
;
ret
->
element
.
node
.
vtbl
=
&
HTMLStyleElementImplVtbl
;
HTMLElement_Init
(
&
ret
->
element
,
doc
,
nselem
,
&
HTMLStyleElement_dispex
);
...
...
dlls/mshtml/mshtml_private.h
View file @
5962a0ea
...
...
@@ -236,6 +236,7 @@ typedef struct EventTarget EventTarget;
XIID(IHTMLStyle5) \
XIID(IHTMLStyle6) \
XIID(IHTMLStyleElement) \
XIID(IHTMLStyleElement2) \
XIID(IHTMLStyleSheet) \
XIID(IHTMLStyleSheetRule) \
XIID(IHTMLStyleSheetRulesCollection) \
...
...
dlls/mshtml/tests/dom.c
View file @
5962a0ea
...
...
@@ -10100,6 +10100,7 @@ static void test_null_write(IHTMLDocument2 *doc)
static
void
test_create_stylesheet
(
IHTMLDocument2
*
doc
)
{
IHTMLStyleSheet
*
stylesheet
,
*
stylesheet2
;
IHTMLStyleElement2
*
style_elem2
;
IHTMLStyleElement
*
style_elem
;
IHTMLElement
*
doc_elem
,
*
elem
;
HRESULT
hres
;
...
...
@@ -10142,8 +10143,18 @@ static void test_create_stylesheet(IHTMLDocument2 *doc)
ok
(
hres
==
S_OK
,
"get_styleSheet failed: %08x
\n
"
,
hres
);
ok
(
stylesheet2
!=
NULL
,
"stylesheet2 == NULL
\n
"
);
ok
(
iface_cmp
((
IUnknown
*
)
stylesheet
,
(
IUnknown
*
)
stylesheet2
),
"stylesheet != stylesheet2
\n
"
);
IHTMLStyleSheet_Release
(
stylesheet2
);
hres
=
IHTMLStyleElement_QueryInterface
(
style_elem
,
&
IID_IHTMLStyleElement2
,
(
void
**
)
&
style_elem2
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLStyleElement2: %08x
\n
"
,
hres
);
hres
=
IHTMLStyleElement2_get_sheet
(
style_elem2
,
&
stylesheet2
);
ok
(
hres
==
S_OK
,
"get_styleSheet failed: %08x
\n
"
,
hres
);
ok
(
stylesheet2
!=
NULL
,
"stylesheet2 == NULL
\n
"
);
ok
(
iface_cmp
((
IUnknown
*
)
stylesheet
,
(
IUnknown
*
)
stylesheet2
),
"stylesheet != stylesheet2
\n
"
);
IHTMLStyleSheet_Release
(
stylesheet2
);
IHTMLStyleElement2_Release
(
style_elem2
);
IHTMLStyleSheet_Release
(
stylesheet
);
IHTMLStyleElement_Release
(
style_elem
);
...
...
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