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
db2d10b3
Commit
db2d10b3
authored
Nov 02, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Nov 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Keep ref from the associated Style to the Element.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
9ea3493c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
18 deletions
+53
-18
htmlcurstyle.c
dlls/mshtml/htmlcurstyle.c
+3
-1
htmlelem.c
dlls/mshtml/htmlelem.c
+14
-10
htmlstyle.c
dlls/mshtml/htmlstyle.c
+36
-5
htmlstyle.h
dlls/mshtml/htmlstyle.h
+0
-2
No files found.
dlls/mshtml/htmlcurstyle.c
View file @
db2d10b3
...
...
@@ -1295,7 +1295,9 @@ static void *HTMLCurrentStyle_query_interface(DispatchEx *dispex, REFIID riid)
static
const
dispex_static_data_vtbl_t
HTMLCurrentStyle_dispex_vtbl
=
{
CSSSTYLE_DISPEX_VTBL_ENTRIES
,
.
query_interface
=
HTMLCurrentStyle_query_interface
.
query_interface
=
HTMLCurrentStyle_query_interface
,
.
traverse
=
CSSStyle_traverse
,
.
unlink
=
CSSStyle_unlink
};
static
const
tid_t
HTMLCurrentStyle_iface_tids
[]
=
{
...
...
dlls/mshtml/htmlelem.c
View file @
db2d10b3
...
...
@@ -6863,6 +6863,10 @@ void HTMLElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback
HTMLElement
*
This
=
impl_from_DispatchEx
(
dispex
);
HTMLDOMNode_traverse
(
&
This
->
node
.
event_target
.
dispex
,
cb
);
if
(
This
->
style
)
note_cc_edge
((
nsISupports
*
)
&
This
->
style
->
IHTMLStyle_iface
,
"style"
,
cb
);
if
(
This
->
runtime_style
)
note_cc_edge
((
nsISupports
*
)
&
This
->
runtime_style
->
IHTMLStyle_iface
,
"runtime_style"
,
cb
);
if
(
This
->
attrs
)
note_cc_edge
((
nsISupports
*
)
&
This
->
attrs
->
IHTMLAttributeCollection_iface
,
"attrs"
,
cb
);
}
...
...
@@ -6872,6 +6876,16 @@ void HTMLElement_unlink(DispatchEx *dispex)
HTMLElement
*
This
=
impl_from_DispatchEx
(
dispex
);
HTMLDOMNode_unlink
(
&
This
->
node
.
event_target
.
dispex
);
if
(
This
->
style
)
{
HTMLStyle
*
style
=
This
->
style
;
This
->
style
=
NULL
;
IHTMLStyle_Release
(
&
style
->
IHTMLStyle_iface
);
}
if
(
This
->
runtime_style
)
{
HTMLStyle
*
runtime_style
=
This
->
runtime_style
;
This
->
runtime_style
=
NULL
;
IHTMLStyle_Release
(
&
runtime_style
->
IHTMLStyle_iface
);
}
if
(
This
->
attrs
)
{
HTMLAttributeCollection
*
attrs
=
This
->
attrs
;
This
->
attrs
=
NULL
;
...
...
@@ -6884,16 +6898,6 @@ void HTMLElement_destructor(DispatchEx *dispex)
HTMLElement
*
This
=
impl_from_DispatchEx
(
dispex
);
ConnectionPointContainer_Destroy
(
&
This
->
cp_container
);
if
(
This
->
style
)
{
This
->
style
->
elem
=
NULL
;
IHTMLStyle_Release
(
&
This
->
style
->
IHTMLStyle_iface
);
}
if
(
This
->
runtime_style
)
{
This
->
runtime_style
->
elem
=
NULL
;
IHTMLStyle_Release
(
&
This
->
runtime_style
->
IHTMLStyle_iface
);
}
free
(
This
->
filter
);
HTMLDOMNode_destructor
(
&
This
->
node
.
event_target
.
dispex
);
}
...
...
dlls/mshtml/htmlstyle.c
View file @
db2d10b3
...
...
@@ -9967,9 +9967,14 @@ HRESULT CSSStyle_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *
return
DISP_E_UNKNOWNNAME
;
}
static
inline
HTMLStyle
*
HTMLStyle_from_DispatchEx
(
DispatchEx
*
dispex
)
{
return
CONTAINING_RECORD
(
dispex
,
HTMLStyle
,
css_style
.
dispex
);
}
static
void
*
HTMLStyle_query_interface
(
DispatchEx
*
dispex
,
REFIID
riid
)
{
HTMLStyle
*
This
=
CONTAINING_RECORD
(
dispex
,
HTMLStyle
,
css_style
.
dispex
);
HTMLStyle
*
This
=
HTMLStyle_from_DispatchEx
(
dispex
);
if
(
IsEqualGUID
(
&
IID_IHTMLStyle
,
riid
))
return
&
This
->
IHTMLStyle_iface
;
...
...
@@ -9986,6 +9991,27 @@ static void *HTMLStyle_query_interface(DispatchEx *dispex, REFIID riid)
return
CSSStyle_query_interface
(
&
This
->
css_style
.
dispex
,
riid
);
}
static
void
HTMLStyle_traverse
(
DispatchEx
*
dispex
,
nsCycleCollectionTraversalCallback
*
cb
)
{
HTMLStyle
*
This
=
HTMLStyle_from_DispatchEx
(
dispex
);
CSSStyle_traverse
(
&
This
->
css_style
.
dispex
,
cb
);
if
(
This
->
elem
)
note_cc_edge
((
nsISupports
*
)
&
This
->
elem
->
node
.
IHTMLDOMNode_iface
,
"elem"
,
cb
);
}
static
void
HTMLStyle_unlink
(
DispatchEx
*
dispex
)
{
HTMLStyle
*
This
=
HTMLStyle_from_DispatchEx
(
dispex
);
CSSStyle_unlink
(
&
This
->
css_style
.
dispex
);
if
(
This
->
elem
)
{
HTMLElement
*
elem
=
This
->
elem
;
This
->
elem
=
NULL
;
IHTMLDOMNode_Release
(
&
elem
->
node
.
IHTMLDOMNode_iface
);
}
}
void
CSSStyle_init_dispex_info
(
dispex_data_t
*
info
,
compat_mode_t
mode
)
{
if
(
mode
>=
COMPAT_MODE_IE9
)
...
...
@@ -9994,9 +10020,11 @@ void CSSStyle_init_dispex_info(dispex_data_t *info, compat_mode_t mode)
dispex_info_add_interface
(
info
,
IHTMLCSSStyleDeclaration2_tid
,
NULL
);
}
static
const
dispex_static_data_vtbl_t
CSS
Style_dispex_vtbl
=
{
static
const
dispex_static_data_vtbl_t
HTML
Style_dispex_vtbl
=
{
CSSSTYLE_DISPEX_VTBL_ENTRIES
,
.
query_interface
=
HTMLStyle_query_interface
.
query_interface
=
HTMLStyle_query_interface
,
.
traverse
=
HTMLStyle_traverse
,
.
unlink
=
HTMLStyle_unlink
};
static
const
tid_t
HTMLStyle_iface_tids
[]
=
{
...
...
@@ -10010,7 +10038,7 @@ static const tid_t HTMLStyle_iface_tids[] = {
};
static
dispex_static_data_t
HTMLStyle_dispex
=
{
"MSStyleCSSProperties"
,
&
CSS
Style_dispex_vtbl
,
&
HTML
Style_dispex_vtbl
,
DispHTMLStyle_tid
,
HTMLStyle_iface_tids
,
CSSStyle_init_dispex_info
...
...
@@ -10088,6 +10116,7 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
style
->
IHTMLStyle6_iface
.
lpVtbl
=
&
HTMLStyle6Vtbl
;
style
->
elem
=
elem
;
IHTMLDOMNode_AddRef
(
&
elem
->
node
.
IHTMLDOMNode_iface
);
init_css_style
(
&
style
->
css_style
,
nsstyle
,
&
HTMLStyle_dispex
,
dispex_compat_mode
(
&
elem
->
node
.
event_target
.
dispex
));
nsIDOMCSSStyleDeclaration_Release
(
nsstyle
);
...
...
@@ -10098,7 +10127,9 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
static
const
dispex_static_data_vtbl_t
HTMLW3CComputedStyle_dispex_vtbl
=
{
CSSSTYLE_DISPEX_VTBL_ENTRIES
,
.
query_interface
=
CSSStyle_query_interface
.
query_interface
=
CSSStyle_query_interface
,
.
traverse
=
CSSStyle_traverse
,
.
unlink
=
CSSStyle_unlink
};
static
const
tid_t
HTMLW3CComputedStyle_iface_tids
[]
=
{
...
...
dlls/mshtml/htmlstyle.h
View file @
db2d10b3
...
...
@@ -166,6 +166,4 @@ HRESULT set_elem_style(HTMLElement*,styleid_t,const WCHAR*);
#define CSSSTYLE_DISPEX_VTBL_ENTRIES \
.destructor = CSSStyle_destructor, \
.traverse = CSSStyle_traverse, \
.unlink = CSSStyle_unlink, \
.get_dispid = CSSStyle_get_dispid
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