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
08939329
Commit
08939329
authored
Mar 27, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLWindow7::getComputedStyle implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
12be24af
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
2 deletions
+91
-2
htmlstyle.c
dlls/mshtml/htmlstyle.c
+22
-0
htmlstyle.h
dlls/mshtml/htmlstyle.h
+1
-0
htmlwindow.c
dlls/mshtml/htmlwindow.c
+37
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
dom.c
dlls/mshtml/tests/dom.c
+30
-0
No files found.
dlls/mshtml/htmlstyle.c
View file @
08939329
...
...
@@ -10236,6 +10236,28 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
return
S_OK
;
}
static
const
tid_t
HTMLW3CComputedStyle_iface_tids
[]
=
{
0
};
static
dispex_static_data_t
HTMLW3CComputedStyle_dispex
=
{
&
CSSStyle_dispex_vtbl
,
DispHTMLW3CComputedStyle_tid
,
HTMLW3CComputedStyle_iface_tids
,
CSSStyle_init_dispex_info
};
HRESULT
create_computed_style
(
nsIDOMCSSStyleDeclaration
*
nsstyle
,
IHTMLCSSStyleDeclaration
**
p
)
{
CSSStyle
*
style
;
if
(
!
(
style
=
heap_alloc_zero
(
sizeof
(
*
style
))))
return
E_OUTOFMEMORY
;
init_css_style
(
style
,
nsstyle
,
NULL
,
&
HTMLW3CComputedStyle_dispex
,
COMPAT_MODE_IE11
);
*
p
=
&
style
->
IHTMLCSSStyleDeclaration_iface
;
return
S_OK
;
}
HRESULT
get_elem_style
(
HTMLElement
*
elem
,
styleid_t
styleid
,
BSTR
*
ret
)
{
nsIDOMCSSStyleDeclaration
*
style
;
...
...
dlls/mshtml/htmlstyle.h
View file @
08939329
...
...
@@ -137,6 +137,7 @@ typedef enum {
}
styleid_t
;
HRESULT
HTMLStyle_Create
(
HTMLElement
*
,
HTMLStyle
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_computed_style
(
nsIDOMCSSStyleDeclaration
*
,
IHTMLCSSStyleDeclaration
**
)
DECLSPEC_HIDDEN
;
void
init_css_style
(
CSSStyle
*
,
nsIDOMCSSStyleDeclaration
*
,
style_qi_t
,
dispex_static_data_t
*
,
compat_mode_t
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/htmlwindow.c
View file @
08939329
...
...
@@ -38,6 +38,7 @@
#include "mshtml_private.h"
#include "htmlevent.h"
#include "htmlscript.h"
#include "htmlstyle.h"
#include "pluginhost.h"
#include "binding.h"
#include "resource.h"
...
...
@@ -2322,8 +2323,42 @@ static HRESULT WINAPI HTMLWindow7_getComputedStyle(IHTMLWindow7 *iface, IHTMLDOM
BSTR
pseudo_elt
,
IHTMLCSSStyleDeclaration
**
p
)
{
HTMLWindow
*
This
=
impl_from_IHTMLWindow7
(
iface
);
FIXME
(
"(%p)->(%p %s %p)
\n
"
,
This
,
node
,
debugstr_w
(
pseudo_elt
),
p
);
return
E_NOTIMPL
;
nsIDOMCSSStyleDeclaration
*
nsstyle
;
nsAString
pseudo_elt_str
;
HTMLElement
*
element
;
IHTMLElement
*
elem
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p %s %p)
\n
"
,
This
,
node
,
debugstr_w
(
pseudo_elt
),
p
);
if
(
!
This
->
outer_window
)
return
E_UNEXPECTED
;
hres
=
IHTMLDOMNode_QueryInterface
(
node
,
&
IID_IHTMLElement
,
(
void
**
)
&
elem
);
if
(
FAILED
(
hres
))
return
hres
;
element
=
unsafe_impl_from_IHTMLElement
(
elem
);
if
(
!
element
)
{
WARN
(
"Not our element
\n
"
);
IHTMLElement_Release
(
elem
);
return
E_INVALIDARG
;
}
nsAString_Init
(
&
pseudo_elt_str
,
NULL
);
nsres
=
nsIDOMWindow_GetComputedStyle
(
This
->
outer_window
->
nswindow
,
element
->
dom_element
,
&
pseudo_elt_str
,
&
nsstyle
);
IHTMLElement_Release
(
elem
);
nsAString_Finish
(
&
pseudo_elt_str
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"GetComputedStyle failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
hres
=
create_computed_style
(
nsstyle
,
p
);
nsIDOMCSSStyleDeclaration_Release
(
nsstyle
);
return
hres
;
}
static
HRESULT
WINAPI
HTMLWindow7_get_styleMedia
(
IHTMLWindow7
*
iface
,
IHTMLStyleMedia
**
p
)
...
...
dlls/mshtml/mshtml_private.h
View file @
08939329
...
...
@@ -128,6 +128,7 @@ typedef struct EventTarget EventTarget;
XDIID(DispHTMLTextAreaElement) \
XDIID(DispHTMLTitleElement) \
XDIID(DispHTMLUnknownElement) \
XDIID(DispHTMLW3CComputedStyle) \
XDIID(DispHTMLWindow2) \
XDIID(DispHTMLXMLHttpRequest) \
XDIID(HTMLDocumentEvents) \
...
...
dlls/mshtml/tests/dom.c
View file @
08939329
...
...
@@ -463,6 +463,14 @@ static const IID * const cstyle_iids[] = {
NULL
};
static
const
IID
*
const
computed_style_iids
[]
=
{
&
IID_IUnknown
,
&
IID_IDispatch
,
&
IID_IDispatchEx
,
&
IID_IHTMLCSSStyleDeclaration
,
NULL
};
static
const
IID
*
const
img_factory_iids
[]
=
{
&
IID_IUnknown
,
&
IID_IDispatch
,
...
...
@@ -6879,7 +6887,10 @@ static void test_window(IHTMLDocument2 *doc)
hres
=
IHTMLWindow2_QueryInterface
(
window
,
&
IID_IHTMLWindow7
,
(
void
**
)
&
window7
);
if
(
SUCCEEDED
(
hres
))
{
IHTMLCSSStyleDeclaration
*
computed_style
;
IHTMLPerformance
*
performance
;
IHTMLDOMNode
*
node
;
IHTMLElement
*
elem
;
ok
(
window7
!=
NULL
,
"window7 == NULL
\n
"
);
...
...
@@ -6907,6 +6918,25 @@ static void test_window(IHTMLDocument2 *doc)
IHTMLWindow7_Release
(
window7
);
}
hres
=
IHTMLDocument2_get_body
(
doc
,
&
elem
);
ok
(
hres
==
S_OK
,
"get_body failed: %08x
\n
"
,
hres
);
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLDOMNode
,
(
void
**
)
&
node
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLDOMNode iface: %08x
\n
"
,
hres
);
hres
=
IHTMLWindow7_getComputedStyle
(
window7
,
node
,
NULL
,
&
computed_style
);
ok
(
hres
==
S_OK
,
"getComputedStyle failed: %08x
\n
"
,
hres
);
test_disp
((
IUnknown
*
)
computed_style
,
&
DIID_DispHTMLW3CComputedStyle
,
NULL
,
"[object]"
);
test_ifaces
((
IUnknown
*
)
computed_style
,
computed_style_iids
);
test_read_only_style
(
computed_style
);
IHTMLCSSStyleDeclaration_Release
(
computed_style
);
IHTMLDOMNode_Release
(
node
);
IHTMLElement_Release
(
elem
);
}
else
{
win_skip
(
"IHTMLWindow7 not supported
\n
"
);
}
...
...
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