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
0bc9f9a7
Commit
0bc9f9a7
authored
Jan 10, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Fixed hr element handling in range object.
parent
8c686f9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
txtrange.c
dlls/mshtml/txtrange.c
+34
-7
No files found.
dlls/mshtml/txtrange.c
View file @
0bc9f9a7
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
static
const
WCHAR
brW
[]
=
{
'b'
,
'r'
,
0
};
static
const
WCHAR
brW
[]
=
{
'b'
,
'r'
,
0
};
static
const
WCHAR
hrW
[]
=
{
'h'
,
'r'
,
0
};
typedef
struct
{
typedef
struct
{
const
IHTMLTxtRangeVtbl
*
lpHTMLTxtRangeVtbl
;
const
IHTMLTxtRangeVtbl
*
lpHTMLTxtRangeVtbl
;
...
@@ -132,7 +133,7 @@ static PRUint16 get_node_type(nsIDOMNode *node)
...
@@ -132,7 +133,7 @@ static PRUint16 get_node_type(nsIDOMNode *node)
return
type
;
return
type
;
}
}
static
BOOL
is_
br_node
(
nsIDOMNode
*
node
)
static
BOOL
is_
elem_tag
(
nsIDOMNode
*
node
,
LPCWSTR
istag
)
{
{
nsIDOMElement
*
elem
;
nsIDOMElement
*
elem
;
nsAString
tag_str
;
nsAString
tag_str
;
...
@@ -149,8 +150,31 @@ static BOOL is_br_node(nsIDOMNode *node)
...
@@ -149,8 +150,31 @@ static BOOL is_br_node(nsIDOMNode *node)
nsIDOMElement_Release
(
elem
);
nsIDOMElement_Release
(
elem
);
nsAString_GetData
(
&
tag_str
,
&
tag
);
nsAString_GetData
(
&
tag_str
,
&
tag
);
if
(
!
strcmpiW
(
tag
,
brW
))
ret
=
!
strcmpiW
(
tag
,
istag
);
ret
=
TRUE
;
nsAString_Finish
(
&
tag_str
);
return
ret
;
}
static
BOOL
is_space_elem
(
nsIDOMNode
*
node
)
{
nsIDOMElement
*
elem
;
nsAString
tag_str
;
const
PRUnichar
*
tag
;
BOOL
ret
=
FALSE
;
nsresult
nsres
;
nsres
=
nsIDOMNode_QueryInterface
(
node
,
&
IID_nsIDOMElement
,
(
void
**
)
&
elem
);
if
(
NS_FAILED
(
nsres
))
return
FALSE
;
nsAString_Init
(
&
tag_str
,
NULL
);
nsIDOMElement_GetTagName
(
elem
,
&
tag_str
);
nsIDOMElement_Release
(
elem
);
nsAString_GetData
(
&
tag_str
,
&
tag
);
ret
=
!
strcmpiW
(
tag
,
brW
)
||
!
strcmpiW
(
tag
,
hrW
);
nsAString_Finish
(
&
tag_str
);
nsAString_Finish
(
&
tag_str
);
...
@@ -242,9 +266,12 @@ static void wstrbuf_append_node(wstrbuf_t *buf, nsIDOMNode *node)
...
@@ -242,9 +266,12 @@ static void wstrbuf_append_node(wstrbuf_t *buf, nsIDOMNode *node)
break
;
break
;
}
}
case
ELEMENT_NODE
:
case
ELEMENT_NODE
:
if
(
is_
br_node
(
node
))
{
if
(
is_
elem_tag
(
node
,
brW
))
{
static
const
WCHAR
endlW
[]
=
{
'\r'
,
'\n'
};
static
const
WCHAR
endlW
[]
=
{
'\r'
,
'\n'
};
wstrbuf_append_len
(
buf
,
endlW
,
2
);
wstrbuf_append_len
(
buf
,
endlW
,
2
);
}
else
if
(
is_elem_tag
(
node
,
hrW
))
{
static
const
WCHAR
endl2W
[]
=
{
'\r'
,
'\n'
,
'\r'
,
'\n'
};
wstrbuf_append_len
(
buf
,
endl2W
,
4
);
}
}
}
}
}
}
...
@@ -524,7 +551,7 @@ static WCHAR get_pos_char(const dompos_t *pos)
...
@@ -524,7 +551,7 @@ static WCHAR get_pos_char(const dompos_t *pos)
case
TEXT_NODE
:
case
TEXT_NODE
:
return
pos
->
p
[
pos
->
off
];
return
pos
->
p
[
pos
->
off
];
case
ELEMENT_NODE
:
case
ELEMENT_NODE
:
if
(
is_
br_node
(
pos
->
node
))
if
(
is_
space_elem
(
pos
->
node
))
return
'\n'
;
return
'\n'
;
}
}
...
@@ -634,7 +661,7 @@ static WCHAR next_char(const dompos_t *pos, dompos_t *new_pos)
...
@@ -634,7 +661,7 @@ static WCHAR next_char(const dompos_t *pos, dompos_t *new_pos)
return
*
p
;
return
*
p
;
case
ELEMENT_NODE
:
case
ELEMENT_NODE
:
if
(
!
is_
br_node
(
iter
))
if
(
!
is_
space_elem
(
iter
))
break
;
break
;
if
(
cspace
)
if
(
cspace
)
...
@@ -718,7 +745,7 @@ static WCHAR prev_char(HTMLTxtRange *This, const dompos_t *pos, dompos_t *new_po
...
@@ -718,7 +745,7 @@ static WCHAR prev_char(HTMLTxtRange *This, const dompos_t *pos, dompos_t *new_po
}
}
case
ELEMENT_NODE
:
case
ELEMENT_NODE
:
if
(
!
is_
br_node
(
iter
))
if
(
!
is_
space_elem
(
iter
))
break
;
break
;
if
(
skip_space
)
{
if
(
skip_space
)
{
...
...
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