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
1745abfa
Commit
1745abfa
authored
Feb 28, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Store style object in element object.
parent
0131e047
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
15 deletions
+38
-15
htmlelem.c
dlls/mshtml/htmlelem.c
+15
-5
htmlstyle.c
dlls/mshtml/htmlstyle.c
+14
-9
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-1
dom.c
dlls/mshtml/tests/dom.c
+7
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
1745abfa
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include "mshtml_private.h"
#include "mshtml_private.h"
#include "htmlevent.h"
#include "htmlevent.h"
#include "htmlstyle.h"
static
const
WCHAR
aW
[]
=
{
'A'
,
0
};
static
const
WCHAR
aW
[]
=
{
'A'
,
0
};
static
const
WCHAR
bodyW
[]
=
{
'B'
,
'O'
,
'D'
,
'Y'
,
0
};
static
const
WCHAR
bodyW
[]
=
{
'B'
,
'O'
,
'D'
,
'Y'
,
0
};
...
@@ -423,11 +424,14 @@ static HRESULT WINAPI HTMLElement_get_parentElement(IHTMLElement *iface, IHTMLEl
...
@@ -423,11 +424,14 @@ static HRESULT WINAPI HTMLElement_get_parentElement(IHTMLElement *iface, IHTMLEl
static
HRESULT
WINAPI
HTMLElement_get_style
(
IHTMLElement
*
iface
,
IHTMLStyle
**
p
)
static
HRESULT
WINAPI
HTMLElement_get_style
(
IHTMLElement
*
iface
,
IHTMLStyle
**
p
)
{
{
HTMLElement
*
This
=
impl_from_IHTMLElement
(
iface
);
HTMLElement
*
This
=
impl_from_IHTMLElement
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
style
)
{
nsIDOMElementCSSInlineStyle
*
nselemstyle
;
nsIDOMElementCSSInlineStyle
*
nselemstyle
;
nsIDOMCSSStyleDeclaration
*
nsstyle
;
nsIDOMCSSStyleDeclaration
*
nsstyle
;
nsresult
nsres
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
nselem
)
{
if
(
!
This
->
nselem
)
{
FIXME
(
"NULL nselem
\n
"
);
FIXME
(
"NULL nselem
\n
"
);
...
@@ -448,10 +452,14 @@ static HRESULT WINAPI HTMLElement_get_style(IHTMLElement *iface, IHTMLStyle **p)
...
@@ -448,10 +452,14 @@ static HRESULT WINAPI HTMLElement_get_style(IHTMLElement *iface, IHTMLStyle **p)
return
E_FAIL
;
return
E_FAIL
;
}
}
/* FIXME: Store style instead of creating a new instance in each call */
hres
=
HTMLStyle_Create
(
nsstyle
,
&
This
->
style
);
*
p
=
HTMLStyle_Create
(
nsstyle
);
nsIDOMCSSStyleDeclaration_Release
(
nsstyle
);
nsIDOMCSSStyleDeclaration_Release
(
nsstyle
);
if
(
FAILED
(
hres
))
return
hres
;
}
*
p
=
&
This
->
style
->
IHTMLStyle_iface
;
IHTMLStyle_AddRef
(
*
p
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -1644,6 +1652,8 @@ void HTMLElement_destructor(HTMLDOMNode *iface)
...
@@ -1644,6 +1652,8 @@ void HTMLElement_destructor(HTMLDOMNode *iface)
if
(
This
->
nselem
)
if
(
This
->
nselem
)
nsIDOMHTMLElement_Release
(
This
->
nselem
);
nsIDOMHTMLElement_Release
(
This
->
nselem
);
if
(
This
->
style
)
IHTMLStyle_Release
(
&
This
->
style
->
IHTMLStyle_iface
);
HTMLDOMNode_destructor
(
&
This
->
node
);
HTMLDOMNode_destructor
(
&
This
->
node
);
}
}
...
...
dlls/mshtml/htmlstyle.c
View file @
1745abfa
...
@@ -2902,19 +2902,24 @@ static dispex_static_data_t HTMLStyle_dispex = {
...
@@ -2902,19 +2902,24 @@ static dispex_static_data_t HTMLStyle_dispex = {
HTMLStyle_iface_tids
HTMLStyle_iface_tids
};
};
IHTMLStyle
*
HTMLStyle_Create
(
nsIDOMCSSStyleDeclaration
*
nsstyle
)
HRESULT
HTMLStyle_Create
(
nsIDOMCSSStyleDeclaration
*
nsstyle
,
HTMLStyle
**
ret
)
{
{
HTMLStyle
*
ret
=
heap_alloc_zero
(
sizeof
(
HTMLStyle
))
;
HTMLStyle
*
style
;
ret
->
IHTMLStyle_iface
.
lpVtbl
=
&
HTMLStyleVtbl
;
style
=
heap_alloc_zero
(
sizeof
(
HTMLStyle
));
ret
->
ref
=
1
;
if
(
!
style
)
ret
->
nsstyle
=
nsstyle
;
return
E_OUTOFMEMORY
;
HTMLStyle2_Init
(
ret
);
HTMLStyle3_Init
(
ret
);
style
->
IHTMLStyle_iface
.
lpVtbl
=
&
HTMLStyleVtbl
;
style
->
ref
=
1
;
style
->
nsstyle
=
nsstyle
;
HTMLStyle2_Init
(
style
);
HTMLStyle3_Init
(
style
);
nsIDOMCSSStyleDeclaration_AddRef
(
nsstyle
);
nsIDOMCSSStyleDeclaration_AddRef
(
nsstyle
);
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
&
ret
->
IHTMLStyle_iface
,
&
HTMLStyle_dispex
);
init_dispex
(
&
style
->
dispex
,
(
IUnknown
*
)
&
style
->
IHTMLStyle_iface
,
&
HTMLStyle_dispex
);
return
&
ret
->
IHTMLStyle_iface
;
*
ret
=
style
;
return
S_OK
;
}
}
dlls/mshtml/mshtml_private.h
View file @
1745abfa
...
@@ -560,6 +560,7 @@ typedef struct {
...
@@ -560,6 +560,7 @@ typedef struct {
IHTMLElement4
IHTMLElement4_iface
;
IHTMLElement4
IHTMLElement4_iface
;
nsIDOMHTMLElement
*
nselem
;
nsIDOMHTMLElement
*
nselem
;
HTMLStyle
*
style
;
}
HTMLElement
;
}
HTMLElement
;
#define HTMLELEMENT_TIDS \
#define HTMLELEMENT_TIDS \
...
@@ -730,7 +731,7 @@ void set_ready_state(HTMLWindow*,READYSTATE);
...
@@ -730,7 +731,7 @@ void set_ready_state(HTMLWindow*,READYSTATE);
HRESULT
HTMLSelectionObject_Create
(
HTMLDocumentNode
*
,
nsISelection
*
,
IHTMLSelectionObject
**
);
HRESULT
HTMLSelectionObject_Create
(
HTMLDocumentNode
*
,
nsISelection
*
,
IHTMLSelectionObject
**
);
HRESULT
HTMLTxtRange_Create
(
HTMLDocumentNode
*
,
nsIDOMRange
*
,
IHTMLTxtRange
**
);
HRESULT
HTMLTxtRange_Create
(
HTMLDocumentNode
*
,
nsIDOMRange
*
,
IHTMLTxtRange
**
);
IHTMLStyle
*
HTMLStyle_Create
(
nsIDOMCSSStyleDeclaration
*
);
HRESULT
HTMLStyle_Create
(
nsIDOMCSSStyleDeclaration
*
,
HTMLStyle
*
*
);
IHTMLStyleSheet
*
HTMLStyleSheet_Create
(
nsIDOMStyleSheet
*
);
IHTMLStyleSheet
*
HTMLStyleSheet_Create
(
nsIDOMStyleSheet
*
);
IHTMLStyleSheetsCollection
*
HTMLStyleSheetsCollection_Create
(
nsIDOMStyleSheetList
*
);
IHTMLStyleSheetsCollection
*
HTMLStyleSheetsCollection_Create
(
nsIDOMStyleSheetList
*
);
...
...
dlls/mshtml/tests/dom.c
View file @
1745abfa
...
@@ -5610,6 +5610,13 @@ static void test_style_filters(IHTMLElement *elem)
...
@@ -5610,6 +5610,13 @@ static void test_style_filters(IHTMLElement *elem)
test_style_filter
(
style
,
NULL
);
test_style_filter
(
style
,
NULL
);
set_style_filter
(
style
,
"alpha(opacity=50.00000)"
);
set_style_filter
(
style
,
"alpha(opacity=50.00000)"
);
set_style_filter
(
style
,
"alpha(opacity=100)"
);
set_style_filter
(
style
,
"alpha(opacity=100)"
);
IHTMLStyle_Release
(
style
);
hres
=
IHTMLElement_get_style
(
elem
,
&
style
);
ok
(
hres
==
S_OK
,
"get_style failed: %08x
\n
"
,
hres
);
test_style_filter
(
style
,
"alpha(opacity=100)"
);
set_style_filter
(
style
,
"xxx(a,b,c) alpha(opacity=100)"
);
set_style_filter
(
style
,
"xxx(a,b,c) alpha(opacity=100)"
);
set_style_filter
(
style
,
NULL
);
set_style_filter
(
style
,
NULL
);
...
...
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