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
f68e24a6
Commit
f68e24a6
authored
Sep 15, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Store HTMLElement struct instead of pointer in HTMLAnchorElement.
parent
754569f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
32 deletions
+40
-32
htmlanchor.c
dlls/mshtml/htmlanchor.c
+10
-9
htmlelem.c
dlls/mshtml/htmlelem.c
+29
-22
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-1
No files found.
dlls/mshtml/htmlanchor.c
View file @
f68e24a6
...
...
@@ -36,9 +36,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
typedef
struct
{
const
IHTMLAnchorElementVtbl
*
lpHTMLAnchorElementVtbl
;
HTMLElement
element
;
HTMLElement
*
element
;
const
IHTMLAnchorElementVtbl
*
lpHTMLAnchorElementVtbl
;
}
HTMLAnchorElement
;
#define HTMLANCHOR(x) ((IHTMLAnchorElement*) &(x)->lpHTMLAnchorElementVtbl)
...
...
@@ -69,7 +69,7 @@ static HRESULT WINAPI HTMLAnchorElement_QueryInterface(IHTMLAnchorElement *iface
return
S_OK
;
}
hres
=
HTMLElement_QI
(
This
->
element
,
riid
,
ppv
);
hres
=
HTMLElement_QI
(
&
This
->
element
,
riid
,
ppv
);
if
(
FAILED
(
hres
))
WARN
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
...
...
@@ -82,7 +82,7 @@ static ULONG WINAPI HTMLAnchorElement_AddRef(IHTMLAnchorElement *iface)
TRACE
(
"(%p)
\n
"
,
This
);
return
IHTMLDocument2_AddRef
(
HTMLDOC
(
This
->
element
->
node
.
doc
));
return
IHTMLDocument2_AddRef
(
HTMLDOC
(
This
->
element
.
node
.
doc
));
}
static
ULONG
WINAPI
HTMLAnchorElement_Release
(
IHTMLAnchorElement
*
iface
)
...
...
@@ -91,7 +91,7 @@ static ULONG WINAPI HTMLAnchorElement_Release(IHTMLAnchorElement *iface)
TRACE
(
"(%p)
\n
"
,
This
);
return
IHTMLDocument2_Release
(
HTMLDOC
(
This
->
element
->
node
.
doc
));
return
IHTMLDocument2_Release
(
HTMLDOC
(
This
->
element
.
node
.
doc
));
}
static
HRESULT
WINAPI
HTMLAnchorElement_GetTypeInfoCount
(
IHTMLAnchorElement
*
iface
,
UINT
*
pctinfo
)
...
...
@@ -473,13 +473,14 @@ static const IHTMLAnchorElementVtbl HTMLAnchorElementVtbl = {
HTMLAnchorElement_blur
};
void
HTMLAnchorElement_Create
(
HTMLElement
*
element
)
HTMLElement
*
HTMLAnchorElement_Create
(
nsIDOMHTMLElement
*
nselem
)
{
HTMLAnchorElement
*
ret
=
mshtml_alloc
(
sizeof
(
HTMLAnchorElement
));
ret
->
lpHTMLAnchorElementVtbl
=
&
HTMLAnchorElementVtbl
;
ret
->
element
=
element
;
element
->
impl
=
(
IUnknown
*
)
HTMLANCHOR
(
ret
);
element
->
destructor
=
HTMLAnchorElement_destructor
;
ret
->
element
.
impl
=
(
IUnknown
*
)
HTMLANCHOR
(
ret
);
ret
->
element
.
destructor
=
HTMLAnchorElement_destructor
;
return
&
ret
->
element
;
}
dlls/mshtml/htmlelem.c
View file @
f68e24a6
...
...
@@ -1273,6 +1273,7 @@ HRESULT HTMLElement_QI(HTMLElement *This, REFIID riid, void **ppv)
HTMLElement
*
HTMLElement_Create
(
nsIDOMNode
*
nsnode
)
{
nsIDOMHTMLElement
*
nselem
;
HTMLElement
*
ret
;
nsAString
class_name_str
;
const
PRUnichar
*
class_name
;
...
...
@@ -1284,39 +1285,45 @@ HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode)
static
const
WCHAR
wszSELECT
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
0
};
static
const
WCHAR
wszTEXTAREA
[]
=
{
'T'
,
'E'
,
'X'
,
'T'
,
'A'
,
'R'
,
'E'
,
'A'
,
0
};
ret
=
mshtml_alloc
(
sizeof
(
HTMLElement
));
ret
->
lpHTMLElementVtbl
=
&
HTMLElementVtbl
;
ret
->
impl
=
NULL
;
ret
->
destructor
=
NULL
;
ret
->
node
.
node_type
=
NT_HTMLELEM
;
ret
->
node
.
impl
.
elem
=
HTMLELEM
(
ret
);
ret
->
node
.
destructor
=
HTMLElement_destructor
;
HTMLElement2_Init
(
ret
);
nsres
=
nsIDOMNode_QueryInterface
(
nsnode
,
&
IID_nsIDOMHTMLElement
,
(
void
**
)
&
ret
->
nselem
);
nsres
=
nsIDOMNode_QueryInterface
(
nsnode
,
&
IID_nsIDOMHTMLElement
,
(
void
**
)
&
nselem
);
if
(
NS_FAILED
(
nsres
))
return
NULL
;
nsAString_Init
(
&
class_name_str
,
NULL
);
nsIDOMHTMLElement_GetTagName
(
ret
->
nselem
,
&
class_name_str
);
nsIDOMHTMLElement_GetTagName
(
nselem
,
&
class_name_str
);
nsAString_GetData
(
&
class_name_str
,
&
class_name
,
NULL
);
if
(
!
strcmpW
(
class_name
,
wszA
))
HTMLAnchorElement_Create
(
ret
);
else
if
(
!
strcmpW
(
class_name
,
wszBODY
))
HTMLBodyElement_Create
(
ret
);
else
if
(
!
strcmpW
(
class_name
,
wszINPUT
))
HTMLInputElement_Create
(
ret
);
else
if
(
!
strcmpW
(
class_name
,
wszSELECT
))
HTMLSelectElement_Create
(
ret
);
else
if
(
!
strcmpW
(
class_name
,
wszTEXTAREA
))
HTMLTextAreaElement_Create
(
ret
);
ret
=
HTMLAnchorElement_Create
(
nselem
);
else
{
ret
=
mshtml_alloc
(
sizeof
(
HTMLElement
));
ret
->
impl
=
NULL
;
ret
->
destructor
=
NULL
;
ret
->
nselem
=
nselem
;
if
(
!
strcmpW
(
class_name
,
wszBODY
))
HTMLBodyElement_Create
(
ret
);
else
if
(
!
strcmpW
(
class_name
,
wszINPUT
))
HTMLInputElement_Create
(
ret
);
else
if
(
!
strcmpW
(
class_name
,
wszSELECT
))
HTMLSelectElement_Create
(
ret
);
else
if
(
!
strcmpW
(
class_name
,
wszTEXTAREA
))
HTMLTextAreaElement_Create
(
ret
);
}
nsAString_Finish
(
&
class_name_str
);
ret
->
lpHTMLElementVtbl
=
&
HTMLElementVtbl
;
ret
->
nselem
=
nselem
;
HTMLElement2_Init
(
ret
);
ret
->
node
.
node_type
=
NT_HTMLELEM
;
ret
->
node
.
impl
.
elem
=
HTMLELEM
(
ret
);
ret
->
node
.
destructor
=
HTMLElement_destructor
;
return
ret
;
}
...
...
dlls/mshtml/mshtml_private.h
View file @
f68e24a6
...
...
@@ -416,7 +416,7 @@ void detach_selection(HTMLDocument*);
void
detach_ranges
(
HTMLDocument
*
);
HTMLElement
*
HTMLElement_Create
(
nsIDOMNode
*
);
void
HTMLAnchorElement_Create
(
HTMLElement
*
);
HTMLElement
*
HTMLAnchorElement_Create
(
nsIDOM
HTMLElement
*
);
void
HTMLBodyElement_Create
(
HTMLElement
*
);
void
HTMLInputElement_Create
(
HTMLElement
*
);
void
HTMLSelectElement_Create
(
HTMLElement
*
);
...
...
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