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
e567f309
Commit
e567f309
authored
Nov 12, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLTxtRange::pasteHTML implementation.
parent
d619fd2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
2 deletions
+55
-2
dom.c
dlls/mshtml/tests/dom.c
+27
-0
txtrange.c
dlls/mshtml/txtrange.c
+28
-2
No files found.
dlls/mshtml/tests/dom.c
View file @
e567f309
...
...
@@ -2148,6 +2148,17 @@ static void _test_range_isequal(unsigned line, IHTMLTxtRange *range1, IHTMLTxtRa
}
}
#define test_range_paste_html(a,b) _test_range_paste_html(__LINE__,a,b)
static
void
_test_range_paste_html
(
unsigned
line
,
IHTMLTxtRange
*
range
,
const
char
*
html
)
{
BSTR
str
=
a2bstr
(
html
);
HRESULT
hres
;
hres
=
IHTMLTxtRange_pasteHTML
(
range
,
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"pasteHTML failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
}
#define test_range_parent(r,t) _test_range_parent(__LINE__,r,t)
static
void
_test_range_parent
(
unsigned
line
,
IHTMLTxtRange
*
range
,
elem_type_t
type
)
{
...
...
@@ -5050,6 +5061,22 @@ static void test_txtrange(IHTMLDocument2 *doc)
test_range_text
(
range
,
"abc xyz abc 123
\r\n
it's text"
);
test_range_parent
(
range
,
ET_BODY
);
test_range_move
(
range
,
wordW
,
1
,
1
);
test_range_moveend
(
range
,
characterW
,
12
,
12
);
test_range_text
(
range
,
"xyz abc 123"
);
test_range_collapse
(
range
,
VARIANT_TRUE
);
test_range_paste_html
(
range
,
"<br>paste<br>"
);
test_range_text
(
range
,
NULL
);
test_range_moveend
(
range
,
characterW
,
3
,
3
);
test_range_text
(
range
,
"xyz"
);
hres
=
IHTMLTxtRange_moveToElementText
(
range
,
body
);
ok
(
hres
==
S_OK
,
"moveToElementText failed: %08x
\n
"
,
hres
);
test_range_text
(
range
,
"abc
\r\n
paste
\r\n
xyz abc 123
\r\n
it's text"
);
IHTMLElement_Release
(
body
);
IHTMLTxtRange_Release
(
range
);
...
...
dlls/mshtml/txtrange.c
View file @
e567f309
...
...
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
#include <assert.h>
#define COBJMACROS
...
...
@@ -1572,8 +1573,33 @@ static HRESULT WINAPI HTMLTxtRange_select(IHTMLTxtRange *iface)
static
HRESULT
WINAPI
HTMLTxtRange_pasteHTML
(
IHTMLTxtRange
*
iface
,
BSTR
html
)
{
HTMLTxtRange
*
This
=
impl_from_IHTMLTxtRange
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
html
));
return
E_NOTIMPL
;
nsIDOMDocumentFragment
*
doc_frag
;
nsAString
nsstr
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
html
));
nsres
=
nsIDOMRange_Collapse
(
This
->
nsrange
,
TRUE
);
assert
(
nsres
==
NS_OK
);
nsAString_InitDepend
(
&
nsstr
,
html
);
nsres
=
nsIDOMRange_CreateContextualFragment
(
This
->
nsrange
,
&
nsstr
,
&
doc_frag
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateContextualFragment failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMRange_InsertNode
(
This
->
nsrange
,
(
nsIDOMNode
*
)
doc_frag
);
nsIDOMDocumentFragment_Release
(
doc_frag
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"InsertNode failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMRange_Collapse
(
This
->
nsrange
,
FALSE
);
assert
(
nsres
==
NS_OK
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLTxtRange_moveToElementText
(
IHTMLTxtRange
*
iface
,
IHTMLElement
*
element
)
...
...
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