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
aa4d9190
Commit
aa4d9190
authored
Mar 12, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Move user mode to GeckoBrowser.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
98db6a0d
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
33 additions
and
33 deletions
+33
-33
editor.c
dlls/mshtml/editor.c
+11
-11
htmldoc.c
dlls/mshtml/htmldoc.c
+0
-1
htmlwindow.c
dlls/mshtml/htmlwindow.c
+1
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-2
mutation.c
dlls/mshtml/mutation.c
+2
-2
nsembed.c
dlls/mshtml/nsembed.c
+1
-0
nsevents.c
dlls/mshtml/nsevents.c
+4
-4
olecmd.c
dlls/mshtml/olecmd.c
+4
-4
oleobj.c
dlls/mshtml/oleobj.c
+4
-4
persist.c
dlls/mshtml/persist.c
+3
-3
view.c
dlls/mshtml/view.c
+1
-1
No files found.
dlls/mshtml/editor.c
View file @
aa4d9190
...
...
@@ -95,19 +95,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static
const
WCHAR
fontW
[]
=
{
'f'
,
'o'
,
'n'
,
't'
,
0
};
static
const
WCHAR
sizeW
[]
=
{
's'
,
'i'
,
'z'
,
'e'
,
0
};
void
set_dirty
(
HTMLDocument
*
This
,
VARIANT_BOOL
dirty
)
void
set_dirty
(
GeckoBrowser
*
browser
,
VARIANT_BOOL
dirty
)
{
nsresult
nsres
;
if
(
This
->
doc_obj
->
usermode
!=
EDITMODE
||
!
This
->
doc_obj
->
nscontainer
||
!
This
->
doc_obj
->
nscontain
er
->
editor
)
if
(
browser
->
usermode
!=
EDITMODE
||
!
brows
er
->
editor
)
return
;
if
(
dirty
)
{
nsres
=
nsIEditor_IncrementModificationCount
(
This
->
doc_obj
->
nscontain
er
->
editor
,
1
);
nsres
=
nsIEditor_IncrementModificationCount
(
brows
er
->
editor
,
1
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"IncrementModificationCount failed: %08x
\n
"
,
nsres
);
}
else
{
nsres
=
nsIEditor_ResetModificationCount
(
This
->
doc_obj
->
nscontain
er
->
editor
);
nsres
=
nsIEditor_ResetModificationCount
(
brows
er
->
editor
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"ResetModificationCount failed: %08x
\n
"
,
nsres
);
}
...
...
@@ -149,7 +149,7 @@ static DWORD query_ns_edit_status(HTMLDocument *This, const char *nscmd)
nsICommandParams
*
nsparam
;
cpp_bool
b
=
FALSE
;
if
(
This
->
doc_
obj
->
usermode
!=
EDITMODE
||
This
->
window
->
readystate
<
READYSTATE_INTERACTIVE
)
if
(
This
->
doc_
node
->
browser
->
usermode
!=
EDITMODE
||
This
->
window
->
readystate
<
READYSTATE_INTERACTIVE
)
return
OLECMDF_SUPPORTED
;
if
(
This
->
doc_obj
->
nscontainer
&&
nscmd
)
{
...
...
@@ -186,7 +186,7 @@ static DWORD query_align_status(HTMLDocument *This, const WCHAR *align)
cpp_bool
b
;
nsresult
nsres
;
if
(
This
->
doc_
obj
->
usermode
!=
EDITMODE
||
This
->
window
->
readystate
<
READYSTATE_INTERACTIVE
)
if
(
This
->
doc_
node
->
browser
->
usermode
!=
EDITMODE
||
This
->
window
->
readystate
<
READYSTATE_INTERACTIVE
)
return
OLECMDF_SUPPORTED
;
nsAString_Init
(
&
justify_str
,
align
);
...
...
@@ -376,7 +376,7 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
nsAString_Finish
(
&
size_str
);
set_dirty
(
This
,
VARIANT_TRUE
);
set_dirty
(
This
->
doc_node
->
browser
,
VARIANT_TRUE
);
}
static
void
handle_arrow_key
(
HTMLDocument
*
This
,
nsIDOMEvent
*
event
,
nsIDOMKeyEvent
*
key_event
,
const
char
*
const
cmds
[
4
])
...
...
@@ -691,7 +691,7 @@ static HRESULT query_justify(HTMLDocument *This, OLECMD *cmd)
case
IDM_JUSTIFYLEFT
:
TRACE
(
"(%p) IDM_JUSTIFYLEFT
\n
"
,
This
);
/* FIXME: We should set OLECMDF_LATCHED only if it's set explicitly. */
if
(
This
->
doc_
obj
->
usermode
!=
EDITMODE
||
This
->
window
->
readystate
<
READYSTATE_INTERACTIVE
)
if
(
This
->
doc_
node
->
browser
->
usermode
!=
EDITMODE
||
This
->
window
->
readystate
<
READYSTATE_INTERACTIVE
)
cmd
->
cmdf
=
OLECMDF_SUPPORTED
;
else
cmd
->
cmdf
=
OLECMDF_SUPPORTED
|
OLECMDF_ENABLED
;
...
...
@@ -925,7 +925,7 @@ static HRESULT exec_setdirty(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
return
S_OK
;
if
(
V_VT
(
in
)
==
VT_BOOL
)
set_dirty
(
This
,
V_BOOL
(
in
));
set_dirty
(
This
->
doc_node
->
browser
,
V_BOOL
(
in
));
else
FIXME
(
"unsupported arg %s
\n
"
,
debugstr_variant
(
in
));
...
...
@@ -1240,10 +1240,10 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
IMoniker
*
mon
;
HRESULT
hres
;
if
(
doc
->
usermode
==
EDITMODE
)
if
(
doc
->
nscontainer
->
usermode
==
EDITMODE
)
return
S_OK
;
doc
->
usermode
=
EDITMODE
;
doc
->
nscontainer
->
usermode
=
EDITMODE
;
if
(
doc
->
basedoc
.
window
->
mon
)
{
CLSID
clsid
=
IID_NULL
;
...
...
dlls/mshtml/htmldoc.c
View file @
aa4d9190
...
...
@@ -5458,7 +5458,6 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
doc
->
basedoc
.
doc_obj
=
doc
;
doc
->
is_mhtml
=
is_mhtml
;
doc
->
usermode
=
UNKNOWN_USERMODE
;
doc
->
task_magic
=
get_task_target_magic
();
HTMLDocument_View_Init
(
doc
);
...
...
dlls/mshtml/htmlwindow.c
View file @
aa4d9190
...
...
@@ -3641,7 +3641,7 @@ HRESULT update_window_doc(HTMLInnerWindow *window)
if
(
FAILED
(
hres
))
return
hres
;
if
(
outer_window
->
doc_obj
->
usermode
==
EDITMODE
)
{
if
(
outer_window
->
browser
->
usermode
==
EDITMODE
)
{
nsAString
mode_str
;
nsresult
nsres
;
...
...
dlls/mshtml/mshtml_private.h
View file @
aa4d9190
...
...
@@ -683,7 +683,6 @@ struct HTMLDocumentObj {
BOOL
has_popup
;
INT
download_state
;
USERMODE
usermode
;
LPWSTR
mime
;
DWORD
update
;
...
...
@@ -727,6 +726,7 @@ struct GeckoBrowser {
HWND
hwnd
;
SCRIPTMODE
script_mode
;
USERMODE
usermode
;
struct
list
document_nodes
;
struct
list
outer_windows
;
...
...
@@ -1142,7 +1142,7 @@ HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
HRESULT
editor_exec_paste
(
HTMLDocument
*
,
DWORD
,
VARIANT
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
void
handle_edit_load
(
HTMLDocument
*
)
DECLSPEC_HIDDEN
;
HRESULT
editor_is_dirty
(
HTMLDocument
*
)
DECLSPEC_HIDDEN
;
void
set_dirty
(
HTMLDocument
*
,
VARIANT_BOOL
)
DECLSPEC_HIDDEN
;
void
set_dirty
(
GeckoBrowser
*
,
VARIANT_BOOL
)
DECLSPEC_HIDDEN
;
extern
DWORD
mshtml_tls
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/mutation.c
View file @
aa4d9190
...
...
@@ -262,7 +262,7 @@ static void parse_complete(HTMLDocumentObj *doc)
{
TRACE
(
"(%p)
\n
"
,
doc
);
if
(
doc
->
usermode
==
EDITMODE
)
if
(
doc
->
nscontainer
->
usermode
==
EDITMODE
)
init_editor
(
&
doc
->
basedoc
);
call_explorer_69
(
doc
);
...
...
@@ -271,7 +271,7 @@ static void parse_complete(HTMLDocumentObj *doc)
call_property_onchanged
(
&
doc
->
basedoc
.
cp_container
,
1005
);
call_explorer_69
(
doc
);
if
(
doc
->
webbrowser
&&
doc
->
usermode
!=
EDITMODE
&&
!
(
doc
->
basedoc
.
window
->
load_flags
&
BINDING_REFRESH
))
if
(
doc
->
webbrowser
&&
doc
->
nscontainer
->
usermode
!=
EDITMODE
&&
!
(
doc
->
basedoc
.
window
->
load_flags
&
BINDING_REFRESH
))
IDocObjectService_FireNavigateComplete2
(
doc
->
doc_object_service
,
&
doc
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
,
0
);
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
...
...
dlls/mshtml/nsembed.c
View file @
aa4d9190
...
...
@@ -2168,6 +2168,7 @@ HRESULT create_gecko_browser(HTMLDocumentObj *doc, GeckoBrowser **_ret)
ret
->
doc
=
doc
;
ret
->
ref
=
1
;
ret
->
script_mode
=
SCRIPTMODE_ACTIVESCRIPT
;
ret
->
usermode
=
UNKNOWN_USERMODE
;
list_init
(
&
ret
->
document_nodes
);
list_init
(
&
ret
->
outer_windows
);
...
...
dlls/mshtml/nsevents.c
View file @
aa4d9190
...
...
@@ -175,14 +175,14 @@ static nsresult NSAPI handle_keypress(nsIDOMEventListener *iface,
HTMLDocumentNode
*
doc
=
This
->
This
->
doc
;
HTMLDocumentObj
*
doc_obj
;
if
(
!
doc
)
if
(
!
doc
||
!
doc
->
browser
)
return
NS_ERROR_FAILURE
;
doc_obj
=
doc
->
basedoc
.
doc_obj
;
TRACE
(
"(%p)->(%p)
\n
"
,
doc
,
event
);
update_doc
(
doc_obj
,
UPDATE_UI
);
if
(
doc
_obj
->
usermode
==
EDITMODE
)
if
(
doc
->
browser
->
usermode
==
EDITMODE
)
handle_edit_event
(
&
doc_obj
->
basedoc
,
event
);
return
NS_OK
;
...
...
@@ -198,7 +198,7 @@ static void handle_docobj_load(HTMLDocumentObj *doc)
doc
->
nscontainer
->
editor_controller
=
NULL
;
}
if
(
doc
->
usermode
==
EDITMODE
)
if
(
doc
->
nscontainer
->
usermode
==
EDITMODE
)
handle_edit_load
(
&
doc
->
basedoc
);
if
(
doc
->
client
)
{
...
...
@@ -262,7 +262,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
update_title
(
doc_obj
);
}
if
(
doc_obj
&&
doc_obj
->
usermode
!=
EDITMODE
&&
doc_obj
->
doc_object_service
if
(
doc_obj
&&
doc_obj
->
nscontainer
->
usermode
!=
EDITMODE
&&
doc_obj
->
doc_object_service
&&
!
(
doc
->
basedoc
.
window
->
load_flags
&
BINDING_REFRESH
))
IDocObjectService_FireDocumentComplete
(
doc_obj
->
doc_object_service
,
&
doc
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
,
0
);
...
...
dlls/mshtml/olecmd.c
View file @
aa4d9190
...
...
@@ -583,7 +583,7 @@ static HRESULT exec_mshtml_copy(HTMLDocument *This, DWORD cmdexecopt, VARIANT *i
{
TRACE
(
"(%p)->(%08x %p %p)
\n
"
,
This
,
cmdexecopt
,
in
,
out
);
if
(
This
->
doc_
obj
->
usermode
==
EDITMODE
)
if
(
This
->
doc_
node
->
browser
->
usermode
==
EDITMODE
)
return
editor_exec_copy
(
This
,
cmdexecopt
,
in
,
out
);
do_ns_command
(
This
,
NSCMD_COPY
,
NULL
);
...
...
@@ -604,7 +604,7 @@ static HRESULT exec_mshtml_cut(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in
TRACE
(
"(%p)->(%08x %p %p)
\n
"
,
This
,
cmdexecopt
,
in
,
out
);
if
(
This
->
doc_
obj
->
usermode
==
EDITMODE
)
if
(
This
->
doc_
node
->
browser
->
usermode
==
EDITMODE
)
return
editor_exec_cut
(
This
,
cmdexecopt
,
in
,
out
);
clipboard_commands
=
get_clipboard_commands
(
This
);
...
...
@@ -635,7 +635,7 @@ static HRESULT exec_mshtml_paste(HTMLDocument *This, DWORD cmdexecopt, VARIANT *
TRACE
(
"(%p)->(%08x %p %p)
\n
"
,
This
,
cmdexecopt
,
in
,
out
);
if
(
This
->
doc_
obj
->
usermode
==
EDITMODE
)
if
(
This
->
doc_
node
->
browser
->
usermode
==
EDITMODE
)
return
editor_exec_paste
(
This
,
cmdexecopt
,
in
,
out
);
clipboard_commands
=
get_clipboard_commands
(
This
);
...
...
@@ -667,7 +667,7 @@ static HRESULT exec_browsemode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in
if
(
in
||
out
)
FIXME
(
"unsupported args
\n
"
);
This
->
doc_
obj
->
usermode
=
BROWSEMODE
;
This
->
doc_
node
->
browser
->
usermode
=
BROWSEMODE
;
return
S_OK
;
}
...
...
dlls/mshtml/oleobj.c
View file @
aa4d9190
...
...
@@ -270,7 +270,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
if
(
This
->
doc_obj
->
client
)
{
IOleClientSite_Release
(
This
->
doc_obj
->
client
);
This
->
doc_obj
->
client
=
NULL
;
This
->
doc_obj
->
usermode
=
UNKNOWN_USERMODE
;
This
->
doc_obj
->
nscontainer
->
usermode
=
UNKNOWN_USERMODE
;
}
if
(
This
->
doc_obj
->
client_cmdtrg
)
{
...
...
@@ -433,7 +433,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
OLECMDEXECOPT_DONTPROMPTUSER
,
&
var
,
NULL
);
}
if
(
This
->
doc_obj
->
usermode
==
UNKNOWN_USERMODE
)
if
(
This
->
doc_obj
->
nscontainer
->
usermode
==
UNKNOWN_USERMODE
)
IOleControl_OnAmbientPropertyChange
(
&
This
->
IOleControl_iface
,
DISPID_AMBIENT_USERMODE
);
IOleControl_OnAmbientPropertyChange
(
&
This
->
IOleControl_iface
,
...
...
@@ -886,10 +886,10 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
if
(
V_VT
(
&
res
)
==
VT_BOOL
)
{
if
(
V_BOOL
(
&
res
))
{
This
->
doc_obj
->
usermode
=
BROWSEMODE
;
This
->
doc_obj
->
nscontainer
->
usermode
=
BROWSEMODE
;
}
else
{
FIXME
(
"edit mode is not supported
\n
"
);
This
->
doc_obj
->
usermode
=
EDITMODE
;
This
->
doc_obj
->
nscontainer
->
usermode
=
EDITMODE
;
}
}
else
{
FIXME
(
"usermode=%s
\n
"
,
debugstr_variant
(
&
res
));
...
...
dlls/mshtml/persist.c
View file @
aa4d9190
...
...
@@ -230,7 +230,7 @@ static void set_progress_proc(task_t *_task)
IOleCommandTarget_Release
(
olecmd
);
}
if
(
doc
->
usermode
==
EDITMODE
&&
doc
->
hostui
)
{
if
(
doc
->
nscontainer
->
usermode
==
EDITMODE
&&
doc
->
hostui
)
{
DOCHOSTUIINFO
hostinfo
;
memset
(
&
hostinfo
,
0
,
sizeof
(
DOCHOSTUIINFO
));
...
...
@@ -884,7 +884,7 @@ static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
doc_obj
->
usermode
==
EDITMODE
)
if
(
This
->
doc_obj
->
nscontainer
->
usermode
==
EDITMODE
)
return
editor_is_dirty
(
This
);
return
S_FALSE
;
...
...
@@ -934,7 +934,7 @@ static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, IStream
heap_free
(
str
);
if
(
fClearDirty
)
set_dirty
(
This
,
VARIANT_FALSE
);
set_dirty
(
This
->
doc_obj
->
nscontainer
,
VARIANT_FALSE
);
return
S_OK
;
}
...
...
dlls/mshtml/view.c
View file @
aa4d9190
...
...
@@ -633,7 +633,7 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
if
(
This
->
hostui
)
{
hres
=
IDocHostUIHandler_ShowUI
(
This
->
hostui
,
This
->
usermode
==
EDITMODE
?
DOCHOSTUITYPE_AUTHOR
:
DOCHOSTUITYPE_BROWSE
,
This
->
nscontainer
->
usermode
==
EDITMODE
?
DOCHOSTUITYPE_AUTHOR
:
DOCHOSTUITYPE_BROWSE
,
&
This
->
basedoc
.
IOleInPlaceActiveObject_iface
,
&
This
->
basedoc
.
IOleCommandTarget_iface
,
This
->
frame
,
This
->
ip_window
);
if
(
FAILED
(
hres
))
...
...
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