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
d05e328d
Commit
d05e328d
authored
Oct 13, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLElement::get_innerText implementation.
parent
a0ba631d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
3 deletions
+57
-3
htmlelem.c
dlls/mshtml/htmlelem.c
+4
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
dom.c
dlls/mshtml/tests/dom.c
+15
-0
txtrange.c
dlls/mshtml/txtrange.c
+37
-1
No files found.
dlls/mshtml/htmlelem.c
View file @
d05e328d
...
...
@@ -839,8 +839,10 @@ static HRESULT WINAPI HTMLElement_put_innerText(IHTMLElement *iface, BSTR v)
static
HRESULT
WINAPI
HTMLElement_get_innerText
(
IHTMLElement
*
iface
,
BSTR
*
p
)
{
HTMLElement
*
This
=
HTMLELEM_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
get_node_text
(
&
This
->
node
,
p
);
}
static
HRESULT
WINAPI
HTMLElement_put_outerHTML
(
IHTMLElement
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/mshtml_private.h
View file @
d05e328d
...
...
@@ -550,6 +550,7 @@ IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetLis
void
detach_selection
(
HTMLDocument
*
);
void
detach_ranges
(
HTMLDocument
*
);
HRESULT
get_node_text
(
HTMLDOMNode
*
,
BSTR
*
);
HTMLDOMNode
*
HTMLDOMTextNode_Create
(
HTMLDocument
*
,
nsIDOMNode
*
);
...
...
dlls/mshtml/tests/dom.c
View file @
d05e328d
...
...
@@ -1014,6 +1014,19 @@ static void _test_elem_getelembytag(unsigned line, IUnknown *unk, elem_type_t ty
HeapFree
(
GetProcessHeap
(),
0
,
types
);
}
#define test_elem_innertext(e,t) _test_elem_innertext(__LINE__,e,t)
static
void
_test_elem_innertext
(
unsigned
line
,
IHTMLElement
*
elem
,
const
char
*
extext
)
{
BSTR
text
=
NULL
;
HRESULT
hres
;
hres
=
IHTMLElement_get_innerText
(
elem
,
&
text
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"get_innerText failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)
(
!
strcmp_wa
(
text
,
extext
),
"get_innerText returned %s expected %s
\n
"
,
dbgstr_w
(
text
),
extext
);
SysFreeString
(
text
);
}
#define get_first_child(n) _get_first_child(__LINE__,n)
static
IHTMLDOMNode
*
_get_first_child
(
unsigned
line
,
IUnknown
*
unk
)
{
...
...
@@ -2942,6 +2955,8 @@ static void test_elems(IHTMLDocument2 *doc)
test_elem_getelembytag
((
IUnknown
*
)
elem
,
ET_SELECT
,
0
);
test_elem_getelembytag
((
IUnknown
*
)
elem
,
ET_HTML
,
0
);
test_elem_innertext
(
elem
,
"opt1opt2"
);
IHTMLElement_Release
(
elem
);
}
...
...
dlls/mshtml/txtrange.c
View file @
d05e328d
...
...
@@ -252,7 +252,7 @@ static void wstrbuf_append_node(wstrbuf_t *buf, nsIDOMNode *node)
wstrbuf_append_nodetxt
(
buf
,
data
,
strlenW
(
data
));
nsAString_Finish
(
&
data_str
);
nsIDOMText_Release
(
nstext
);
nsIDOMText_Release
(
nstext
);
break
;
}
...
...
@@ -267,6 +267,21 @@ static void wstrbuf_append_node(wstrbuf_t *buf, nsIDOMNode *node)
}
}
static
void
wstrbuf_append_node_rec
(
wstrbuf_t
*
buf
,
nsIDOMNode
*
node
)
{
nsIDOMNode
*
iter
,
*
tmp
;
wstrbuf_append_node
(
buf
,
node
);
nsIDOMNode_GetFirstChild
(
node
,
&
iter
);
while
(
iter
)
{
wstrbuf_append_node_rec
(
buf
,
iter
);
nsIDOMNode_GetNextSibling
(
iter
,
&
tmp
);
nsIDOMNode_Release
(
iter
);
iter
=
tmp
;
}
}
static
BOOL
fill_nodestr
(
dompos_t
*
pos
)
{
nsIDOMText
*
text
;
...
...
@@ -529,6 +544,27 @@ static void range_to_string(HTMLTxtRange *This, wstrbuf_t *buf)
}
}
HRESULT
get_node_text
(
HTMLDOMNode
*
node
,
BSTR
*
ret
)
{
wstrbuf_t
buf
;
HRESULT
hres
=
S_OK
;
wstrbuf_init
(
&
buf
);
wstrbuf_append_node_rec
(
&
buf
,
node
->
nsnode
);
if
(
buf
.
buf
)
{
*
ret
=
SysAllocString
(
buf
.
buf
);
if
(
!*
ret
)
hres
=
E_OUTOFMEMORY
;
}
else
{
*
ret
=
NULL
;
}
wstrbuf_finish
(
&
buf
);
if
(
SUCCEEDED
(
hres
))
TRACE
(
"ret %s
\n
"
,
debugstr_w
(
*
ret
));
return
hres
;
}
static
WCHAR
get_pos_char
(
const
dompos_t
*
pos
)
{
switch
(
pos
->
type
)
{
...
...
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