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
91af3c56
Commit
91af3c56
authored
Dec 30, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 31, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Move handle_insert_comment to mutation.c.
parent
327dc2c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
139 deletions
+138
-139
mshtml_private.h
dlls/mshtml/mshtml_private.h
+0
-1
mutation.c
dlls/mshtml/mutation.c
+138
-0
nsevents.c
dlls/mshtml/nsevents.c
+0
-138
No files found.
dlls/mshtml/mshtml_private.h
View file @
91af3c56
...
...
@@ -506,7 +506,6 @@ void NSContainer_Release(NSContainer*);
void
init_mutation
(
NSContainer
*
);
void
set_mutation_observer
(
NSContainer
*
,
nsIDOMHTMLDocument
*
);
BOOL
handle_insert_comment
(
HTMLDocument
*
doc
,
const
PRUnichar
*
comment
);
void
HTMLDocument_LockContainer
(
HTMLDocument
*
,
BOOL
);
void
show_context_menu
(
HTMLDocument
*
,
DWORD
,
POINT
*
,
IDispatch
*
);
...
...
dlls/mshtml/mutation.c
View file @
91af3c56
...
...
@@ -55,6 +55,144 @@ void set_mutation_observer(NSContainer *nscontainer, nsIDOMHTMLDocument *nshtmld
nsIDOMNSDocument_Release
(
nsdoc
);
}
#define IE_MAJOR_VERSION 7
#define IE_MINOR_VERSION 0
static
BOOL
handle_insert_comment
(
HTMLDocument
*
doc
,
const
PRUnichar
*
comment
)
{
DWORD
len
;
int
majorv
=
0
,
minorv
=
0
;
const
PRUnichar
*
ptr
,
*
end
;
nsAString
nsstr
;
PRUnichar
*
buf
;
nsresult
nsres
;
enum
{
CMP_EQ
,
CMP_LT
,
CMP_LTE
,
CMP_GT
,
CMP_GTE
}
cmpt
=
CMP_EQ
;
static
const
PRUnichar
endifW
[]
=
{
'<'
,
'!'
,
'['
,
'e'
,
'n'
,
'd'
,
'i'
,
'f'
,
']'
};
if
(
comment
[
0
]
!=
'['
||
comment
[
1
]
!=
'i'
||
comment
[
2
]
!=
'f'
)
return
FALSE
;
ptr
=
comment
+
3
;
while
(
isspaceW
(
*
ptr
))
ptr
++
;
if
(
ptr
[
0
]
==
'l'
&&
ptr
[
1
]
==
't'
)
{
ptr
+=
2
;
if
(
*
ptr
==
'e'
)
{
cmpt
=
CMP_LTE
;
ptr
++
;
}
else
{
cmpt
=
CMP_LT
;
}
}
else
if
(
ptr
[
0
]
==
'g'
&&
ptr
[
1
]
==
't'
)
{
ptr
+=
2
;
if
(
*
ptr
==
'e'
)
{
cmpt
=
CMP_GTE
;
ptr
++
;
}
else
{
cmpt
=
CMP_GT
;
}
}
if
(
!
isspaceW
(
*
ptr
++
))
return
FALSE
;
while
(
isspaceW
(
*
ptr
))
ptr
++
;
if
(
ptr
[
0
]
!=
'I'
||
ptr
[
1
]
!=
'E'
)
return
FALSE
;
ptr
+=
2
;
if
(
!
isspaceW
(
*
ptr
++
))
return
FALSE
;
while
(
isspaceW
(
*
ptr
))
ptr
++
;
if
(
!
isdigitW
(
*
ptr
))
return
FALSE
;
while
(
isdigitW
(
*
ptr
))
majorv
=
majorv
*
10
+
(
*
ptr
++
-
'0'
);
if
(
*
ptr
==
'.'
)
{
if
(
!
isdigitW
(
*
ptr
))
return
FALSE
;
while
(
isdigitW
(
*
ptr
))
minorv
=
minorv
*
10
+
(
*
ptr
++
-
'0'
);
}
while
(
isspaceW
(
*
ptr
))
ptr
++
;
if
(
ptr
[
0
]
!=
']'
||
ptr
[
1
]
!=
'>'
)
return
FALSE
;
ptr
+=
2
;
len
=
strlenW
(
ptr
);
if
(
len
<
sizeof
(
endifW
)
/
sizeof
(
WCHAR
))
return
FALSE
;
end
=
ptr
+
len
-
sizeof
(
endifW
)
/
sizeof
(
WCHAR
);
if
(
memcmp
(
end
,
endifW
,
sizeof
(
endifW
)))
return
FALSE
;
switch
(
cmpt
)
{
case
CMP_EQ
:
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
==
IE_MINOR_VERSION
)
break
;
return
FALSE
;
case
CMP_LT
:
if
(
majorv
>
IE_MAJOR_VERSION
)
break
;
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
>
IE_MINOR_VERSION
)
break
;
return
FALSE
;
case
CMP_LTE
:
if
(
majorv
>
IE_MAJOR_VERSION
)
break
;
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
>=
IE_MINOR_VERSION
)
break
;
return
FALSE
;
case
CMP_GT
:
if
(
majorv
<
IE_MAJOR_VERSION
)
break
;
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
<
IE_MINOR_VERSION
)
break
;
return
FALSE
;
case
CMP_GTE
:
if
(
majorv
<
IE_MAJOR_VERSION
)
break
;
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
<=
IE_MINOR_VERSION
)
break
;
return
FALSE
;
}
buf
=
heap_alloc
((
end
-
ptr
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
buf
)
return
FALSE
;
memcpy
(
buf
,
ptr
,
(
end
-
ptr
)
*
sizeof
(
WCHAR
));
buf
[
end
-
ptr
]
=
0
;
nsAString_Init
(
&
nsstr
,
buf
);
heap_free
(
buf
);
/* FIXME: Find better way to insert HTML to document. */
nsres
=
nsIDOMHTMLDocument_Write
(
doc
->
nsdoc
,
&
nsstr
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Write failed: %08x
\n
"
,
nsres
);
return
FALSE
;
}
return
TRUE
;
}
static
void
add_script_runner
(
NSContainer
*
This
)
{
nsIDOMNSDocument
*
nsdoc
;
...
...
dlls/mshtml/nsevents.c
View file @
91af3c56
...
...
@@ -175,144 +175,6 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
return
NS_OK
;
}
#define IE_MAJOR_VERSION 7
#define IE_MINOR_VERSION 0
BOOL
handle_insert_comment
(
HTMLDocument
*
doc
,
const
PRUnichar
*
comment
)
{
DWORD
len
;
int
majorv
=
0
,
minorv
=
0
;
const
PRUnichar
*
ptr
,
*
end
;
nsAString
nsstr
;
PRUnichar
*
buf
;
nsresult
nsres
;
enum
{
CMP_EQ
,
CMP_LT
,
CMP_LTE
,
CMP_GT
,
CMP_GTE
}
cmpt
=
CMP_EQ
;
static
const
PRUnichar
endifW
[]
=
{
'<'
,
'!'
,
'['
,
'e'
,
'n'
,
'd'
,
'i'
,
'f'
,
']'
};
if
(
comment
[
0
]
!=
'['
||
comment
[
1
]
!=
'i'
||
comment
[
2
]
!=
'f'
)
return
FALSE
;
ptr
=
comment
+
3
;
while
(
isspaceW
(
*
ptr
))
ptr
++
;
if
(
ptr
[
0
]
==
'l'
&&
ptr
[
1
]
==
't'
)
{
ptr
+=
2
;
if
(
*
ptr
==
'e'
)
{
cmpt
=
CMP_LTE
;
ptr
++
;
}
else
{
cmpt
=
CMP_LT
;
}
}
else
if
(
ptr
[
0
]
==
'g'
&&
ptr
[
1
]
==
't'
)
{
ptr
+=
2
;
if
(
*
ptr
==
'e'
)
{
cmpt
=
CMP_GTE
;
ptr
++
;
}
else
{
cmpt
=
CMP_GT
;
}
}
if
(
!
isspaceW
(
*
ptr
++
))
return
FALSE
;
while
(
isspaceW
(
*
ptr
))
ptr
++
;
if
(
ptr
[
0
]
!=
'I'
||
ptr
[
1
]
!=
'E'
)
return
FALSE
;
ptr
+=
2
;
if
(
!
isspaceW
(
*
ptr
++
))
return
FALSE
;
while
(
isspaceW
(
*
ptr
))
ptr
++
;
if
(
!
isdigitW
(
*
ptr
))
return
FALSE
;
while
(
isdigitW
(
*
ptr
))
majorv
=
majorv
*
10
+
(
*
ptr
++
-
'0'
);
if
(
*
ptr
==
'.'
)
{
if
(
!
isdigitW
(
*
ptr
))
return
FALSE
;
while
(
isdigitW
(
*
ptr
))
minorv
=
minorv
*
10
+
(
*
ptr
++
-
'0'
);
}
while
(
isspaceW
(
*
ptr
))
ptr
++
;
if
(
ptr
[
0
]
!=
']'
||
ptr
[
1
]
!=
'>'
)
return
FALSE
;
ptr
+=
2
;
len
=
strlenW
(
ptr
);
if
(
len
<
sizeof
(
endifW
)
/
sizeof
(
WCHAR
))
return
FALSE
;
end
=
ptr
+
len
-
sizeof
(
endifW
)
/
sizeof
(
WCHAR
);
if
(
memcmp
(
end
,
endifW
,
sizeof
(
endifW
)))
return
FALSE
;
switch
(
cmpt
)
{
case
CMP_EQ
:
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
==
IE_MINOR_VERSION
)
break
;
return
FALSE
;
case
CMP_LT
:
if
(
majorv
>
IE_MAJOR_VERSION
)
break
;
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
>
IE_MINOR_VERSION
)
break
;
return
FALSE
;
case
CMP_LTE
:
if
(
majorv
>
IE_MAJOR_VERSION
)
break
;
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
>=
IE_MINOR_VERSION
)
break
;
return
FALSE
;
case
CMP_GT
:
if
(
majorv
<
IE_MAJOR_VERSION
)
break
;
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
<
IE_MINOR_VERSION
)
break
;
return
FALSE
;
case
CMP_GTE
:
if
(
majorv
<
IE_MAJOR_VERSION
)
break
;
if
(
majorv
==
IE_MAJOR_VERSION
&&
minorv
<=
IE_MINOR_VERSION
)
break
;
return
FALSE
;
}
buf
=
heap_alloc
((
end
-
ptr
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
buf
)
return
FALSE
;
memcpy
(
buf
,
ptr
,
(
end
-
ptr
)
*
sizeof
(
WCHAR
));
buf
[
end
-
ptr
]
=
0
;
nsAString_Init
(
&
nsstr
,
buf
);
heap_free
(
buf
);
/* FIXME: Find better way to insert HTML to document. */
nsres
=
nsIDOMHTMLDocument_Write
(
doc
->
nsdoc
,
&
nsstr
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Write failed: %08x
\n
"
,
nsres
);
return
FALSE
;
}
return
TRUE
;
}
static
nsresult
NSAPI
handle_htmlevent
(
nsIDOMEventListener
*
iface
,
nsIDOMEvent
*
event
)
{
NSContainer
*
This
=
NSEVENTLIST_THIS
(
iface
)
->
This
;
...
...
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