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
72fc799d
Commit
72fc799d
authored
Oct 06, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Store nsIDOMCSSStyleDeclaration in HTMLCurrentStyle.
parent
e9475aab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
6 deletions
+90
-6
htmlcurstyle.c
dlls/mshtml/htmlcurstyle.c
+54
-3
htmlelem2.c
dlls/mshtml/htmlelem2.c
+1
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-1
nsiface.idl
dlls/mshtml/nsiface.idl
+34
-1
No files found.
dlls/mshtml/htmlcurstyle.c
View file @
72fc799d
...
...
@@ -37,6 +37,8 @@ typedef struct {
const
IHTMLCurrentStyleVtbl
*
lpIHTMLCurrentStyleVtbl
;
LONG
ref
;
nsIDOMCSSStyleDeclaration
*
nsstyle
;
}
HTMLCurrentStyle
;
#define HTMLCURSTYLE(x) ((IHTMLCurrentStyle*) &(x)->lpIHTMLCurrentStyleVtbl)
...
...
@@ -85,8 +87,11 @@ static ULONG WINAPI HTMLCurrentStyle_Release(IHTMLCurrentStyle *iface)
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
if
(
!
ref
)
{
if
(
This
->
nsstyle
)
nsIDOMCSSStyleDeclaration_Release
(
This
->
nsstyle
);
heap_free
(
This
);
}
return
ref
;
}
...
...
@@ -875,16 +880,62 @@ static dispex_static_data_t HTMLCurrentStyle_dispex = {
HTMLCurrentStyle_iface_tids
};
HRESULT
HTMLCurrentStyle_Create
(
IHTMLCurrentStyle
**
p
)
HRESULT
HTMLCurrentStyle_Create
(
HTMLElement
*
elem
,
IHTMLCurrentStyle
**
p
)
{
nsIDOMCSSStyleDeclaration
*
nsstyle
;
nsIDOMDocumentView
*
nsdocview
;
nsIDOMAbstractView
*
nsview
;
nsIDOMViewCSS
*
nsviewcss
;
nsIDOMDocument
*
nsdoc
;
nsAString
nsempty_str
;
HTMLCurrentStyle
*
ret
;
nsresult
nsres
;
nsres
=
nsIWebNavigation_GetDocument
(
elem
->
node
.
doc
->
nscontainer
->
navigation
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetDocument failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMDocumentView
,
(
void
**
)
&
nsdocview
);
nsIDOMDocument_Release
(
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMDocumentView: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMDocumentView_GetDefaultView
(
nsdocview
,
&
nsview
);
nsIDOMDocumentView_Release
(
nsdocview
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetDefaultView failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMAbstractView_QueryInterface
(
nsview
,
&
IID_nsIDOMViewCSS
,
(
void
**
)
&
nsviewcss
);
nsIDOMAbstractView_Release
(
nsview
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMViewCSS: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsAString_Init
(
&
nsempty_str
,
NULL
);
nsres
=
nsIDOMViewCSS_GetComputedStyle
(
nsviewcss
,
(
nsIDOMElement
*
)
elem
->
nselem
,
&
nsempty_str
,
&
nsstyle
);
nsIDOMViewCSS_Release
(
nsviewcss
);
nsAString_Finish
(
&
nsempty_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetComputedStyle failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
ret
=
heap_alloc_zero
(
sizeof
(
HTMLCurrentStyle
));
if
(
!
ret
)
if
(
!
ret
)
{
nsIDOMCSSStyleDeclaration_Release
(
nsstyle
);
return
E_OUTOFMEMORY
;
}
ret
->
lpIHTMLCurrentStyleVtbl
=
&
HTMLCurrentStyleVtbl
;
ret
->
ref
=
1
;
ret
->
nsstyle
=
nsstyle
;
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
HTMLCURSTYLE
(
ret
),
&
HTMLCurrentStyle_dispex
);
...
...
dlls/mshtml/htmlelem2.c
View file @
72fc799d
...
...
@@ -321,7 +321,7 @@ static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLC
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
HTMLCurrentStyle_Create
(
p
);
return
HTMLCurrentStyle_Create
(
This
,
p
);
}
static
HRESULT
WINAPI
HTMLElement2_put_onpropertychange
(
IHTMLElement2
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/mshtml_private.h
View file @
72fc799d
...
...
@@ -474,7 +474,7 @@ void HTMLDocument_Window_Init(HTMLDocument*);
void
HTMLDocument_Service_Init
(
HTMLDocument
*
);
void
HTMLDocument_Hlink_Init
(
HTMLDocument
*
);
HRESULT
HTMLCurrentStyle_Create
(
IHTMLCurrentStyle
**
);
HRESULT
HTMLCurrentStyle_Create
(
HTMLElement
*
,
IHTMLCurrentStyle
**
);
void
ConnectionPoint_Init
(
ConnectionPoint
*
,
ConnectionPointContainer
*
,
REFIID
);
void
ConnectionPointContainer_Init
(
ConnectionPointContainer
*
,
IUnknown
*
);
...
...
dlls/mshtml/nsiface.idl
View file @
72fc799d
...
...
@@ -82,6 +82,7 @@ interface nsIEditorObserver;
interface
nsIEditActionListener
;
interface
nsIDocumentStateListener
;
interface
nsIDOMCSSStyleSheet
;
interface
nsIDOMDocumentView
;
interface
IMoniker
;
...
...
@@ -100,7 +101,6 @@ interface nsISupports
/*
Currently
we
don
't need a full declaration of these interfaces */
typedef nsISupports nsISHistory;
typedef nsISupports nsIWidget;
typedef nsISupports nsIDOMAbstractView;
typedef nsISupports nsIHttpHeaderVisitor;
typedef nsISupports nsIDOMBarProp;
typedef nsISupports nsIDOMWindowCollection;
...
...
@@ -887,6 +887,28 @@ interface nsIDOMDocumentFragment : nsIDOMNode
[
object,
uuid(f51ebade-8b1a-11d3-aae7-0010830123b4),
local
/* FROZEN */
]
interface nsIDOMAbstractView : nsISupports
{
nsresult GetDocument(nsIDOMDocumentView **aDocument);
}
[
object,
uuid(0b9341f3-95d4-4fa4-adcd-e119e0db2889),
local
/* NOT_FROZEN */
]
interface nsIDOMViewCSS : nsIDOMAbstractView
{
nsresult GetComputedStyle(nsIDOMElement *elt, const nsAString *pseudoElt, nsIDOMCSSStyleDeclaration **_retval);
}
[
object,
uuid(a6cf9075-15b3-11d2-932e-00805f8add32),
local
/* FROZEN */
...
...
@@ -1003,6 +1025,17 @@ interface nsIDOMDocumentStyle : nsISupports
[
object,
uuid(1acdb2ba-1dd2-11b2-95bc-9542495d2569),
local
/* FROZEN */
]
interface nsIDOMDocumentView : nsISupports
{
nsresult GetDefaultView(nsIDOMAbstractView **aDefaultView);
}
[
object,
uuid(a6cf90ce-15b3-11d2-932e-00805f8add32),
local
/* 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