sync mshtml to wine 1.1.33

svn path=/trunk/; revision=44189
This commit is contained in:
Christoph von Wittich 2009-11-15 23:44:20 +00:00
parent 20028cfb2f
commit f12b3f3e8d
68 changed files with 3159 additions and 1330 deletions

View file

@ -28,16 +28,16 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "Èíñòàëèðàíå..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Wine Gecko Installer"
FONT 8, "MS Shell Dlg"
{
LTEXT "Приложението се опитва да покаже HTML страница. За да бъде показана страницата, " \
"трябва да имате Gecko (HTML машината на Mozilla) инсталиран. Желаете ли Gecko " \
"да бъде изтеглен и инсталиран?", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Íàïðåäúê", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "Инсталирай", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Отказ", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "Èíñòàëèðàé", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Îòêàç", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}

View file

@ -30,17 +30,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "Installerer..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Installere Wine Gecko"
FONT 8, "MS Shell Dlg"
{
LTEXT "Dette program prøver at vise en HTML-side. Wine har brug for Gecko" \
"(Mozillas HTML motor) for at vise denne siden. Vælg Installer hvis " \
"du vil have at Wine skal hente og installere Gecko automatisk.", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progress", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "&Installer", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Annuller", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "&Installer", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Annuller", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65

View file

@ -37,10 +37,10 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN
CAPTION "Wine-Gecko-Installation"
FONT 8, "MS Shell Dlg"
{
LTEXT "Diese Anwendung versucht, eine HTML-Seite anzuzeigen. Wine muss " \
"Gecko (Mozilla HTML-Bibliothek) installieren um die Seite " \
"anzuzeigen. Klicken Sie auf „Installieren“, um Gecko automatisch " \
"herunterzuladen und zu installieren.", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Fortschritt", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
DEFPUSHBUTTON "&Installieren", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Abbrechen", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP

View file

@ -28,17 +28,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "Installing..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Wine Gecko Installer"
FONT 8, "MS Shell Dlg"
{
LTEXT "This application is trying to show an HTML page. Wine needs Gecko (Mozilla HTML " \
"engine) to be installed to show the page. Click install if you want Wine to " \
"automatically download and install Gecko.", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progress", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "&Install", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Cancel", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "&Install", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Cancel", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65

View file

@ -35,9 +35,10 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN
CAPTION "Instalador de Gecko de Wine"
FONT 8, "MS Shell Dlg"
{
LTEXT "Está aplicación está intentando mostrar una página HTML. Wine necesita que Gecko (Motor HTML" \
" de Mozilla) esté instalado para mostrar la página. Pulse Instalar si desea que Wine " \
"descargue e instale automáticamente Gecko.", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progreso", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
DEFPUSHBUTTON "&Instalar", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Cancelar", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP

View file

@ -39,9 +39,10 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN
CAPTION "Programme d'installation de Gecko pour Wine"
FONT 8, "MS Shell Dlg"
{
LTEXT "Cette application essaie d'afficher une page HTML. Wine requiert la présence du moteur de rendu Gecko de Mozilla " \
"pour afficher cette page. Cliquez sur Installer si vous souhaitez que Wine " \
"télécharge et installe automatiquement Gecko.", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progression", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
DEFPUSHBUTTON "&Installer", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Annuler", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP

View file

@ -31,17 +31,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "インストールしています..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Wine Gecko インストーラ"
FONT 9, "MS Shell Dlg"
{
LTEXT "このアプリケーションは HTML ページを表示しようとしています。ページを表示するには Wine に" \
"GeckoMozilla の HTML エンジンをインストールする必要があります。Wine が自動的に Gecko をダウンロードしインストールするようにしたいならば" \
" [インストール] をクリックしてください。", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progress", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "インストール(&I)", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "キャンセル(&C)", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "インストール(&I)", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "キャンセル(&C)", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65

View file

@ -29,17 +29,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "설치 중..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Wine Gecko 설치 풀그림"
FONT 9, "MS Shell Dlg"
{
LTEXT "이 어플리케이션은 HTML 페이지를 보여주려고 합니다. Wine은 이 페이지를 보여주기 위해를 " \
"Gecko (Mozilla HTML 엔진)를 설치할 것입니다. Wine이 자동으로 Gecko를 다운로드하고 설치하기를 원한다면 " \
"[설치]버튼을 클릭하십시오", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "진행중", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "설치(&I)", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "취소(&C)", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "¼³Ä¡(&I)", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Ãë¼Ò(&C)", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65

View file

@ -31,17 +31,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "Įdiegiama..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Wine Gecko diegimo programa"
FONT 8, "MS Shell Dlg"
{
LTEXT "Ši programa mėgina parodyti HTML puslapį. Šiam puslapiui parodyti reikia, kad būtų " \
"įdiegtas Gecko (Mozilla HTML variklis). Spauskite įdiegti, jei norite, kad Wine " \
"automatiškai atsiųstų ir įdiegtų Gecko.", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Eiga", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "&Įdiegti", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Atsisakyti", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "&Įdiegti", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Atsisakyti", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65

View file

@ -35,10 +35,10 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN
CAPTION "Wine-Gecko-Installatie"
FONT 8, "MS Shell Dlg"
{
LTEXT "Dit programma probeert een HTML-pagina weer te geven. Wine moet " \
"Gecko (Mozilla HTML-Bibliotheek) installeren om de pagina " \
"weer te kunnen geven. Klik op Installeren, om Gecko automatisch " \
"te downloaden en te installeren.", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Voortgang", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
DEFPUSHBUTTON "&Installeren", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Afbreken", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP

View file

@ -32,17 +32,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "Installerer..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Installere Wine Gecko"
FONT 8, "MS Shell Dlg"
{
LTEXT "Dette programmer prøver å vise en HTML-side. Wine trenger Gecko " \
"(Mozillas HTML-motor) for å vise denne siden. Velg «Installer» hvis " \
"du vil at Wine skal laste ned og installere Gecko automatisk.", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progress", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "&Installer", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Avbryt", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "&Installer", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Avbryt", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65

View file

@ -29,17 +29,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "Instalacja..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Instalator Wine Gecko"
FONT 8, "MS Shell Dlg"
{
LTEXT "Ta aplikacja próbuje wyświetlić stronę HTML. Wine potrzebuje w tym celu zainstalować " \
"Gecko (silnik HTML przeglądarek Mozilla). Wybierz 'Instaluj' jeżeli chcesz automatycznie " \
"pobrać z Internetu i zainstalować Gecko.", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progress", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "&Instaluj", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Anuluj", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "&Instaluj", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Anuluj", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65

View file

@ -35,9 +35,10 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN
CAPTION "Instalador Wine Gecko"
FONT 8, "MS Shell Dlg"
{
LTEXT "Esta aplicação está a tentar mostrar uma página HTML. O Wine precisa que o Gecko " \
"(Motor HTML Mozilla) seja instalado para mostrar a página. Clique em Instalar se deseja que o Wine " \
"descarregue e instale o Gecko automaticamente.", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progresso", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
DEFPUSHBUTTON "&Instalar", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Cancelar", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP

View file

@ -36,7 +36,10 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN
CAPTION "Instalator Wine Gecko"
FONT 8, "MS Shell Dlg"
{
LTEXT "Această aplicație încearcă să afișeze o pagină HTML. Wine are nevoie de Gecko (motorul de HTML Mozilla) pentru a afișa această pagină. Apăsați „Instalează” dacă doriți ca Wine să descarce și să instaleze Gecko în mod automat.", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progres", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
DEFPUSHBUTTON "&Instalează", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Renunță", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP

View file

@ -31,17 +31,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "Установка..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 261, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 261, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Установка Wine Gecko"
FONT 8, "MS Shell Dlg"
{
LTEXT "Эта программа пытается отобразить HTML страницу. Для её отображения Wine необходимо " \
"установить Gecko (Mozilla HTML engine). Нажмите кнопку установить если вы хотите, что бы Wine " \
"автоматически загрузил и установил Gecko.", ID_DWL_STATUS, 10, 10, 240, 33, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Прогресс", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 46, 240, 12
DEFPUSHBUTTON "&Установить", ID_DWL_INSTALL, 200, 63, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Отмена", IDCANCEL, 140, 63, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "&Установить", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Отмена", IDCANCEL, 140, 63, 70, 15, WS_GROUP | WS_TABSTOP
}
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65

View file

@ -35,10 +35,10 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN
CAPTION "Namestitev Wine Gecko"
FONT 8, "MS Shell Dlg"
{
LTEXT "Ta program poskuša prikazati HTML stran. Wine za prikaz spletnih strani " \
"potrebuje Gecko (Mozillin HTML prikazovalnik). Kliknite Namesti, če " \
"želite, da Wine samodejno naloži in namesti Gecko (potrebna je povezava " \
"z internetom).", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Napredek", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
DEFPUSHBUTTON "&Namesti", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Prekliči", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP

View file

@ -28,17 +28,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "Installerar..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Wine Gecko Installationsprogram"
FONT 8, "MS Shell Dlg"
{
LTEXT "Detta program försöker visa en HTML-sida. Wine behöver ha Gecko (Mozillas HTML-" \
"programvara) installerad för att visa sidan. Välj Installera om du vill att Wine " \
"automatiskt ska hämta och installera Gecko.", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Förlopp", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "&Installera", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Avbryt", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "&Installera", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Avbryt", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}

View file

@ -33,9 +33,10 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN
CAPTION "Wine Gecko Kurucusu"
FONT 8, "MS Shell Dlg"
{
LTEXT "Bu uygulama bir HTML sayfası göstermeye çalışıyor. Wine, sayfanın gösterilmesi " \
"için Gecko (Mozilla HTML motoru)'nun kurulu olmasını gerektirir. Gecko motorunun " \
"otomatik olarak indirilmesi ve kurulması için Kur'u tıklayın.", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Ýlerleme", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
DEFPUSHBUTTON "&Kur", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Ýptal", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP

View file

@ -33,17 +33,18 @@ STRINGTABLE DISCARDABLE
IDS_INSTALLING "正在安装..."
}
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Wine Gecko 安装"
FONT 9, "MS Shell Dlg"
{
LTEXT "这个运用程序要显示一个HTML 网页. Wine 需要装上 Gecko (Mozilla HTML " \
"engine)才能显示HTML网页. 如果你想自动下载和安装Gecko" \
"请按'安装'.", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
LTEXT "Wine could not find a Gecko package which is needed for applications embedding HTML " \
"to work correctly. Wine can automatically download and install it for you.\n\n" \
"Note: it's recommended to use distro packages instead. See http://wiki.winehq.org/Gecko for details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Progress", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
DEFPUSHBUTTON "安装(&I)", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "取消(&C)", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "安装(&I)", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
PUSHBUTTON "取消(&C)", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
}
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65

View file

@ -73,6 +73,8 @@ struct dispex_dynamic_data_t {
#define DISPID_DYNPROP_0 0x50000000
#define DISPID_DYNPROP_MAX 0x5fffffff
#define FDEX_VERSION_MASK 0xf0000000
static ITypeLib *typelib;
static ITypeInfo *typeinfos[LAST_tid];
static struct list dispex_data_list = LIST_INIT(dispex_data_list);
@ -123,8 +125,10 @@ static REFIID tid_ids[] = {
&IID_IHTMLElement4,
&IID_IHTMLElementCollection,
&IID_IHTMLEventObj,
&IID_IHTMLFrameBase,
&IID_IHTMLFrameBase2,
&IID_IHTMLGenericElement,
&IID_IHTMLImageElementFactory,
&IID_IHTMLImgElement,
&IID_IHTMLInputElement,
&IID_IHTMLLocation,
@ -220,7 +224,7 @@ static void add_func_info(dispex_data_t *data, DWORD *size, tid_t tid, const FUN
data->funcs[data->func_cnt].id = desc->memid;
data->funcs[data->func_cnt].tid = tid;
data->funcs[data->func_cnt].func_disp_idx = desc->invkind == INVOKE_FUNC ? data->func_disp_cnt++ : -1;
data->funcs[data->func_cnt].func_disp_idx = (desc->invkind & DISPATCH_METHOD) ? data->func_disp_cnt++ : -1;
data->func_cnt++;
}
@ -364,11 +368,13 @@ static inline dispex_dynamic_data_t *get_dynamic_data(DispatchEx *This, BOOL all
: (This->dynamic_data = heap_alloc_zero(sizeof(dispex_dynamic_data_t)));
}
static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, BOOL alloc, dynamic_prop_t **ret)
static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, DWORD flags, dynamic_prop_t **ret)
{
dispex_dynamic_data_t *data = get_dynamic_data(This, alloc);
const BOOL alloc = flags & fdexNameEnsure;
dispex_dynamic_data_t *data;
unsigned i;
data = get_dynamic_data(This, alloc);
if(!data) {
if(alloc)
return E_OUTOFMEMORY;
@ -378,12 +384,15 @@ static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, BOOL alloc,
}
for(i=0; i < data->prop_cnt; i++) {
if(!strcmpW(data->props[i].name, name)) {
if(flags & fdexNameCaseInsensitive ? !strcmpiW(data->props[i].name, name) : !strcmpW(data->props[i].name, name)) {
*ret = data->props+i;
return S_OK;
}
}
if(!alloc)
return DISP_E_UNKNOWNNAME;
TRACE("creating dynamic prop %s\n", debugstr_w(name));
if(!data->buf_size) {
@ -414,7 +423,7 @@ HRESULT dispex_get_dprop_ref(DispatchEx *This, const WCHAR *name, BOOL alloc, VA
dynamic_prop_t *prop;
HRESULT hres;
hres = get_dynamic_prop(This, name, alloc, &prop);
hres = get_dynamic_prop(This, name, alloc ? fdexNameEnsure : 0, &prop);
if(FAILED(hres))
return hres;
@ -514,6 +523,9 @@ static HRESULT function_value(IUnknown *iface, LCID lcid, WORD flags, DISPPARAMS
HRESULT hres;
switch(flags) {
case DISPATCH_METHOD|DISPATCH_PROPERTYGET:
if(!res)
return E_INVALIDARG;
case DISPATCH_METHOD:
hres = typeinfo_invoke(This->obj, This->info, flags, params, res, ei);
break;
@ -570,6 +582,9 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags,
HRESULT hres;
switch(flags) {
case DISPATCH_METHOD|DISPATCH_PROPERTYGET:
if(!res)
return E_INVALIDARG;
case DISPATCH_METHOD:
hres = typeinfo_invoke(This, func, flags, dp, res, ei);
break;
@ -736,7 +751,7 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
if(grfdex & ~(fdexNameCaseSensitive|fdexNameEnsure|fdexNameImplicit))
if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK))
FIXME("Unsupported grfdex %x\n", grfdex);
data = get_dispex_data(This);
@ -772,7 +787,7 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
return hres;
}
hres = get_dynamic_prop(This, bstrName, grfdex&fdexNameEnsure, &dprop);
hres = get_dynamic_prop(This, bstrName, grfdex, &dprop);
if(FAILED(hres))
return hres;
@ -794,8 +809,16 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
return This->data->vtbl->invoke(This->outer, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
if(wFlags == DISPATCH_CONSTRUCT) {
FIXME("DISPATCH_CONSTRUCT not implemented\n");
return E_NOTIMPL;
if(id == DISPID_VALUE) {
if(This->data->vtbl && This->data->vtbl->value) {
return This->data->vtbl->value(This->outer, lcid, wFlags, pdp,
pvarRes, pei, pspCaller);
}
FIXME("DISPATCH_CONSTRUCT flag but missing value function\n");
return E_FAIL;
}
FIXME("DISPATCH_CONSTRUCT flag without DISPID_VALUE\n");
return E_FAIL;
}
if(is_dynamic_dispid(id)) {
@ -808,7 +831,10 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
var = &This->dynamic_data->props[idx].var;
switch(wFlags) {
case INVOKE_FUNC: {
case DISPATCH_METHOD|DISPATCH_PROPERTYGET:
if(!pvarRes)
return E_INVALIDARG;
case DISPATCH_METHOD: {
DISPID named_arg = DISPID_THIS;
DISPPARAMS dp = {NULL, &named_arg, 0, 1};
IDispatchEx *dispex;
@ -847,9 +873,17 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
heap_free(dp.rgvarg);
return hres;
}
case INVOKE_PROPERTYGET:
case DISPATCH_PROPERTYGET:
return VariantCopy(pvarRes, var);
case INVOKE_PROPERTYPUT:
case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF:
case DISPATCH_PROPERTYPUT:
if(pdp->cArgs != 1 || (pdp->cNamedArgs == 1 && *pdp->rgdispidNamedArgs != DISPID_PROPERTYPUT)
|| pdp->cNamedArgs > 1) {
FIXME("invalid args\n");
return E_INVALIDARG;
}
TRACE("put %s\n", debugstr_variant(pdp->rgvarg));
VariantClear(var);
return VariantCopy(var, pdp->rgvarg);
default:

View file

@ -93,8 +93,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define DOM_VK_HOME VK_HOME
#define DOM_VK_END VK_END
static const WCHAR wszFont[] = {'f','o','n','t',0};
static const WCHAR wszSize[] = {'s','i','z','e',0};
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)
{
@ -150,7 +150,7 @@ static DWORD query_ns_edit_status(HTMLDocument *This, const char *nscmd)
nsICommandParams *nsparam;
PRBool b = FALSE;
if(This->doc_obj->usermode != EDITMODE || This->doc_obj->readystate < READYSTATE_INTERACTIVE)
if(This->doc_obj->usermode != EDITMODE || This->window->readystate < READYSTATE_INTERACTIVE)
return OLECMDF_SUPPORTED;
if(This->doc_obj->nscontainer && nscmd) {
@ -185,7 +185,7 @@ static DWORD query_align_status(HTMLDocument *This, const char *align_str)
nsICommandParams *nsparam;
char *align = NULL;
if(This->doc_obj->usermode != EDITMODE || This->doc_obj->readystate < READYSTATE_INTERACTIVE)
if(This->doc_obj->usermode != EDITMODE || This->window->readystate < READYSTATE_INTERACTIVE)
return OLECMDF_SUPPORTED;
if(This->doc_obj->nscontainer) {
@ -292,13 +292,13 @@ static void get_font_size(HTMLDocument *This, WCHAR *ret)
nsIDOMElement_GetTagName(elem, &tag_str);
nsAString_GetData(&tag_str, &tag);
if(!strcmpiW(tag, wszFont)) {
if(!strcmpiW(tag, fontW)) {
nsAString size_str, val_str;
LPCWSTR val;
TRACE("found font tag %p\n", elem);
nsAString_Init(&size_str, wszSize);
nsAString_Init(&size_str, sizeW);
nsAString_Init(&val_str, NULL);
nsIDOMElement_GetAttribute(elem, &size_str, &val_str);
@ -334,14 +334,13 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
{
nsISelection *nsselection;
PRBool collapsed;
nsIDOMElement *elem;
nsIDOMHTMLElement *elem;
nsIDOMRange *range;
PRInt32 range_cnt = 0;
nsAString font_str;
nsAString size_str;
nsAString val_str;
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return;
}
@ -359,11 +358,11 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
}
}
nsAString_Init(&font_str, wszFont);
nsAString_Init(&size_str, wszSize);
create_nselem(This->doc_node, fontW, &elem);
nsAString_Init(&size_str, sizeW);
nsAString_Init(&val_str, size);
nsIDOMDocument_CreateElement(This->nsdoc, &font_str, &elem);
nsIDOMElement_SetAttribute(elem, &size_str, &val_str);
nsISelection_GetRangeAt(nsselection, 0, &range);
@ -376,7 +375,7 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
nsISelection_Collapse(nsselection, (nsIDOMNode*)elem, 0);
}else {
/* Remove all size attributes from the range */
remove_child_attr(elem, wszFont, &size_str);
remove_child_attr((nsIDOMElement*)elem, fontW, &size_str);
nsISelection_SelectAllChildren(nsselection, (nsIDOMNode*)elem);
}
@ -384,7 +383,6 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
nsIDOMRange_Release(range);
nsIDOMElement_Release(elem);
nsAString_Finish(&font_str);
nsAString_Finish(&size_str);
nsAString_Finish(&val_str);
@ -715,7 +713,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->doc_obj->readystate < READYSTATE_INTERACTIVE)
if(This->doc_obj->usermode != EDITMODE || This->window->readystate < READYSTATE_INTERACTIVE)
cmd->cmdf = OLECMDF_SUPPORTED;
else
cmd->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED;
@ -1127,17 +1125,17 @@ static INT_PTR CALLBACK hyperlink_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LP
static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
{
nsAString a_str, href_str, ns_url;
nsAString href_str, ns_url;
nsIHTMLEditor *html_editor;
nsIDOMElement *anchor_elem;
nsIDOMHTMLElement *anchor_elem;
PRBool insert_link_at_caret;
nsISelection *nsselection;
BSTR url = NULL;
INT ret;
HRESULT hres = E_FAIL;
static const WCHAR wszA[] = {'a',0};
static const WCHAR wszHref[] = {'h','r','e','f',0};
static const WCHAR aW[] = {'a',0};
static const WCHAR hrefW[] = {'h','r','e','f',0};
TRACE("%p, 0x%x, %p, %p\n", This, cmdexecopt, in, out);
@ -1157,7 +1155,7 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
return OLECMDERR_E_CANCELED;
}
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
@ -1166,16 +1164,13 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if (!nsselection)
return E_FAIL;
nsAString_Init(&a_str, wszA);
nsAString_Init(&href_str, wszHref);
nsAString_Init(&ns_url, url);
/* create an element for the link */
nsIDOMDocument_CreateElement(This->nsdoc, &a_str, &anchor_elem);
nsIDOMElement_SetAttribute(anchor_elem, &href_str, &ns_url);
create_nselem(This->doc_node, aW, &anchor_elem);
nsAString_Init(&href_str, hrefW);
nsAString_Init(&ns_url, url);
nsIDOMElement_SetAttribute(anchor_elem, &href_str, &ns_url);
nsAString_Finish(&href_str);
nsAString_Finish(&a_str);
nsISelection_GetIsCollapsed(nsselection, &insert_link_at_caret);
@ -1183,7 +1178,7 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if (insert_link_at_caret) {
nsIDOMNode *text_node, *unused_node;
nsIDOMDocument_CreateTextNode(This->nsdoc, &ns_url, (nsIDOMText **)&text_node);
nsIDOMDocument_CreateTextNode(This->doc_node->nsdoc, &ns_url, (nsIDOMText **)&text_node);
/* wrap the <a> tags around the text element */
nsIDOMElement_AppendChild(anchor_elem, text_node, &unused_node);
@ -1199,10 +1194,10 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if (insert_link_at_caret) {
/* add them to the document at the caret position */
nsres = nsIHTMLEditor_InsertElementAtSelection(html_editor, anchor_elem, FALSE);
nsres = nsIHTMLEditor_InsertElementAtSelection(html_editor, (nsIDOMElement*)anchor_elem, FALSE);
nsISelection_SelectAllChildren(nsselection, (nsIDOMNode*)anchor_elem);
}else /* add them around the selection using the magic provided to us by nsIHTMLEditor */
nsres = nsIHTMLEditor_InsertLinkAroundSelection(html_editor, anchor_elem);
nsres = nsIHTMLEditor_InsertLinkAroundSelection(html_editor, (nsIDOMElement*)anchor_elem);
nsIHTMLEditor_Release(html_editor);
hres = NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;

View file

@ -518,7 +518,7 @@ static dispex_static_data_t HTMLAnchorElement_dispex = {
HTMLAnchorElement_iface_tids
};
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLAnchorElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
nsresult nsres;
@ -526,7 +526,7 @@ HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl;
ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLAnchorElement_dispex);
HTMLElement_Init(&ret->element, doc, nselem, &HTMLAnchorElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLAnchorElement, (void**)&ret->nsanchor);
if(NS_FAILED(nsres))

View file

@ -606,12 +606,12 @@ static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, I
TRACE("(%p)->(%p)\n", This, range);
if(!This->textcont.element.node.doc->basedoc.nsdoc) {
if(!This->textcont.element.node.doc->nsdoc) {
WARN("No nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMDocument_QueryInterface(This->textcont.element.node.doc->basedoc.nsdoc, &IID_nsIDOMDocumentRange,
nsres = nsIDOMDocument_QueryInterface(This->textcont.element.node.doc->nsdoc, &IID_nsIDOMDocumentRange,
(void**)&nsdocrange);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMDocumentRabge iface: %08x\n", nsres);
@ -759,7 +759,7 @@ static dispex_static_data_t HTMLBodyElement_dispex = {
HTMLBodyElement_iface_tids
};
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLBodyElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLBodyElement *ret = heap_alloc_zero(sizeof(HTMLBodyElement));
nsresult nsres;
@ -769,7 +769,7 @@ HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl;
ret->textcont.element.node.vtbl = &HTMLBodyElementImplVtbl;
HTMLTextContainer_Init(&ret->textcont, &HTMLBodyElement_dispex);
HTMLTextContainer_Init(&ret->textcont, doc, nselem, &HTMLBodyElement_dispex);
ConnectionPoint_Init(&ret->cp_propnotif, &ret->textcont.element.cp_container, &IID_IPropertyNotifySink);

View file

@ -193,8 +193,10 @@ HTMLElement *HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode
ret->element.node.vtbl = &HTMLCommentElementImplVtbl;
ret->lpIHTMLCommentElementVtbl = &HTMLCommentElementVtbl;
HTMLElement_Init(&ret->element, &HTMLCommentElement_dispex);
HTMLDOMNode_Init(doc, &ret->element.node, nsnode);
HTMLElement_Init(&ret->element, doc, NULL, &HTMLCommentElement_dispex);
nsIDOMNode_AddRef(nsnode);
ret->element.node.nsnode = nsnode;
return &ret->element;
}

View file

@ -899,12 +899,12 @@ HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
HTMLCurrentStyle *ret;
nsresult nsres;
if(!elem->node.doc->basedoc.nsdoc) {
if(!elem->node.doc->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_QueryInterface(elem->node.doc->basedoc.nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
nsres = nsIDOMHTMLDocument_QueryInterface(elem->node.doc->nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
return E_FAIL;

View file

@ -113,12 +113,12 @@ static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCo
TRACE("(%p)->(%p)\n", This, p);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetDocumentElement(This->nsdoc, &nselem);
nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
if(NS_FAILED(nsres)) {
ERR("GetDocumentElement failed: %08x\n", nsres);
return E_FAIL;
@ -143,12 +143,12 @@ static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement
TRACE("(%p)->(%p)\n", This, p);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetBody(This->nsdoc, &nsbody);
nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
if(NS_FAILED(nsres)) {
TRACE("Could not get body: %08x\n", nsres);
return E_UNEXPECTED;
@ -187,12 +187,12 @@ static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElemen
*p = NULL;
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetImages(This->nsdoc, &nscoll);
nsres = nsIDOMHTMLDocument_GetImages(This->doc_node->nsdoc, &nscoll);
if(NS_FAILED(nsres)) {
ERR("GetImages failed: %08x\n", nsres);
return E_FAIL;
@ -219,12 +219,12 @@ static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLEleme
*p = NULL;
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetApplets(This->nsdoc, &nscoll);
nsres = nsIDOMHTMLDocument_GetApplets(This->doc_node->nsdoc, &nscoll);
if(NS_FAILED(nsres)) {
ERR("GetApplets failed: %08x\n", nsres);
return E_FAIL;
@ -251,12 +251,12 @@ static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElement
*p = NULL;
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetLinks(This->nsdoc, &nscoll);
nsres = nsIDOMHTMLDocument_GetLinks(This->doc_node->nsdoc, &nscoll);
if(NS_FAILED(nsres)) {
ERR("GetLinks failed: %08x\n", nsres);
return E_FAIL;
@ -283,12 +283,12 @@ static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElement
*p = NULL;
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetForms(This->nsdoc, &nscoll);
nsres = nsIDOMHTMLDocument_GetForms(This->doc_node->nsdoc, &nscoll);
if(NS_FAILED(nsres)) {
ERR("GetForms failed: %08x\n", nsres);
return E_FAIL;
@ -315,12 +315,12 @@ static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLEleme
*p = NULL;
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetAnchors(This->nsdoc, &nscoll);
nsres = nsIDOMHTMLDocument_GetAnchors(This->doc_node->nsdoc, &nscoll);
if(NS_FAILED(nsres)) {
ERR("GetAnchors failed: %08x\n", nsres);
return E_FAIL;
@ -342,13 +342,13 @@ static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&nsstr, v);
nsres = nsIDOMHTMLDocument_SetTitle(This->nsdoc, &nsstr);
nsres = nsIDOMHTMLDocument_SetTitle(This->doc_node->nsdoc, &nsstr);
nsAString_Finish(&nsstr);
if(NS_FAILED(nsres))
ERR("SetTitle failed: %08x\n", nsres);
@ -365,14 +365,14 @@ static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p)
TRACE("(%p)->(%p)\n", This, p);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&nsstr, NULL);
nsres = nsIDOMHTMLDocument_GetTitle(This->nsdoc, &nsstr);
nsres = nsIDOMHTMLDocument_GetTitle(This->doc_node->nsdoc, &nsstr);
if (NS_SUCCEEDED(nsres)) {
nsAString_GetData(&nsstr, &ret);
*p = SysAllocString(ret);
@ -455,7 +455,7 @@ static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p
if(!p)
return E_POINTER;
*p = SysAllocString(readystate_str[This->doc_obj->readystate]);
*p = SysAllocString(readystate_str[This->window->readystate]);
return S_OK;
}
@ -589,7 +589,7 @@ static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
TRACE("(%p)->(%p)\n", iface, p);
*p = SysAllocString(This->doc_obj->url ? This->doc_obj->url : about_blank_url);
*p = SysAllocString(This->window->url ? This->window->url : about_blank_url);
return *p ? S_OK : E_OUTOFMEMORY;
}
@ -727,7 +727,7 @@ static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln)
nsresult nsres;
HRESULT hres;
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
@ -750,9 +750,9 @@ static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln)
if(V_VT(var+i) == VT_BSTR) {
nsAString_SetData(&nsstr, V_BSTR(var+i));
if(!ln || i != argc-1)
nsres = nsIDOMHTMLDocument_Write(This->nsdoc, &nsstr);
nsres = nsIDOMHTMLDocument_Write(This->doc_node->nsdoc, &nsstr);
else
nsres = nsIDOMHTMLDocument_Writeln(This->nsdoc, &nsstr);
nsres = nsIDOMHTMLDocument_Writeln(This->doc_node->nsdoc, &nsstr);
if(NS_FAILED(nsres))
ERR("Write failed: %08x\n", nsres);
}else {
@ -795,7 +795,7 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_w(url), debugstr_variant(&name),
debugstr_variant(&features), debugstr_variant(&replace), pomWindowResult);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
ERR("!nsdoc\n");
return E_NOTIMPL;
}
@ -804,7 +804,7 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
|| V_VT(&features) != VT_ERROR || V_VT(&replace) != VT_ERROR)
FIXME("unsupported args\n");
nsres = nsIDOMHTMLDocument_Open(This->nsdoc);
nsres = nsIDOMHTMLDocument_Open(This->doc_node->nsdoc);
if(NS_FAILED(nsres)) {
ERR("Open failed: %08x\n", nsres);
return E_FAIL;
@ -822,12 +822,12 @@ static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface)
TRACE("(%p)\n", This);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
ERR("!nsdoc\n");
return E_NOTIMPL;
}
nsres = nsIDOMHTMLDocument_Close(This->nsdoc);
nsres = nsIDOMHTMLDocument_Close(This->doc_node->nsdoc);
if(NS_FAILED(nsres)) {
ERR("Close failed: %08x\n", nsres);
return E_FAIL;
@ -911,28 +911,18 @@ static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTa
IHTMLElement **newElem)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
nsIDOMElement *nselem;
nsIDOMHTMLElement *nselem;
HTMLElement *elem;
nsAString tag_str;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(eTag), newElem);
if(!This->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&tag_str, eTag);
nsres = nsIDOMDocument_CreateElement(This->nsdoc, &tag_str, &nselem);
nsAString_Finish(&tag_str);
if(NS_FAILED(nsres)) {
ERR("CreateElement failed: %08x\n", nsres);
return E_FAIL;
}
hres = create_nselem(This->doc_node, eTag, &nselem);
if(FAILED(hres))
return hres;
elem = HTMLElement_Create(This->doc_node, (nsIDOMNode*)nselem, TRUE);
nsIDOMElement_Release(nselem);
nsIDOMHTMLElement_Release(nselem);
*newElem = HTMLELEM(elem);
IHTMLElement_AddRef(HTMLELEM(elem));
@ -1232,12 +1222,12 @@ static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface,
*p = NULL;
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMDocumentStyle, (void**)&nsdocstyle);
nsIDOMHTMLDocument_QueryInterface(This->doc_node->nsdoc, &IID_nsIDOMDocumentStyle, (void**)&nsdocstyle);
nsres = nsIDOMDocumentStyle_GetStyleSheets(nsdocstyle, &nsstylelist);
nsIDOMDocumentStyle_Release(nsdocstyle);
if(NS_FAILED(nsres)) {
@ -1513,7 +1503,7 @@ static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMemb
return E_INVALIDARG;
V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) = This->doc_obj->readystate;
V_I4(pVarResult) = This->window->readystate;
return S_OK;
}
@ -1626,6 +1616,9 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
}else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) {
TRACE("(%p)->(IID_IHTMLDocument5, %p)\n", This, ppv);
*ppv = HTMLDOC5(This);
}else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) {
TRACE("(%p)->(IID_IHTMLDocument6, %p)\n", This, ppv);
*ppv = HTMLDOC6(This);
}else if(IsEqualGUID(&IID_IPersist, riid)) {
TRACE("(%p)->(IID_IPersist, %p)\n", This, ppv);
*ppv = PERSIST(This);
@ -1721,6 +1714,7 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex)
doc->unk_impl = unk_impl;
doc->dispex = dispex;
doc->task_magic = get_task_target_magic();
HTMLDocument_HTMLDocument3_Init(doc);
HTMLDocument_HTMLDocument5_Init(doc);
@ -1740,12 +1734,9 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex)
static void destroy_htmldoc(HTMLDocument *This)
{
remove_doc_tasks(This);
remove_target_tasks(This->task_magic);
ConnectionPointContainer_Destroy(&This->cp_container);
if(This->nsdoc)
nsIDOMHTMLDocument_Release(This->nsdoc);
}
#define HTMLDOCNODE_NODE_THIS(iface) DEFINE_THIS2(HTMLDocumentNode, node, iface)
@ -1772,12 +1763,21 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
{
HTMLDocumentNode *This = HTMLDOCNODE_NODE_THIS(iface);
if(This->nsevent_listener)
release_nsevents(This);
if(This->secmgr)
IInternetSecurityManager_Release(This->secmgr);
detach_selection(This);
detach_ranges(This);
release_nodes(This);
if(This->nsdoc) {
release_mutation(This);
nsIDOMHTMLDocument_Release(This->nsdoc);
}
heap_free(This->event_vector);
destroy_htmldoc(&This->basedoc);
}
@ -1822,11 +1822,14 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob
HTMLDocumentNode_SecMgr_Init(doc);
doc->ref = 1;
nsIDOMHTMLDocument_AddRef(nsdoc);
doc->basedoc.nsdoc = nsdoc;
doc->basedoc.window = window;
nsIDOMHTMLDocument_AddRef(nsdoc);
doc->nsdoc = nsdoc;
init_mutation(doc);
init_nsevents(doc);
list_init(&doc->bindings);
list_init(&doc->selection_list);
list_init(&doc->range_list);
@ -1889,8 +1892,6 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface)
TRACE("(%p) ref = %u\n", This, ref);
if(!ref) {
set_document_bscallback(&This->basedoc, NULL);
set_current_mon(&This->basedoc, NULL);
if(This->basedoc.doc_node) {
This->basedoc.doc_node->basedoc.doc_obj = NULL;
IHTMLDocument2_Release(HTMLDOC(&This->basedoc.doc_node->basedoc));
@ -1918,8 +1919,6 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface)
destroy_htmldoc(&This->basedoc);
release_dispex(&This->dispex);
if(This->basedoc.nsdoc)
remove_mutation_observer(This->nscontainer, This->basedoc.nsdoc);
if(This->nscontainer)
NSContainer_Release(This->nscontainer);
heap_free(This);
@ -1962,6 +1961,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
{
HTMLDocumentObj *doc;
nsIDOMWindow *nswindow = NULL;
nsresult nsres;
HRESULT hres;
TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject);
@ -1977,25 +1977,26 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
doc->ref = 1;
doc->basedoc.doc_obj = doc;
doc->usermode = UNKNOWN_USERMODE;
doc->nscontainer = NSContainer_Create(doc, NULL);
if(!doc->nscontainer) {
ERR("Failed to init Gecko, returning CLASS_E_CLASSNOTAVAILABLE\n");
htmldoc_release(&doc->basedoc);
return CLASS_E_CLASSNOTAVAILABLE;
}
hres = htmldoc_query_interface(&doc->basedoc, riid, ppvObject);
htmldoc_release(&doc->basedoc);
if(FAILED(hres))
return hres;
doc->nscontainer = NSContainer_Create(doc, NULL);
list_init(&doc->bindings);
doc->usermode = UNKNOWN_USERMODE;
doc->readystate = READYSTATE_UNINITIALIZED;
if(doc->nscontainer) {
nsresult nsres;
nsres = nsIWebBrowser_GetContentDOMWindow(doc->nscontainer->webbrowser, &nswindow);
if(NS_FAILED(nsres))
ERR("GetContentDOMWindow failed: %08x\n", nsres);
nsres = nsIWebBrowser_GetContentDOMWindow(doc->nscontainer->webbrowser, &nswindow);
if(NS_FAILED(nsres))
ERR("GetContentDOMWindow failed: %08x\n", nsres);
}
hres = HTMLWindow_Create(doc, nswindow, &doc->basedoc.window);
hres = HTMLWindow_Create(doc, nswindow, NULL /* FIXME */, &doc->basedoc.window);
if(nswindow)
nsIDOMWindow_Release(nswindow);
if(FAILED(hres)) {
@ -2003,7 +2004,11 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
return hres;
}
update_nsdocument(doc);
if(!doc->basedoc.doc_node && doc->basedoc.window->doc) {
doc->basedoc.doc_node = doc->basedoc.window->doc;
htmldoc_addref(&doc->basedoc.doc_node->basedoc);
}
get_thread_hwnd();
return S_OK;

View file

@ -111,13 +111,13 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&text_str, text);
nsres = nsIDOMHTMLDocument_CreateTextNode(This->nsdoc, &text_str, &nstext);
nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext);
nsAString_Finish(&text_str);
if(NS_FAILED(nsres)) {
ERR("CreateTextNode failed: %08x\n", nsres);
@ -141,12 +141,17 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
TRACE("(%p)->(%p)\n", This, p);
if(!This->nsdoc) {
if(This->window->readystate == READYSTATE_UNINITIALIZED) {
*p = NULL;
return S_OK;
}
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetDocumentElement(This->nsdoc, &nselem);
nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
if(NS_FAILED(nsres)) {
ERR("GetDocumentElement failed: %08x\n", nsres);
return E_FAIL;
@ -431,13 +436,13 @@ static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&id_str, v);
nsres = nsIDOMHTMLDocument_GetElementById(This->nsdoc, &id_str, &nselem);
nsres = nsIDOMHTMLDocument_GetElementById(This->doc_node->nsdoc, &id_str, &nselem);
nsAString_Finish(&id_str);
if(FAILED(nsres)) {
ERR("GetElementById failed: %08x\n", nsres);
@ -468,14 +473,14 @@ static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface,
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&id_str, v);
nsAString_Init(&ns_str, str);
nsres = nsIDOMHTMLDocument_GetElementsByTagNameNS(This->nsdoc, &ns_str, &id_str, &nslist);
nsres = nsIDOMHTMLDocument_GetElementsByTagNameNS(This->doc_node->nsdoc, &ns_str, &id_str, &nslist);
nsAString_Finish(&id_str);
nsAString_Finish(&ns_str);
if(FAILED(nsres)) {
@ -602,7 +607,7 @@ static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
TRACE("(%p)->()\n", This);
nsres = nsIDOMHTMLDocument_GetBody(This->nsdoc, &nsbody);
nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
if(NS_FAILED(nsres) || !nsbody) {
ERR("GetBody failed: %08x\n", nsres);
return E_FAIL;

View file

@ -131,13 +131,13 @@ static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bs
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&str, bstrdata);
nsres = nsIDOMHTMLDocument_CreateComment(This->nsdoc, &str, &nscomment);
nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment);
nsAString_Finish(&str);
if(NS_FAILED(nsres)) {
ERR("CreateTextNode failed: %08x\n", nsres);
@ -246,12 +246,12 @@ static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *
TRACE("(%p)->(%p)\n", This, p);
if(!This->nsdoc) {
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
nsres = nsIDOMHTMLDocument_QueryInterface(This->doc_node->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMNSHTMLDocument: %08x\n", nsres);
return S_OK;
@ -299,7 +299,141 @@ static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
HTMLDocument5_get_compatMode
};
#define HTMLDOC6_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument6, iface)
static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface,
REFIID riid, void **ppv)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
}
static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
return IHTMLDocument2_AddRef(HTMLDOC(This));
}
static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
return IHTMLDocument2_Release(HTMLDOC(This));
}
static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
}
static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface,
IHTMLDocumentCompatibleInfoCollection **p)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface,
VARIANT *p)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
VARIANT *p)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface,
VARIANT p)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
FIXME("(%p)->(v)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface,
VARIANT *p)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface,
VARIANT p)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
FIXME("(%p)->(v)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
BSTR bstrId, IHTMLElement2 **p)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface)
{
HTMLDocument *This = HTMLDOC6_THIS(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
#undef HTMLDOC6_THIS
static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = {
HTMLDocument6_QueryInterface,
HTMLDocument6_AddRef,
HTMLDocument6_Release,
HTMLDocument6_GetTypeInfoCount,
HTMLDocument6_GetTypeInfo,
HTMLDocument6_GetIDsOfNames,
HTMLDocument6_Invoke,
HTMLDocument6_get_compatible,
HTMLDocument6_get_documentMode,
HTMLDocument6_put_onstorage,
HTMLDocument6_get_onstorage,
HTMLDocument6_put_onstoragecommit,
HTMLDocument6_get_onstoragecommit,
HTMLDocument6_getElementById,
HTMLDocument6_updateSettings
};
void HTMLDocument_HTMLDocument5_Init(HTMLDocument *This)
{
This->lpHTMLDocument5Vtbl = &HTMLDocument5Vtbl;
This->lpHTMLDocument6Vtbl = &HTMLDocument6Vtbl;
}

View file

@ -38,6 +38,35 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define HTMLELEM_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement, iface)
HRESULT create_nselem(HTMLDocumentNode *doc, const WCHAR *tag, nsIDOMHTMLElement **ret)
{
nsIDOMElement *nselem;
nsAString tag_str;
nsresult nsres;
if(!doc->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&tag_str, tag);
nsres = nsIDOMDocument_CreateElement(doc->nsdoc, &tag_str, &nselem);
nsAString_Finish(&tag_str);
if(NS_FAILED(nsres)) {
ERR("CreateElement failed: %08x\n", nsres);
return E_FAIL;
}
nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLElement, (void**)ret);
nsIDOMElement_Release(nselem);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMHTMLElement iface: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
#define HTMLELEM_NODE_THIS(iface) DEFINE_THIS2(HTMLElement, node, iface)
static HRESULT WINAPI HTMLElement_QueryInterface(IHTMLElement *iface,
@ -850,7 +879,7 @@ static HRESULT WINAPI HTMLElement_put_innerText(IHTMLElement *iface, BSTR v)
}
nsAString_Init(&text_str, v);
nsres = nsIDOMHTMLDocument_CreateTextNode(This->node.doc->basedoc.nsdoc, &text_str, &text_node);
nsres = nsIDOMHTMLDocument_CreateTextNode(This->node.doc->nsdoc, &text_str, &text_node);
nsAString_Finish(&text_str);
if(NS_FAILED(nsres)) {
ERR("CreateTextNode failed: %08x\n", nsres);
@ -1006,12 +1035,12 @@ static HRESULT WINAPI HTMLElement_insertAdjacentHTML(IHTMLElement *iface, BSTR w
TRACE("(%p)->(%s %s)\n", This, debugstr_w(where), debugstr_w(html));
if(!This->node.doc->basedoc.nsdoc) {
if(!This->node.doc->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMDocument_QueryInterface(This->node.doc->basedoc.nsdoc, &IID_nsIDOMDocumentRange, (void **)&nsdocrange);
nsres = nsIDOMDocument_QueryInterface(This->node.doc->nsdoc, &IID_nsIDOMDocumentRange, (void **)&nsdocrange);
if(NS_FAILED(nsres))
{
ERR("getting nsIDOMDocumentRange failed: %08x\n", nsres);
@ -1064,14 +1093,14 @@ static HRESULT WINAPI HTMLElement_insertAdjacentText(IHTMLElement *iface, BSTR w
TRACE("(%p)->(%s %s)\n", This, debugstr_w(where), debugstr_w(text));
if(!This->node.doc->basedoc.nsdoc) {
if(!This->node.doc->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&ns_text, text);
nsres = nsIDOMDocument_CreateTextNode(This->node.doc->basedoc.nsdoc, &ns_text, (nsIDOMText **)&nsnode);
nsres = nsIDOMDocument_CreateTextNode(This->node.doc->nsdoc, &ns_text, (nsIDOMText **)&nsnode);
nsAString_Finish(&ns_text);
if(NS_FAILED(nsres) || !nsnode)
@ -1103,8 +1132,10 @@ static HRESULT WINAPI HTMLElement_get_isTextEdit(IHTMLElement *iface, VARIANT_BO
static HRESULT WINAPI HTMLElement_click(IHTMLElement *iface)
{
HTMLElement *This = HTMLELEM_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
TRACE("(%p)\n", This);
return call_event(&This->node, EVENTID_CLICK);
}
static HRESULT WINAPI HTMLElement_get_filters(IHTMLElement *iface,
@ -1458,16 +1489,22 @@ static dispex_static_data_t HTMLElement_dispex = {
HTMLElement_iface_tids
};
void HTMLElement_Init(HTMLElement *This, dispex_static_data_t *dispex_data)
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
{
This->lpHTMLElementVtbl = &HTMLElementVtbl;
ConnectionPointContainer_Init(&This->cp_container, (IUnknown*)HTMLELEM(This));
HTMLElement2_Init(This);
HTMLElement3_Init(This);
init_dispex(&This->node.dispex, (IUnknown*)HTMLELEM(This), dispex_data ? dispex_data : &HTMLElement_dispex);
if(nselem)
nsIDOMHTMLElement_AddRef(nselem);
This->nselem = nselem;
HTMLDOMNode_Init(doc, &This->node, (nsIDOMNode*)nselem);
ConnectionPointContainer_Init(&This->cp_container, (IUnknown*)HTMLELEM(This));
}
HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_generic)
@ -1500,42 +1537,40 @@ HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL
nsAString_GetData(&class_name_str, &class_name);
if(!strcmpW(class_name, wszA))
ret = HTMLAnchorElement_Create(nselem);
ret = HTMLAnchorElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszBODY))
ret = HTMLBodyElement_Create(nselem);
ret = HTMLBodyElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszIFRAME))
ret = HTMLIFrame_Create(nselem);
ret = HTMLIFrame_Create(doc, nselem, NULL);
else if(!strcmpW(class_name, wszIMG))
ret = HTMLImgElement_Create(nselem);
ret = HTMLImgElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszINPUT))
ret = HTMLInputElement_Create(nselem);
ret = HTMLInputElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszOPTION))
ret = HTMLOptionElement_Create(nselem);
ret = HTMLOptionElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszSCRIPT))
ret = HTMLScriptElement_Create(nselem);
ret = HTMLScriptElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszSELECT))
ret = HTMLSelectElement_Create(nselem);
ret = HTMLSelectElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszTABLE))
ret = HTMLTable_Create(nselem);
ret = HTMLTable_Create(doc, nselem);
else if(!strcmpW(class_name, wszTR))
ret = HTMLTableRow_Create(nselem);
ret = HTMLTableRow_Create(doc, nselem);
else if(!strcmpW(class_name, wszTEXTAREA))
ret = HTMLTextAreaElement_Create(nselem);
ret = HTMLTextAreaElement_Create(doc, nselem);
else if(use_generic)
ret = HTMLGenericElement_Create(nselem);
ret = HTMLGenericElement_Create(doc, nselem);
if(!ret) {
ret = heap_alloc_zero(sizeof(HTMLElement));
HTMLElement_Init(ret, NULL);
HTMLElement_Init(ret, doc, nselem, NULL);
ret->node.vtbl = &HTMLElementImplVtbl;
}
TRACE("%s ret %p\n", debugstr_w(class_name), ret);
nsIDOMElement_Release(nselem);
nsAString_Finish(&class_name_str);
ret->nselem = nselem;
HTMLDOMNode_Init(doc, &ret->node, (nsIDOMNode*)nselem);
return ret;
}

View file

@ -130,8 +130,15 @@ static HRESULT WINAPI HTMLElement2_componentFromPoint(IHTMLElement2 *iface,
static HRESULT WINAPI HTMLElement2_doScroll(IHTMLElement2 *iface, VARIANT component)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&component));
if(!This->node.doc->content_ready
|| !This->node.doc->basedoc.doc_obj->in_place_active)
return E_PENDING;
WARN("stub\n");
return S_OK;
}
static HRESULT WINAPI HTMLElement2_put_onscroll(IHTMLElement2 *iface, VARIANT v)

View file

@ -29,6 +29,7 @@
#include "wine/unicode.h"
#include "mshtml_private.h"
#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@ -292,8 +293,11 @@ static HRESULT WINAPI HTMLElement3_fireEvent(IHTMLElement3 *iface, BSTR bstrEven
VARIANT *pvarEventObject, VARIANT_BOOL *pfCancelled)
{
HTMLElement *This = HTMLELEM3_THIS(iface);
FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCancelled);
return E_NOTIMPL;
TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(bstrEventName), debugstr_variant(pvarEventObject),
pfCancelled);
return dispatch_event(&This->node, bstrEventName, pvarEventObject, pfCancelled);
}
static HRESULT WINAPI HTMLElement3_put_onresizestart(IHTMLElement3 *iface, VARIANT v)

View file

@ -397,7 +397,7 @@ static HRESULT HTMLElementCollection_invoke(IUnknown *iface, DISPID id, LCID lci
return DISP_E_UNKNOWNNAME;
switch(flags) {
case INVOKE_PROPERTYGET:
case DISPATCH_PROPERTYGET:
V_VT(res) = VT_DISPATCH;
V_DISPATCH(res) = (IDispatch*)HTMLELEM(This->elems[idx]);
IHTMLElement_AddRef(HTMLELEM(This->elems[idx]));

View file

@ -96,9 +96,28 @@ static const WCHAR onreadystatechangeW[] = {'o','n','r','e','a','d','y','s','t',
static const WCHAR selectstartW[] = {'s','e','l','e','c','t','s','t','a','r','t',0};
static const WCHAR onselectstartW[] = {'o','n','s','e','l','e','c','t','s','t','a','r','t',0};
static const WCHAR HTMLEventsW[] = {'H','T','M','L','E','v','e','n','t','s',0};
static const WCHAR KeyboardEventW[] = {'K','e','y','b','o','a','r','d','E','v','e','n','t',0};
static const WCHAR MouseEventW[] = {'M','o','u','s','e','E','v','e','n','t',0};
enum {
EVENTT_NONE,
EVENTT_HTML,
EVENTT_KEY,
EVENTT_MOUSE
};
static const WCHAR *event_types[] = {
NULL,
HTMLEventsW,
KeyboardEventW,
MouseEventW
};
typedef struct {
LPCWSTR name;
LPCWSTR attr_name;
DWORD type;
DWORD flags;
} event_info_t;
@ -107,24 +126,24 @@ typedef struct {
#define EVENT_FORWARDBODY 0x0004
static const event_info_t event_info[] = {
{beforeunloadW, onbeforeunloadW, EVENT_DEFAULTLISTENER|EVENT_FORWARDBODY},
{blurW, onblurW, EVENT_DEFAULTLISTENER},
{changeW, onchangeW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{clickW, onclickW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{dblclickW, ondblclickW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{dragW, ondragW, 0},
{dragstartW, ondragstartW, 0},
{focusW, onfocusW, EVENT_DEFAULTLISTENER},
{keydownW, onkeydownW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{keyupW, onkeyupW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{loadW, onloadW, 0},
{mousedownW, onmousedownW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mouseoutW, onmouseoutW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mouseoverW, onmouseoverW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mouseupW, onmouseupW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{pasteW, onpasteW, 0},
{readystatechangeW, onreadystatechangeW, 0},
{selectstartW, onselectstartW, 0}
{beforeunloadW, onbeforeunloadW, EVENTT_NONE, EVENT_DEFAULTLISTENER|EVENT_FORWARDBODY},
{blurW, onblurW, EVENTT_HTML, EVENT_DEFAULTLISTENER},
{changeW, onchangeW, EVENTT_HTML, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{clickW, onclickW, EVENTT_MOUSE, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{dblclickW, ondblclickW, EVENTT_MOUSE, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{dragW, ondragW, EVENTT_MOUSE, 0},
{dragstartW, ondragstartW, EVENTT_MOUSE, 0},
{focusW, onfocusW, EVENTT_HTML, EVENT_DEFAULTLISTENER},
{keydownW, onkeydownW, EVENTT_KEY, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{keyupW, onkeyupW, EVENTT_KEY, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{loadW, onloadW, EVENTT_HTML, 0},
{mousedownW, onmousedownW, EVENTT_MOUSE, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mouseoutW, onmouseoutW, EVENTT_MOUSE, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mouseoverW, onmouseoverW, EVENTT_MOUSE, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mouseupW, onmouseupW, EVENTT_MOUSE, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{pasteW, onpasteW, EVENTT_NONE, 0},
{readystatechangeW, onreadystatechangeW, EVENTT_NONE, 0},
{selectstartW, onselectstartW, EVENTT_MOUSE, 0}
};
eventid_t str_to_eid(LPCWSTR str)
@ -680,15 +699,39 @@ static IHTMLEventObj *create_event(HTMLDOMNode *target, eventid_t eid, nsIDOMEve
HTMLEventObj *ret;
ret = heap_alloc(sizeof(*ret));
if(!ret)
return NULL;
ret->lpIHTMLEventObjVtbl = &HTMLEventObjVtbl;
ret->ref = 1;
ret->type = event_info+eid;
ret->target = target;
IHTMLDOMNode_AddRef(HTMLDOMNODE(target));
ret->nsevent = nsevent;
if(nsevent)
if(nsevent) {
nsIDOMEvent_AddRef(nsevent);
}else if(event_types[event_info[eid].type]) {
nsIDOMDocumentEvent *doc_event;
nsresult nsres;
nsres = nsIDOMHTMLDocument_QueryInterface(target->doc->nsdoc, &IID_nsIDOMDocumentEvent,
(void**)&doc_event);
if(NS_SUCCEEDED(nsres)) {
nsAString type_str;
nsAString_Init(&type_str, event_types[event_info[eid].type]);
nsres = nsIDOMDocumentEvent_CreateEvent(doc_event, &type_str, &ret->nsevent);
nsAString_Finish(&type_str);
nsIDOMDocumentEvent_Release(doc_event);
}
if(NS_FAILED(nsres)) {
ERR("Could not create event: %08x\n", nsres);
IHTMLEventObj_Release(HTMLEVENTOBJ(ret));
return NULL;
}
}
ret->target = target;
IHTMLDOMNode_AddRef(HTMLDOMNODE(target));
init_dispex(&ret->dispex, (IUnknown*)HTMLEVENTOBJ(ret), &HTMLEventObj_dispex);
@ -784,7 +827,7 @@ void fire_event(HTMLDocumentNode *doc, eventid_t eid, nsIDOMNode *target, nsIDOM
nsIDOMHTMLElement *nsbody;
nsresult nsres;
nsres = nsIDOMHTMLDocument_GetBody(doc->basedoc.nsdoc, &nsbody);
nsres = nsIDOMHTMLDocument_GetBody(doc->nsdoc, &nsbody);
if(NS_SUCCEEDED(nsres) && nsbody) {
node = get_node(doc, (nsIDOMNode*)nsbody, FALSE);
if(node)
@ -810,6 +853,46 @@ void fire_event(HTMLDocumentNode *doc, eventid_t eid, nsIDOMNode *target, nsIDOM
doc->basedoc.window->event = prev_event;
}
HRESULT dispatch_event(HTMLDOMNode *node, const WCHAR *event_name, VARIANT *event_obj, VARIANT_BOOL *cancelled)
{
eventid_t eid;
eid = attr_to_eid(event_name);
if(eid == EVENTID_LAST) {
WARN("unknown event %s\n", debugstr_w(event_name));
return E_INVALIDARG;
}
if(event_obj && V_VT(event_obj) != VT_EMPTY && V_VT(event_obj) != VT_ERROR)
FIXME("event_obj not implemented\n");
if(!(event_info[eid].flags & EVENT_DEFAULTLISTENER)) {
FIXME("not EVENT_DEFAULTEVENTHANDLER\n");
return E_NOTIMPL;
}
fire_event(node->doc, eid, node->nsnode, NULL);
*cancelled = VARIANT_TRUE; /* FIXME */
return S_OK;
}
HRESULT call_event(HTMLDOMNode *node, eventid_t eid)
{
HRESULT hres;
if(node->vtbl->call_event) {
BOOL handled = FALSE;
hres = node->vtbl->call_event(node, eid, &handled);
if(handled)
return hres;
}
fire_event(node->doc, eid, node->nsnode, NULL);
return S_OK;
}
static inline event_target_t *get_event_target(event_target_t **event_target_ptr)
{
if(!*event_target_ptr)
@ -838,7 +921,8 @@ static BOOL alloc_handler_vector(event_target_t *event_target, eventid_t eid, in
return TRUE;
}
static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLWindow *window, eventid_t eid, IDispatch *disp)
static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLDocumentNode *doc,
eventid_t eid, IDispatch *disp)
{
event_target_t *event_target;
@ -857,23 +941,23 @@ static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLWin
return S_OK;
IDispatch_AddRef(disp);
if(window->nswindow && (event_info[eid].flags & EVENT_DEFAULTLISTENER)) {
if(!window->event_vector) {
window->event_vector = heap_alloc_zero(EVENTID_LAST*sizeof(BOOL));
if(!window->event_vector)
if(doc->nsdoc && (event_info[eid].flags & EVENT_DEFAULTLISTENER)) {
if(!doc->event_vector) {
doc->event_vector = heap_alloc_zero(EVENTID_LAST*sizeof(BOOL));
if(!doc->event_vector)
return E_OUTOFMEMORY;
}
if(!window->event_vector[eid]) {
window->event_vector[eid] = TRUE;
add_nsevent_listener(window, event_info[eid].name);
if(!doc->event_vector[eid]) {
doc->event_vector[eid] = TRUE;
add_nsevent_listener(doc, event_info[eid].name);
}
}
return S_OK;
}
HRESULT set_event_handler(event_target_t **event_target, HTMLDocument *doc, eventid_t eid, VARIANT *var)
HRESULT set_event_handler(event_target_t **event_target, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var)
{
switch(V_VT(var)) {
case VT_NULL:
@ -884,7 +968,7 @@ HRESULT set_event_handler(event_target_t **event_target, HTMLDocument *doc, even
break;
case VT_DISPATCH:
return set_event_handler_disp(event_target, doc->window, eid, V_DISPATCH(var));
return set_event_handler_disp(event_target, doc, eid, V_DISPATCH(var));
default:
FIXME("not supported vt=%d\n", V_VT(var));
@ -965,7 +1049,7 @@ void check_event_attr(HTMLDocumentNode *doc, nsIDOMElement *nselem)
disp = script_parse_event(doc->basedoc.window, attr_value);
if(disp) {
node = get_node(doc, (nsIDOMNode*)nselem, TRUE);
set_event_handler_disp(get_node_event_target(node), node->doc->basedoc.window, i, disp);
set_event_handler_disp(get_node_event_target(node), node->doc, i, disp);
IDispatch_Release(disp);
}
}

View file

@ -42,9 +42,11 @@ eventid_t str_to_eid(LPCWSTR);
void check_event_attr(HTMLDocumentNode*,nsIDOMElement*);
void release_event_target(event_target_t*);
void fire_event(HTMLDocumentNode*,eventid_t,nsIDOMNode*,nsIDOMEvent*);
HRESULT set_event_handler(event_target_t**,HTMLDocument*,eventid_t,VARIANT*);
HRESULT set_event_handler(event_target_t**,HTMLDocumentNode*,eventid_t,VARIANT*);
HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*);
HRESULT attach_event(event_target_t**,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*);
HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*);
HRESULT call_event(HTMLDOMNode*,eventid_t);
static inline event_target_t **get_node_event_target(HTMLDOMNode *node)
{
@ -53,7 +55,7 @@ static inline event_target_t **get_node_event_target(HTMLDOMNode *node)
static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
{
return set_event_handler(get_node_event_target(node), &node->doc->basedoc, eid, var);
return set_event_handler(get_node_event_target(node), node->doc, eid, var);
}
static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
@ -73,7 +75,7 @@ static inline HRESULT get_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *v
static inline HRESULT set_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var)
{
return set_event_handler(&window->event_target, &window->doc_obj->basedoc, eid, var);
return set_event_handler(&window->event_target, window->doc, eid, var);
}
static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var)

View file

@ -0,0 +1,326 @@
/*
* Copyright 2008 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "mshtml_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define HTMLFRAMEBASE_THIS(iface) DEFINE_THIS(HTMLFrameBase, IHTMLFrameBase, iface)
static HRESULT WINAPI HTMLFrameBase_QueryInterface(IHTMLFrameBase *iface, REFIID riid, void **ppv)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
}
static ULONG WINAPI HTMLFrameBase_AddRef(IHTMLFrameBase *iface)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
}
static ULONG WINAPI HTMLFrameBase_Release(IHTMLFrameBase *iface)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
}
static HRESULT WINAPI HTMLFrameBase_GetTypeInfoCount(IHTMLFrameBase *iface, UINT *pctinfo)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
}
static HRESULT WINAPI HTMLFrameBase_GetTypeInfo(IHTMLFrameBase *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLFrameBase_GetIDsOfNames(IHTMLFrameBase *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames,
cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLFrameBase_Invoke(IHTMLFrameBase *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_name(IHTMLFrameBase *iface, BSTR v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_name(IHTMLFrameBase *iface, BSTR *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_border(IHTMLFrameBase *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_border(IHTMLFrameBase *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_frameBorder(IHTMLFrameBase *iface, BSTR v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_frameBorder(IHTMLFrameBase *iface, BSTR *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_frameSpacing(IHTMLFrameBase *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_frameSpacing(IHTMLFrameBase *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_marginWidth(IHTMLFrameBase *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_marginWidth(IHTMLFrameBase *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_marginHeight(IHTMLFrameBase *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_marginHeight(IHTMLFrameBase *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_noResize(IHTMLFrameBase *iface, VARIANT_BOOL v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_noResize(IHTMLFrameBase *iface, VARIANT_BOOL *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_scrolling(IHTMLFrameBase *iface, BSTR v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_scrolling(IHTMLFrameBase *iface, BSTR *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static const IHTMLFrameBaseVtbl HTMLFrameBaseVtbl = {
HTMLFrameBase_QueryInterface,
HTMLFrameBase_AddRef,
HTMLFrameBase_Release,
HTMLFrameBase_GetTypeInfoCount,
HTMLFrameBase_GetTypeInfo,
HTMLFrameBase_GetIDsOfNames,
HTMLFrameBase_Invoke,
HTMLFrameBase_put_src,
HTMLFrameBase_get_src,
HTMLFrameBase_put_name,
HTMLFrameBase_get_name,
HTMLFrameBase_put_border,
HTMLFrameBase_get_border,
HTMLFrameBase_put_frameBorder,
HTMLFrameBase_get_frameBorder,
HTMLFrameBase_put_frameSpacing,
HTMLFrameBase_get_frameSpacing,
HTMLFrameBase_put_marginWidth,
HTMLFrameBase_get_marginWidth,
HTMLFrameBase_put_marginHeight,
HTMLFrameBase_get_marginHeight,
HTMLFrameBase_put_noResize,
HTMLFrameBase_get_noResize,
HTMLFrameBase_put_scrolling,
HTMLFrameBase_get_scrolling
};
HRESULT HTMLFrameBase_QI(HTMLFrameBase *This, REFIID riid, void **ppv)
{
if(IsEqualGUID(&IID_IHTMLFrameBase, riid)) {
TRACE("(%p)->(IID_IHTMLFrameBase %p)\n", This, ppv);
*ppv = HTMLFRAMEBASE(This);
}else {
return HTMLElement_QI(&This->element.node, riid, ppv);
}
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
void HTMLFrameBase_destructor(HTMLFrameBase *This)
{
if(This->content_window) {
This->content_window->frame_element = NULL;
IHTMLWindow2_Release(HTMLWINDOW2(This->content_window));
}
HTMLElement_destructor(&This->element.node);
}
void HTMLFrameBase_Init(HTMLFrameBase *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
HTMLWindow *content_window, dispex_static_data_t *dispex_data)
{
This->lpIHTMLFrameBaseVtbl = &HTMLFrameBaseVtbl;
HTMLElement_Init(&This->element, doc, nselem, dispex_data);
if(content_window) {
IHTMLWindow2_AddRef(HTMLWINDOW2(content_window));
content_window->frame_element = This;
}
This->content_window = content_window;
}
typedef struct {
HTMLFrameBase framebase;
} HTMLFrameElement;
#define HTMLFRAME_NODE_THIS(iface) DEFINE_THIS2(HTMLFrameElement, framebase.element.node, iface)
static HRESULT HTMLFrameElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface);
return HTMLFrameBase_QI(&This->framebase, riid, ppv);
}
static void HTMLFrameElement_destructor(HTMLDOMNode *iface)
{
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface);
HTMLFrameBase_destructor(&This->framebase);
}
#undef HTMLFRAME_NODE_THIS
static const NodeImplVtbl HTMLFrameElementImplVtbl = {
HTMLFrameElement_QI,
HTMLFrameElement_destructor
};
HTMLElement *HTMLFrameElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLWindow *content_window)
{
nsIDOMHTMLFrameElement *nsframe;
HTMLFrameElement *ret;
nsresult nsres;
ret = heap_alloc_zero(sizeof(HTMLFrameElement));
ret->framebase.element.node.vtbl = &HTMLFrameElementImplVtbl;
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLFrameElement, (void**)&nsframe);
if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLFrameElement iface: %08x\n", nsres);
HTMLFrameBase_Init(&ret->framebase, doc, nselem, content_window, NULL);
return &ret->framebase.element;
}

View file

@ -169,7 +169,7 @@ static dispex_static_data_t HTMLGenericElement_dispex = {
HTMLGenericElement_iface_tids
};
HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLGenericElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLGenericElement *ret;
@ -178,7 +178,7 @@ HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLGenericElementVtbl = &HTMLGenericElementVtbl;
ret->element.node.vtbl = &HTMLGenericElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLGenericElement_dispex);
HTMLElement_Init(&ret->element, doc, nselem, &HTMLGenericElement_dispex);
return &ret->element;
}

View file

@ -32,72 +32,37 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
typedef struct {
HTMLElement element;
HTMLFrameBase framebase;
const IHTMLFrameBase2Vtbl *lpIHTMLFrameBase2Vtbl;
LONG ref;
nsIDOMHTMLIFrameElement *nsiframe;
HTMLWindow *content_window;
} HTMLIFrame;
#define HTMLFRAMEBASE2(x) (&(x)->lpIHTMLFrameBase2Vtbl)
static HRESULT create_content_window(HTMLIFrame *This, nsIDOMHTMLDocument *nsdoc, HTMLWindow **ret)
{
nsIDOMDocumentView *nsdocview;
nsIDOMAbstractView *nsview;
nsIDOMWindow *nswindow;
nsresult nsres;
HRESULT hres;
nsres = nsIDOMHTMLDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
return E_FAIL;
}
nsres = nsIDOMDocumentView_GetDefaultView(nsdocview, &nsview);
nsIDOMDocumentView_Release(nsdocview);
if(NS_FAILED(nsres)) {
ERR("GetDefaultView failed: %08x\n", nsres);
return E_FAIL;
}
nsres = nsIDOMAbstractView_QueryInterface(nsview, &IID_nsIDOMWindow, (void**)&nswindow);
nsIDOMAbstractView_Release(nsview);
if(NS_FAILED(nsres)) {
ERR("Coult not get nsIDOMWindow iface: %08x\n", nsres);
return E_FAIL;
}
hres = HTMLWindow_Create(This->element.node.doc->basedoc.doc_obj, nswindow, ret);
nsIDOMWindow_Release(nswindow);
return hres;
}
#define HTMLFRAMEBASE2_THIS(iface) DEFINE_THIS(HTMLIFrame, IHTMLFrameBase2, iface)
static HRESULT WINAPI HTMLIFrameBase2_QueryInterface(IHTMLFrameBase2 *iface, REFIID riid, void **ppv)
{
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->framebase.element.node), riid, ppv);
}
static ULONG WINAPI HTMLIFrameBase2_AddRef(IHTMLFrameBase2 *iface)
{
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->framebase.element.node));
}
static ULONG WINAPI HTMLIFrameBase2_Release(IHTMLFrameBase2 *iface)
{
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
return IHTMLDOMNode_Release(HTMLDOMNODE(&This->framebase.element.node));
}
static HRESULT WINAPI HTMLIFrameBase2_GetTypeInfoCount(IHTMLFrameBase2 *iface, UINT *pctinfo)
@ -138,53 +103,13 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
TRACE("(%p)->(%p)\n", This, p);
if(!This->content_window) {
nsIDOMHTMLDocument *nshtmldoc;
HTMLDocumentNode *content_doc;
nsIDOMDocument *nsdoc;
HTMLWindow *window;
nsresult nsres;
HRESULT hres;
nsres = nsIDOMHTMLIFrameElement_GetContentDocument(This->nsiframe, &nsdoc);
if(NS_FAILED(nsres)) {
ERR("GetContentDocument failed: %08x\n", nsres);
return E_FAIL;
}
if(!nsdoc) {
FIXME("NULL contentDocument\n");
return E_FAIL;
}
nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
nsIDOMDocument_Release(nsdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMHTMLDocument iface: %08x\n", nsres);
return E_FAIL;
}
hres = create_content_window(This, nshtmldoc, &window);
if(FAILED(hres)) {
nsIDOMHTMLDocument_Release(nshtmldoc);
return E_FAIL;
}
hres = create_doc_from_nsdoc(nshtmldoc, This->element.node.doc->basedoc.doc_obj, window, &content_doc);
nsIDOMHTMLDocument_Release(nshtmldoc);
if(SUCCEEDED(hres))
window_set_docnode(window, content_doc);
else
IHTMLWindow2_Release(HTMLWINDOW2(window));
htmldoc_release(&content_doc->basedoc);
if(FAILED(hres))
return hres;
This->content_window = window;
if(This->framebase.content_window) {
IHTMLWindow2_AddRef(HTMLWINDOW2(This->framebase.content_window));
*p = HTMLWINDOW2(This->framebase.content_window);
}else {
WARN("NULL content window\n");
*p = NULL;
}
IHTMLWindow2_AddRef(HTMLWINDOW2(This->content_window));
*p = HTMLWINDOW2(This->content_window);
return S_OK;
}
@ -257,7 +182,7 @@ static const IHTMLFrameBase2Vtbl HTMLIFrameBase2Vtbl = {
HTMLIFrameBase2_get_allowTransparency
};
#define HTMLIFRAME_NODE_THIS(iface) DEFINE_THIS2(HTMLIFrame, element.node, iface)
#define HTMLIFRAME_NODE_THIS(iface) DEFINE_THIS2(HTMLIFrame, framebase.element.node, iface)
static HRESULT HTMLIFrame_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{
@ -269,7 +194,7 @@ static HRESULT HTMLIFrame_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
TRACE("(%p)->(IID_IHTMLFrameBase2 %p)\n", This, ppv);
*ppv = HTMLFRAMEBASE2(This);
}else {
return HTMLElement_QI(&This->element.node, riid, ppv);
return HTMLFrameBase_QI(&This->framebase, riid, ppv);
}
IUnknown_AddRef((IUnknown*)*ppv);
@ -280,12 +205,10 @@ static void HTMLIFrame_destructor(HTMLDOMNode *iface)
{
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
if(This->content_window)
IHTMLWindow2_Release(HTMLWINDOW2(This->content_window));
if(This->nsiframe)
nsIDOMHTMLIFrameElement_Release(This->nsiframe);
HTMLElement_destructor(&This->element.node);
HTMLFrameBase_destructor(&This->framebase);
}
#undef HTMLIFRAME_NODE_THIS
@ -301,6 +224,7 @@ static const tid_t HTMLIFrame_iface_tids[] = {
IHTMLElement_tid,
IHTMLElement2_tid,
IHTMLElement3_tid,
IHTMLFrameBase_tid,
IHTMLFrameBase2_tid,
0
};
@ -312,7 +236,38 @@ static dispex_static_data_t HTMLIFrame_dispex = {
HTMLIFrame_iface_tids
};
HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement *nselem)
static HTMLWindow *get_content_window(nsIDOMHTMLIFrameElement *nsiframe)
{
HTMLWindow *ret;
nsIDOMWindow *nswindow;
nsIDOMDocument *nsdoc;
nsresult nsres;
nsres = nsIDOMHTMLIFrameElement_GetContentDocument(nsiframe, &nsdoc);
if(NS_FAILED(nsres)) {
ERR("GetContentDocument failed: %08x\n", nsres);
return NULL;
}
if(!nsdoc) {
FIXME("NULL contentDocument\n");
return NULL;
}
nswindow = get_nsdoc_window(nsdoc);
nsIDOMDocument_Release(nsdoc);
if(!nswindow)
return NULL;
ret = nswindow_to_window(nswindow);
nsIDOMWindow_Release(nswindow);
if(!ret)
ERR("Could not get window object\n");
return ret;
}
HTMLElement *HTMLIFrame_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLWindow *content_window)
{
HTMLIFrame *ret;
nsresult nsres;
@ -320,13 +275,16 @@ HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement *nselem)
ret = heap_alloc_zero(sizeof(HTMLIFrame));
ret->lpIHTMLFrameBase2Vtbl = &HTMLIFrameBase2Vtbl;
ret->element.node.vtbl = &HTMLIFrameImplVtbl;
HTMLElement_Init(&ret->element, &HTMLIFrame_dispex);
ret->framebase.element.node.vtbl = &HTMLIFrameImplVtbl;
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLIFrameElement, (void**)&ret->nsiframe);
if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLIFrameElement iface: %08x\n", nsres);
return &ret->element;
if(!content_window)
content_window = get_content_window(ret->nsiframe);
HTMLFrameBase_Init(&ret->framebase, doc, nselem, content_window, &HTMLIFrame_dispex);
return &ret->framebase.element;
}

View file

@ -595,7 +595,7 @@ static dispex_static_data_t HTMLImgElement_dispex = {
HTMLImgElement_iface_tids
};
HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLImgElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLImgElement *ret = heap_alloc_zero(sizeof(HTMLImgElement));
nsresult nsres;
@ -607,7 +607,211 @@ HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement *nselem)
if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLImageElement: %08x\n", nsres);
HTMLElement_Init(&ret->element, &HTMLImgElement_dispex);
HTMLElement_Init(&ret->element, doc, nselem, &HTMLImgElement_dispex);
return &ret->element;
}
#define HTMLIMGFACTORY_THIS(iface) DEFINE_THIS(HTMLImageElementFactory, HTMLImageElementFactory, iface)
static HRESULT WINAPI HTMLImageElementFactory_QueryInterface(IHTMLImageElementFactory *iface,
REFIID riid, void **ppv)
{
HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
*ppv = NULL;
if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_Unknown %p)\n", This, ppv);
*ppv = HTMLIMGFACTORY(This);
}else if(IsEqualGUID(&IID_IHTMLImageElementFactory, riid)) {
TRACE("(%p)->(IID_IHTMLImageElementFactory %p)\n", This, ppv);
*ppv = HTMLIMGFACTORY(This);
}else if(dispex_query_interface(&This->dispex, riid, ppv))
return *ppv ? S_OK : E_NOINTERFACE;
if(*ppv) {
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
return E_NOINTERFACE;
}
static ULONG WINAPI HTMLImageElementFactory_AddRef(IHTMLImageElementFactory *iface)
{
HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
return ref;
}
static ULONG WINAPI HTMLImageElementFactory_Release(IHTMLImageElementFactory *iface)
{
HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
if(!ref)
heap_free(This);
return ref;
}
static HRESULT WINAPI HTMLImageElementFactory_GetTypeInfoCount(IHTMLImageElementFactory *iface,
UINT *pctinfo)
{
HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
FIXME("(%p)->(%p)\n", This, pctinfo);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLImageElementFactory_GetTypeInfo(IHTMLImageElementFactory *iface,
UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
{
HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLImageElementFactory_GetIDsOfNames(IHTMLImageElementFactory *iface,
REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid,
DISPID *rgDispId)
{
HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames,
cNames, lcid, rgDispId);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLImageElementFactory_Invoke(IHTMLImageElementFactory *iface,
DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
{
HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *iface,
VARIANT width, VARIANT height, IHTMLImgElement **img_elem)
{
HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
HTMLElement *elem;
nsIDOMHTMLElement *nselem;
HRESULT hres;
static const PRUnichar imgW[] = {'I','M','G',0};
TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(&width),
debugstr_variant(&height), img_elem);
if(!This->window || !This->window->doc) {
WARN("NULL doc\n");
return E_UNEXPECTED;
}
*img_elem = NULL;
hres = create_nselem(This->window->doc, imgW, &nselem);
if(FAILED(hres))
return hres;
elem = HTMLElement_Create(This->window->doc, (nsIDOMNode*)nselem, FALSE);
if(!elem) {
ERR("HTMLElement_Create failed\n");
return E_FAIL;
}
hres = IHTMLElement_QueryInterface(HTMLELEM(elem), &IID_IHTMLImgElement, (void**)img_elem);
if(FAILED(hres)) {
ERR("IHTMLElement_QueryInterface failed: 0x%08x\n", hres);
return hres;
}
nsIDOMHTMLElement_Release(nselem);
if(V_VT(&width) != VT_EMPTY || V_VT(&height) != VT_EMPTY)
FIXME("Not setting image dimensions\n");
return S_OK;
}
static HRESULT HTMLImageElementFactory_value(IUnknown *iface, LCID lcid,
WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei,
IServiceProvider *caller)
{
HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
IHTMLImgElement *img;
VARIANT empty, *width, *height;
HRESULT hres;
int argc = params->cArgs - params->cNamedArgs;
V_VT(res) = VT_NULL;
V_VT(&empty) = VT_EMPTY;
width = argc >= 1 ? params->rgvarg + (params->cArgs - 1) : &empty;
height = argc >= 2 ? params->rgvarg + (params->cArgs - 2) : &empty;
hres = IHTMLImageElementFactory_create(HTMLIMGFACTORY(This), *width, *height, &img);
if(FAILED(hres))
return hres;
V_VT(res) = VT_DISPATCH;
V_DISPATCH(res) = (IDispatch*)img;
return S_OK;
}
#undef HTMLIMGFACTORY_THIS
static const IHTMLImageElementFactoryVtbl HTMLImageElementFactoryVtbl = {
HTMLImageElementFactory_QueryInterface,
HTMLImageElementFactory_AddRef,
HTMLImageElementFactory_Release,
HTMLImageElementFactory_GetTypeInfoCount,
HTMLImageElementFactory_GetTypeInfo,
HTMLImageElementFactory_GetIDsOfNames,
HTMLImageElementFactory_Invoke,
HTMLImageElementFactory_create
};
static const tid_t HTMLImageElementFactory_iface_tids[] = {
IHTMLImageElementFactory_tid,
0
};
static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = {
HTMLImageElementFactory_value,
NULL,
NULL
};
static dispex_static_data_t HTMLImageElementFactory_dispex = {
&HTMLImageElementFactory_dispex_vtbl,
IHTMLImageElementFactory_tid,
NULL,
HTMLImageElementFactory_iface_tids
};
HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow *window)
{
HTMLImageElementFactory *ret;
ret = heap_alloc(sizeof(HTMLImageElementFactory));
ret->lpHTMLImageElementFactoryVtbl = &HTMLImageElementFactoryVtbl;
ret->ref = 1;
ret->window = window;
init_dispex(&ret->dispex, (IUnknown*)HTMLIMGFACTORY(ret), &HTMLImageElementFactory_dispex);
return ret;
}

View file

@ -28,6 +28,7 @@
#include "wine/debug.h"
#include "mshtml_private.h"
#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@ -1129,6 +1130,25 @@ static void HTMLInputElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node);
}
static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
{
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
if(eid == EVENTID_CLICK) {
nsresult nsres;
*handled = TRUE;
nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
if(NS_FAILED(nsres)) {
ERR("Click failed: %08x\n", nsres);
return E_FAIL;
}
}
return S_OK;
}
static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
{
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
@ -1147,6 +1167,7 @@ static const NodeImplVtbl HTMLInputElementImplVtbl = {
HTMLInputElement_QI,
HTMLInputElement_destructor,
NULL,
HTMLInputElementImpl_call_event,
HTMLInputElementImpl_put_disabled,
HTMLInputElementImpl_get_disabled,
};
@ -1167,7 +1188,7 @@ static dispex_static_data_t HTMLInputElement_dispex = {
HTMLInputElement_iface_tids
};
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
nsresult nsres;
@ -1176,7 +1197,7 @@ HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
ret->element.node.vtbl = &HTMLInputElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLInputElement_dispex);
HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
(void**)&ret->nsinput);

View file

@ -37,15 +37,32 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static HRESULT get_url(HTMLLocation *This, const WCHAR **ret)
{
if(!This->window || !This->window->doc_obj || !This->window->doc_obj->url) {
if(!This->window || !This->window->url) {
FIXME("No current URL\n");
return E_NOTIMPL;
}
*ret = This->window->doc_obj->url;
*ret = This->window->url;
return S_OK;
}
static HRESULT get_url_components(HTMLLocation *This, URL_COMPONENTSW *url)
{
const WCHAR *doc_url;
HRESULT hres;
hres = get_url(This, &doc_url);
if(FAILED(hres))
return hres;
if(!InternetCrackUrlW(doc_url, 0, 0, url)) {
FIXME("InternetCrackUrlW failed: 0x%08x\n", GetLastError());
SetLastError(0);
return E_FAIL;
}
return S_OK;
}
#define HTMLLOCATION_THIS(iface) DEFINE_THIS(HTMLLocation, HTMLLocation, iface)
@ -134,27 +151,115 @@ static HRESULT WINAPI HTMLLocation_Invoke(IHTMLLocation *iface, DISPID dispIdMem
static HRESULT WINAPI HTMLLocation_put_href(IHTMLLocation *iface, BSTR v)
{
HTMLLocation *This = HTMLLOCATION_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
if(!This->window || !This->window->doc) {
FIXME("No document available\n");
return E_FAIL;
}
return navigate_url(This->window->doc, v);
}
static HRESULT WINAPI HTMLLocation_get_href(IHTMLLocation *iface, BSTR *p)
{
HTMLLocation *This = HTMLLOCATION_THIS(iface);
const WCHAR *url;
HRESULT hres;
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
WCHAR *buf = NULL, *url_path = NULL;
HRESULT hres, ret;
DWORD len = 0;
int i;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_POINTER;
hres = get_url(This, &url);
url.dwSchemeLength = 1;
url.dwHostNameLength = 1;
url.dwUrlPathLength = 1;
url.dwExtraInfoLength = 1;
hres = get_url_components(This, &url);
if(FAILED(hres))
return hres;
*p = SysAllocString(url);
return *p ? S_OK : E_OUTOFMEMORY;
switch(url.nScheme) {
case INTERNET_SCHEME_FILE:
{
/* prepend a slash */
url_path = HeapAlloc(GetProcessHeap(), 0, (url.dwUrlPathLength + 1) * sizeof(WCHAR));
if(!url_path)
return E_OUTOFMEMORY;
url_path[0] = '/';
memcpy(url_path + 1, url.lpszUrlPath, url.dwUrlPathLength * sizeof(WCHAR));
url.lpszUrlPath = url_path;
url.dwUrlPathLength = url.dwUrlPathLength + 1;
}
break;
case INTERNET_SCHEME_HTTP:
case INTERNET_SCHEME_HTTPS:
case INTERNET_SCHEME_FTP:
if(!url.dwUrlPathLength) {
/* add a slash if it's blank */
url_path = url.lpszUrlPath = HeapAlloc(GetProcessHeap(), 0, 1 * sizeof(WCHAR));
if(!url.lpszUrlPath)
return E_OUTOFMEMORY;
url.lpszUrlPath[0] = '/';
url.dwUrlPathLength = 1;
}
break;
default:
break;
}
/* replace \ with / */
for(i = 0; i < url.dwUrlPathLength; ++i)
if(url.lpszUrlPath[i] == '\\')
url.lpszUrlPath[i] = '/';
if(InternetCreateUrlW(&url, ICU_ESCAPE, NULL, &len)) {
FIXME("InternetCreateUrl succeeded with NULL buffer?\n");
ret = E_FAIL;
goto cleanup;
}
if(GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
FIXME("InternetCreateUrl failed with error: %08x\n", GetLastError());
SetLastError(0);
ret = E_FAIL;
goto cleanup;
}
SetLastError(0);
buf = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if(!buf) {
ret = E_OUTOFMEMORY;
goto cleanup;
}
if(!InternetCreateUrlW(&url, ICU_ESCAPE, buf, &len)) {
FIXME("InternetCreateUrl failed with error: %08x\n", GetLastError());
SetLastError(0);
ret = E_FAIL;
goto cleanup;
}
*p = SysAllocStringLen(buf, len);
if(!*p) {
ret = E_OUTOFMEMORY;
goto cleanup;
}
ret = S_OK;
cleanup:
HeapFree(GetProcessHeap(), 0, buf);
HeapFree(GetProcessHeap(), 0, url_path);
return ret;
}
static HRESULT WINAPI HTMLLocation_put_protocol(IHTMLLocation *iface, BSTR v)
@ -167,12 +272,31 @@ static HRESULT WINAPI HTMLLocation_put_protocol(IHTMLLocation *iface, BSTR v)
static HRESULT WINAPI HTMLLocation_get_protocol(IHTMLLocation *iface, BSTR *p)
{
HTMLLocation *This = HTMLLOCATION_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_POINTER;
return E_NOTIMPL;
url.dwSchemeLength = 1;
hres = get_url_components(This, &url);
if(FAILED(hres))
return hres;
if(!url.dwSchemeLength) {
FIXME("Unexpected blank protocol\n");
return E_NOTIMPL;
}else {
WCHAR buf[url.dwSchemeLength + 1];
memcpy(buf, url.lpszScheme, url.dwSchemeLength * sizeof(WCHAR));
buf[url.dwSchemeLength] = ':';
*p = SysAllocStringLen(buf, url.dwSchemeLength + 1);
}
if(!*p)
return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI HTMLLocation_put_host(IHTMLLocation *iface, BSTR v)
@ -185,12 +309,40 @@ static HRESULT WINAPI HTMLLocation_put_host(IHTMLLocation *iface, BSTR v)
static HRESULT WINAPI HTMLLocation_get_host(IHTMLLocation *iface, BSTR *p)
{
HTMLLocation *This = HTMLLOCATION_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_POINTER;
return E_NOTIMPL;
url.dwHostNameLength = 1;
hres = get_url_components(This, &url);
if(FAILED(hres))
return hres;
if(!url.dwHostNameLength){
*p = NULL;
return S_OK;
}
if(url.nPort) {
/* <hostname>:<port> */
const WCHAR format[] = {'%','d',0};
DWORD len = url.dwHostNameLength + 1 + 5 + 1;
WCHAR buf[len];
memcpy(buf, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR));
buf[url.dwHostNameLength] = ':';
snprintfW(buf + url.dwHostNameLength + 1, 6, format, url.nPort);
*p = SysAllocString(buf);
}else
*p = SysAllocStringLen(url.lpszHostName, url.dwHostNameLength);
if(!*p)
return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI HTMLLocation_put_hostname(IHTMLLocation *iface, BSTR v)
@ -203,12 +355,28 @@ static HRESULT WINAPI HTMLLocation_put_hostname(IHTMLLocation *iface, BSTR v)
static HRESULT WINAPI HTMLLocation_get_hostname(IHTMLLocation *iface, BSTR *p)
{
HTMLLocation *This = HTMLLOCATION_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_POINTER;
return E_NOTIMPL;
url.dwHostNameLength = 1;
hres = get_url_components(This, &url);
if(FAILED(hres))
return hres;
if(!url.dwHostNameLength){
*p = NULL;
return S_OK;
}
*p = SysAllocStringLen(url.lpszHostName, url.dwHostNameLength);
if(!*p)
return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI HTMLLocation_put_port(IHTMLLocation *iface, BSTR v)
@ -221,12 +389,31 @@ static HRESULT WINAPI HTMLLocation_put_port(IHTMLLocation *iface, BSTR v)
static HRESULT WINAPI HTMLLocation_get_port(IHTMLLocation *iface, BSTR *p)
{
HTMLLocation *This = HTMLLOCATION_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_POINTER;
return E_NOTIMPL;
hres = get_url_components(This, &url);
if(FAILED(hres))
return hres;
if(url.nPort) {
const WCHAR format[] = {'%','d',0};
WCHAR buf[6];
snprintfW(buf, 6, format, url.nPort);
*p = SysAllocString(buf);
}else {
const WCHAR empty[] = {0};
*p = SysAllocString(empty);
}
if(!*p)
return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI HTMLLocation_put_pathname(IHTMLLocation *iface, BSTR v)
@ -239,10 +426,7 @@ static HRESULT WINAPI HTMLLocation_put_pathname(IHTMLLocation *iface, BSTR v)
static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
{
HTMLLocation *This = HTMLLOCATION_THIS(iface);
WCHAR buf[INTERNET_MAX_PATH_LENGTH];
URL_COMPONENTSW url = {sizeof(url)};
const WCHAR *doc_url;
DWORD size = 0;
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
@ -250,30 +434,17 @@ static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
if(!p)
return E_POINTER;
hres = get_url(This, &doc_url);
url.dwUrlPathLength = 1;
url.dwExtraInfoLength = 1;
hres = get_url_components(This, &url);
if(FAILED(hres))
return hres;
hres = CoInternetParseUrl(doc_url, PARSE_PATH_FROM_URL, 0, buf, sizeof(buf), &size, 0);
if(SUCCEEDED(hres)) {
*p = SysAllocString(buf);
if(!*p)
return E_OUTOFMEMORY;
return S_OK;
}
if(url.dwUrlPathLength && url.lpszUrlPath[0] == '/')
*p = SysAllocStringLen(url.lpszUrlPath + 1, url.dwUrlPathLength - 1);
else
*p = SysAllocStringLen(url.lpszUrlPath, url.dwUrlPathLength);
url.dwUrlPathLength = 1;
if(!InternetCrackUrlW(doc_url, 0, 0, &url)) {
FIXME("InternetCrackUrl failed\n");
return E_FAIL;
}
if(!url.dwUrlPathLength) {
*p = NULL;
return S_OK;
}
*p = SysAllocStringLen(url.lpszUrlPath, url.dwUrlPathLength);
if(!*p)
return E_OUTOFMEMORY;
return S_OK;
@ -289,12 +460,32 @@ static HRESULT WINAPI HTMLLocation_put_search(IHTMLLocation *iface, BSTR v)
static HRESULT WINAPI HTMLLocation_get_search(IHTMLLocation *iface, BSTR *p)
{
HTMLLocation *This = HTMLLOCATION_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
HRESULT hres;
const WCHAR hash[] = {'#',0};
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_POINTER;
return E_NOTIMPL;
url.dwExtraInfoLength = 1;
hres = get_url_components(This, &url);
if(FAILED(hres))
return hres;
if(!url.dwExtraInfoLength){
*p = NULL;
return S_OK;
}
url.dwExtraInfoLength = strcspnW(url.lpszExtraInfo, hash);
*p = SysAllocStringLen(url.lpszExtraInfo, url.dwExtraInfoLength);
if(!*p)
return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI HTMLLocation_put_hash(IHTMLLocation *iface, BSTR v)
@ -307,12 +498,34 @@ static HRESULT WINAPI HTMLLocation_put_hash(IHTMLLocation *iface, BSTR v)
static HRESULT WINAPI HTMLLocation_get_hash(IHTMLLocation *iface, BSTR *p)
{
HTMLLocation *This = HTMLLOCATION_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
const WCHAR hash[] = {'#',0};
DWORD hash_pos = 0;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_POINTER;
return E_NOTIMPL;
url.dwExtraInfoLength = 1;
hres = get_url_components(This, &url);
if(FAILED(hres))
return hres;
if(!url.dwExtraInfoLength){
*p = NULL;
return S_OK;
}
hash_pos = strcspnW(url.lpszExtraInfo, hash);
url.dwExtraInfoLength -= hash_pos;
*p = SysAllocStringLen(url.lpszExtraInfo + hash_pos, url.dwExtraInfoLength);
if(!*p)
return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI HTMLLocation_reload(IHTMLLocation *iface, VARIANT_BOOL flag)

View file

@ -208,7 +208,7 @@ static HRESULT HTMLDOMChildrenCollection_invoke(IUnknown *iface, DISPID id, LCID
TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller);
switch(flags) {
case INVOKE_PROPERTYGET: {
case DISPATCH_PROPERTYGET: {
IDispatch *disp = NULL;
HRESULT hres;
@ -729,8 +729,19 @@ static HRESULT WINAPI HTMLDOMNode_get_previousSibling(IHTMLDOMNode *iface, IHTML
static HRESULT WINAPI HTMLDOMNode_get_nextSibling(IHTMLDOMNode *iface, IHTMLDOMNode **p)
{
HTMLDOMNode *This = HTMLDOMNODE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsIDOMNode *nssibling = NULL;
TRACE("(%p)->(%p)\n", This, p);
nsIDOMNode_GetNextSibling(This->nsnode, &nssibling);
if(nssibling) {
*p = HTMLDOMNODE(get_node(This->doc, nssibling, TRUE));
IHTMLDOMNode_AddRef(*p);
}else {
*p = NULL;
}
return S_OK;
}
#undef HTMLDOMNODE_THIS
@ -825,8 +836,13 @@ static HRESULT WINAPI HTMLDOMNode2_get_ownerDocument(IHTMLDOMNode2 *iface, IDisp
TRACE("(%p)->(%p)\n", This, p);
*p = (IDispatch*)HTMLDOC(&This->doc->basedoc);
IDispatch_AddRef(*p);
/* FIXME: Better check for document node */
if(This == &This->doc->node) {
*p = NULL;
}else {
*p = (IDispatch*)HTMLDOC(&This->doc->basedoc);
IDispatch_AddRef(*p);
}
return S_OK;
}
@ -900,7 +916,8 @@ void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsno
node->ref = 1;
node->doc = doc;
nsIDOMNode_AddRef(nsnode);
if(nsnode)
nsIDOMNode_AddRef(nsnode);
node->nsnode = nsnode;
node->next = doc->nodes;

View file

@ -187,7 +187,7 @@ static HRESULT WINAPI HTMLOptionElement_put_text(IHTMLOptionElement *iface, BSTR
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
if(!This->element.node.doc->basedoc.nsdoc) {
if(!This->element.node.doc->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
@ -210,7 +210,7 @@ static HRESULT WINAPI HTMLOptionElement_put_text(IHTMLOptionElement *iface, BSTR
}
nsAString_Init(&text_str, v);
nsres = nsIDOMHTMLDocument_CreateTextNode(This->element.node.doc->basedoc.nsdoc, &text_str, &text_node);
nsres = nsIDOMHTMLDocument_CreateTextNode(This->element.node.doc->nsdoc, &text_str, &text_node);
nsAString_Finish(&text_str);
if(NS_FAILED(nsres)) {
ERR("CreateTextNode failed: %08x\n", nsres);
@ -339,7 +339,7 @@ static dispex_static_data_t HTMLOptionElement_dispex = {
HTMLOptionElement_iface_tids
};
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLOptionElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLOptionElement *ret = heap_alloc_zero(sizeof(HTMLOptionElement));
nsresult nsres;
@ -347,7 +347,7 @@ HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl;
ret->element.node.vtbl = &HTMLOptionElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLOptionElement_dispex);
HTMLElement_Init(&ret->element, doc, nselem, &HTMLOptionElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
if(NS_FAILED(nsres))
@ -448,9 +448,7 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
IHTMLOptionElement **optelem)
{
HTMLOptionElementFactory *This = HTMLOPTFACTORY_THIS(iface);
nsIDOMElement *nselem;
nsAString option_str;
nsresult nsres;
nsIDOMHTMLElement *nselem;
HRESULT hres;
static const PRUnichar optionW[] = {'O','P','T','I','O','N',0};
@ -458,24 +456,20 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_variant(&text), debugstr_variant(&value),
debugstr_variant(&defaultselected), debugstr_variant(&selected), optelem);
if(!This->window || !This->window->doc || !This->window->doc->basedoc.nsdoc) {
WARN("NULL nsdoc\n");
if(!This->window || !This->window->doc) {
WARN("NULL doc\n");
return E_UNEXPECTED;
}
*optelem = NULL;
nsAString_Init(&option_str, optionW);
nsres = nsIDOMHTMLDocument_CreateElement(This->window->doc->basedoc.nsdoc, &option_str, &nselem);
nsAString_Finish(&option_str);
if(NS_FAILED(nsres)) {
ERR("CreateElement failed: %08x\n", nsres);
return E_FAIL;
}
hres = create_nselem(This->window->doc, optionW, &nselem);
if(FAILED(hres))
return hres;
hres = IHTMLDOMNode_QueryInterface(HTMLDOMNODE(get_node(This->window->doc, (nsIDOMNode*)nselem, TRUE)),
&IID_IHTMLOptionElement, (void**)optelem);
nsIDOMElement_Release(nselem);
nsIDOMHTMLElement_Release(nselem);
if(V_VT(&text) == VT_BSTR)
IHTMLOptionElement_put_text(*optelem, V_BSTR(&text));

View file

@ -306,7 +306,7 @@ static const NodeImplVtbl HTMLScriptElementImplVtbl = {
HTMLScriptElement_destructor
};
HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLScriptElement *ret = heap_alloc_zero(sizeof(HTMLScriptElement));
nsresult nsres;
@ -314,7 +314,7 @@ HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLScriptElementVtbl = &HTMLScriptElementVtbl;
ret->element.node.vtbl = &HTMLScriptElementImplVtbl;
HTMLElement_Init(&ret->element, NULL);
HTMLElement_Init(&ret->element, doc, nselem, NULL);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript);
if(NS_FAILED(nsres))

View file

@ -481,6 +481,7 @@ static const NodeImplVtbl HTMLSelectElementImplVtbl = {
HTMLSelectElement_QI,
HTMLSelectElement_destructor,
NULL,
NULL,
HTMLSelectElementImpl_put_disabled,
HTMLSelectElementImpl_get_disabled
};
@ -502,7 +503,7 @@ static dispex_static_data_t HTMLSelectElement_dispex = {
HTMLSelectElement_tids
};
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLSelectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLSelectElement *ret = heap_alloc_zero(sizeof(HTMLSelectElement));
nsresult nsres;
@ -510,7 +511,7 @@ HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl;
ret->element.node.vtbl = &HTMLSelectElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLSelectElement_dispex);
HTMLElement_Init(&ret->element, doc, nselem, &HTMLSelectElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLSelectElement,
(void**)&ret->nsselect);

View file

@ -574,7 +574,7 @@ static dispex_static_data_t HTMLTable_dispex = {
HTMLTable_iface_tids
};
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLTable_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLTable *ret = heap_alloc_zero(sizeof(HTMLTable));
nsresult nsres;
@ -582,7 +582,7 @@ HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem)
ret->element.node.vtbl = &HTMLTableImplVtbl;
ret->lpHTMLTableVtbl = &HTMLTableVtbl;
HTMLElement_Init(&ret->element, &HTMLTable_dispex);
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex);
ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents);

View file

@ -317,7 +317,7 @@ static dispex_static_data_t HTMLTableRow_dispex = {
HTMLTableRow_iface_tids
};
HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLTableRow_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLTableRow *ret = heap_alloc_zero(sizeof(HTMLTableRow));
nsresult nsres;
@ -325,7 +325,7 @@ HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLTableRowVtbl = &HTMLTableRowVtbl;
ret->element.node.vtbl = &HTMLTableRowImplVtbl;
HTMLElement_Init(&ret->element, &HTMLTableRow_dispex);
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTableRow_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
if(NS_FAILED(nsres))

View file

@ -406,11 +406,12 @@ static const NodeImplVtbl HTMLTextAreaElementImplVtbl = {
HTMLTextAreaElement_QI,
HTMLTextAreaElement_destructor,
NULL,
NULL,
HTMLTextAreaElementImpl_put_disabled,
HTMLTextAreaElementImpl_get_disabled
};
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
HTMLElement *HTMLTextAreaElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLTextAreaElement *ret = heap_alloc_zero(sizeof(HTMLTextAreaElement));
nsresult nsres;
@ -418,7 +419,7 @@ HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;
ret->element.node.vtbl = &HTMLTextAreaElementImplVtbl;
HTMLElement_Init(&ret->element, NULL);
HTMLElement_Init(&ret->element, doc, nselem, NULL);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement,
(void**)&ret->nstextarea);

View file

@ -182,11 +182,12 @@ static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = {
HTMLTextContainer_get_onscroll
};
void HTMLTextContainer_Init(HTMLTextContainer *This, dispex_static_data_t *dispex_data)
void HTMLTextContainer_Init(HTMLTextContainer *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
dispex_static_data_t *dispex_data)
{
This->lpHTMLTextContainerVtbl = &HTMLTextContainerVtbl;
HTMLElement_Init(&This->element, dispex_data);
HTMLElement_Init(&This->element, doc, nselem, dispex_data);
ConnectionPoint_Init(&This->cp, &This->element.cp_container, &DIID_HTMLTextContainerEvents);
}

View file

@ -36,15 +36,68 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static struct list window_list = LIST_INIT(window_list);
void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node)
static void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node)
{
if(window->doc) {
abort_document_bindings(window->doc);
window->doc->basedoc.window = NULL;
htmldoc_release(&window->doc->basedoc);
}
window->doc = doc_node;
if(doc_node)
htmldoc_addref(&doc_node->basedoc);
if(window->doc_obj && window->doc_obj->basedoc.window == window) {
if(window->doc_obj->basedoc.doc_node)
htmldoc_release(&window->doc_obj->basedoc.doc_node->basedoc);
window->doc_obj->basedoc.doc_node = doc_node;
if(doc_node)
htmldoc_addref(&doc_node->basedoc);
}
}
nsIDOMWindow *get_nsdoc_window(nsIDOMDocument *nsdoc)
{
nsIDOMDocumentView *nsdocview;
nsIDOMAbstractView *nsview;
nsIDOMWindow *nswindow;
nsresult nsres;
nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
nsIDOMDocument_Release(nsdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMDocumentView iface: %08x\n", nsres);
return NULL;
}
nsres = nsIDOMDocumentView_GetDefaultView(nsdocview, &nsview);
nsIDOMDocumentView_Release(nsview);
if(NS_FAILED(nsres)) {
ERR("GetDefaultView failed: %08x\n", nsres);
return NULL;
}
nsres = nsIDOMAbstractView_QueryInterface(nsview, &IID_nsIDOMWindow, (void**)&nswindow);
nsIDOMAbstractView_Release(nsview);
if(NS_FAILED(nsres)) {
ERR("Coult not get nsIDOMWindow iface: %08x\n", nsres);
return NULL;
}
return nswindow;
}
static void release_children(HTMLWindow *This)
{
HTMLWindow *child;
while(!list_empty(&This->children)) {
child = LIST_ENTRY(list_tail(&This->children), HTMLWindow, sibling_entry);
list_remove(&child->sibling_entry);
child->parent = NULL;
IHTMLWindow2_Release(HTMLWINDOW2(child));
}
}
#define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
@ -71,7 +124,7 @@ static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID rii
TRACE("(%p)->(IID_IHTMLWindow2 %p)\n", This, ppv);
*ppv = HTMLWINDOW2(This);
}else if(IsEqualGUID(&IID_IHTMLWindow3, riid)) {
TRACE("(%p)->(IID_IHTMLWindow2 %p)\n", This, ppv);
TRACE("(%p)->(IID_IHTMLWindow3 %p)\n", This, ppv);
*ppv = HTMLWINDOW3(This);
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
return *ppv ? S_OK : E_NOINTERFACE;
@ -106,13 +159,22 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
if(!ref) {
DWORD i;
remove_target_tasks(This->task_magic);
set_window_bscallback(This, NULL);
set_current_mon(This, NULL);
window_set_docnode(This, NULL);
release_children(This);
if(This->option_factory) {
This->option_factory->window = NULL;
IHTMLOptionElementFactory_Release(HTMLOPTFACTORY(This->option_factory));
}
if(This->image_factory) {
This->image_factory->window = NULL;
IHTMLImageElementFactory_Release(HTMLIMGFACTORY(This->image_factory));
}
if(This->location) {
This->location->window = NULL;
IHTMLLocation_Release(HTMLLOCATION(This->location));
@ -122,8 +184,11 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
release_event_target(This->event_target);
for(i=0; i < This->global_prop_cnt; i++)
heap_free(This->global_props[i].name);
This->window_ref->window = NULL;
windowref_release(This->window_ref);
heap_free(This->global_props);
heap_free(This->event_vector);
release_script_hosts(This);
list_remove(&This->entry);
release_dispex(&This->dispex);
@ -177,8 +242,27 @@ static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex,
static HRESULT WINAPI HTMLWindow2_get_length(IHTMLWindow2 *iface, LONG *p)
{
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsIDOMWindowCollection *nscollection;
PRUint32 length;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMWindow_GetFrames(This->nswindow, &nscollection);
if(NS_FAILED(nsres)) {
ERR("GetFrames failed: %08x\n", nsres);
return E_FAIL;
}
nsres = nsIDOMWindowCollection_GetLength(nscollection, &length);
nsIDOMWindowCollection_Release(nscollection);
if(NS_FAILED(nsres)) {
ERR("GetLength failed: %08x\n", nsres);
return E_FAIL;
}
*p = length;
return S_OK;
}
static HRESULT WINAPI HTMLWindow2_get_frames(IHTMLWindow2 *iface, IHTMLFramesCollection2 **p)
@ -373,8 +457,16 @@ static HRESULT WINAPI HTMLWindow2_prompt(IHTMLWindow2 *iface, BSTR message,
static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageElementFactory **p)
{
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
if(!This->image_factory)
This->image_factory = HTMLImageElementFactory_Create(This);
*p = HTMLIMGFACTORY(This->image_factory);
IHTMLImageElementFactory_AddRef(*p);
return S_OK;
}
static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p)
@ -438,15 +530,49 @@ static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigato
static HRESULT WINAPI HTMLWindow2_put_name(IHTMLWindow2 *iface, BSTR v)
{
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
nsAString name_str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
nsAString_Init(&name_str, v);
nsres = nsIDOMWindow_SetName(This->nswindow, &name_str);
nsAString_Finish(&name_str);
if(NS_FAILED(nsres))
ERR("SetName failed: %08x\n", nsres);
return S_OK;
}
static HRESULT WINAPI HTMLWindow2_get_name(IHTMLWindow2 *iface, BSTR *p)
{
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString name_str;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&name_str, NULL);
nsres = nsIDOMWindow_GetName(This->nswindow, &name_str);
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *name;
nsAString_GetData(&name_str, &name);
if(*name) {
*p = SysAllocString(name);
hres = *p ? S_OK : E_OUTOFMEMORY;
}else {
*p = NULL;
hres = S_OK;
}
}else {
ERR("GetName failed: %08x\n", nsres);
hres = E_FAIL;
}
nsAString_Finish(&name_str);
return hres;
}
static HRESULT WINAPI HTMLWindow2_get_parent(IHTMLWindow2 *iface, IHTMLWindow2 **p)
@ -879,8 +1005,7 @@ static HRESULT HTMLWindow_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD fla
VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
{
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
IDispatchEx *dispex;
IDispatch *disp;
global_prop_t *prop;
DWORD idx;
HRESULT hres;
@ -888,24 +1013,51 @@ static HRESULT HTMLWindow_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD fla
if(idx >= This->global_prop_cnt)
return DISP_E_MEMBERNOTFOUND;
disp = get_script_disp(This->global_props[idx].script_host);
if(!disp)
return E_UNEXPECTED;
prop = This->global_props+idx;
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
if(SUCCEEDED(hres)) {
TRACE("%s >>>\n", debugstr_w(This->global_props[idx].name));
hres = IDispatchEx_InvokeEx(dispex, This->global_props[idx].id, lcid, flags, params, res, ei, caller);
if(hres == S_OK)
TRACE("%s <<<\n", debugstr_w(This->global_props[idx].name));
else
WARN("%s <<< %08x\n", debugstr_w(This->global_props[idx].name), hres);
IDispatchEx_Release(dispex);
}else {
FIXME("No IDispatchEx\n");
switch(prop->type) {
case GLOBAL_SCRIPTVAR: {
IDispatchEx *dispex;
IDispatch *disp;
disp = get_script_disp(prop->script_host);
if(!disp)
return E_UNEXPECTED;
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
if(SUCCEEDED(hres)) {
TRACE("%s >>>\n", debugstr_w(prop->name));
hres = IDispatchEx_InvokeEx(dispex, prop->id, lcid, flags, params, res, ei, caller);
if(hres == S_OK)
TRACE("%s <<<\n", debugstr_w(prop->name));
else
WARN("%s <<< %08x\n", debugstr_w(prop->name), hres);
IDispatchEx_Release(dispex);
}else {
FIXME("No IDispatchEx\n");
}
IDispatch_Release(disp);
break;
}
case GLOBAL_ELEMENTVAR: {
IHTMLElement *elem;
hres = IHTMLDocument3_getElementById(HTMLDOC3(&This->doc->basedoc), prop->name, &elem);
if(FAILED(hres))
return hres;
if(!elem)
return DISP_E_MEMBERNOTFOUND;
V_VT(res) = VT_DISPATCH;
V_DISPATCH(res) = (IDispatch*)elem;
break;
}
default:
ERR("invalid type %d\n", prop->type);
hres = DISP_E_MEMBERNOTFOUND;
}
IDispatch_Release(disp);
return hres;
}
@ -1273,12 +1425,45 @@ static HRESULT WINAPI WindowDispEx_Invoke(IDispatchEx *iface, DISPID dispIdMembe
pVarResult, pExcepInfo, puArgErr);
}
static global_prop_t *alloc_global_prop(HTMLWindow *This, global_prop_type_t type, BSTR name)
{
if(This->global_prop_cnt == This->global_prop_size) {
global_prop_t *new_props;
DWORD new_size;
if(This->global_props) {
new_size = This->global_prop_size*2;
new_props = heap_realloc(This->global_props, new_size*sizeof(global_prop_t));
}else {
new_size = 16;
new_props = heap_alloc(new_size*sizeof(global_prop_t));
}
if(!new_props)
return NULL;
This->global_props = new_props;
This->global_prop_size = new_size;
}
This->global_props[This->global_prop_cnt].name = heap_strdupW(name);
if(!This->global_props[This->global_prop_cnt].name)
return NULL;
This->global_props[This->global_prop_cnt].type = type;
return This->global_props + This->global_prop_cnt++;
}
static inline DWORD prop_to_dispid(HTMLWindow *This, global_prop_t *prop)
{
return MSHTML_DISPID_CUSTOM_MIN + (prop-This->global_props);
}
static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
{
HTMLWindow *This = DISPEX_THIS(iface);
ScriptHost *script_host;
DISPID id;
DWORD i;
HRESULT hres;
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
@ -1291,35 +1476,41 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
}
if(find_global_prop(This, bstrName, grfdex, &script_host, &id)) {
if(This->global_prop_cnt == This->global_prop_size) {
global_prop_t *new_props;
DWORD new_size;
global_prop_t *prop;
if(This->global_props) {
new_size = This->global_prop_size*2;
new_props = heap_realloc(This->global_props, new_size*sizeof(global_prop_t));
}else {
new_size = 16;
new_props = heap_alloc(new_size*sizeof(global_prop_t));
}
if(!new_props)
return E_OUTOFMEMORY;
This->global_props = new_props;
This->global_prop_size = new_size;
}
This->global_props[This->global_prop_cnt].name = heap_strdupW(bstrName);
if(!This->global_props[This->global_prop_cnt].name)
prop = alloc_global_prop(This, GLOBAL_SCRIPTVAR, bstrName);
if(!prop)
return E_OUTOFMEMORY;
This->global_props[This->global_prop_cnt].script_host = script_host;
This->global_props[This->global_prop_cnt].id = id;
prop->script_host = script_host;
prop->id = id;
*pid = MSHTML_DISPID_CUSTOM_MIN + (This->global_prop_cnt++);
*pid = prop_to_dispid(This, prop);
return S_OK;
}
return IDispatchEx_GetDispID(DISPATCHEX(&This->dispex), bstrName, grfdex, pid);
hres = IDispatchEx_GetDispID(DISPATCHEX(&This->dispex), bstrName, grfdex, pid);
if(hres != DISP_E_UNKNOWNNAME)
return hres;
if(This->doc) {
global_prop_t *prop;
IHTMLElement *elem;
hres = IHTMLDocument3_getElementById(HTMLDOC3(&This->doc->basedoc), bstrName, &elem);
if(SUCCEEDED(hres) && elem) {
IHTMLElement_Release(elem);
prop = alloc_global_prop(This, GLOBAL_ELEMENTVAR, bstrName);
if(!prop)
return E_OUTOFMEMORY;
*pid = prop_to_dispid(This, prop);
return S_OK;
}
}
return DISP_E_UNKNOWNNAME;
}
static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
@ -1426,7 +1617,7 @@ static dispex_static_data_t HTMLWindow_dispex = {
HTMLWindow_iface_tids
};
HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTMLWindow **ret)
HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTMLWindow *parent, HTMLWindow **ret)
{
HTMLWindow *window;
@ -1434,12 +1625,21 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML
if(!window)
return E_OUTOFMEMORY;
window->window_ref = heap_alloc(sizeof(windowref_t));
if(!window->window_ref) {
heap_free(window);
return E_OUTOFMEMORY;
}
window->lpHTMLWindow2Vtbl = &HTMLWindow2Vtbl;
window->lpHTMLWindow3Vtbl = &HTMLWindow3Vtbl;
window->lpIDispatchExVtbl = &WindowDispExVtbl;
window->ref = 1;
window->doc_obj = doc_obj;
window->window_ref->window = window;
window->window_ref->ref = 1;
init_dispex(&window->dispex, (IUnknown*)HTMLWINDOW2(window), &HTMLWindow_dispex);
if(nswindow) {
@ -1447,15 +1647,62 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML
window->nswindow = nswindow;
}
window->scriptmode = SCRIPTMODE_GECKO;
window->scriptmode = parent ? parent->scriptmode : SCRIPTMODE_GECKO;
window->readystate = READYSTATE_UNINITIALIZED;
list_init(&window->script_hosts);
window->task_magic = get_task_target_magic();
update_window_doc(window);
list_init(&window->children);
list_add_head(&window_list, &window->entry);
if(parent) {
IHTMLWindow2_AddRef(HTMLWINDOW2(window));
window->parent = parent;
list_add_tail(&parent->children, &window->sibling_entry);
}
*ret = window;
return S_OK;
}
void update_window_doc(HTMLWindow *window)
{
nsIDOMHTMLDocument *nshtmldoc;
nsIDOMDocument *nsdoc;
nsresult nsres;
nsres = nsIDOMWindow_GetDocument(window->nswindow, &nsdoc);
if(NS_FAILED(nsres) || !nsdoc) {
ERR("GetDocument failed: %08x\n", nsres);
return;
}
nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
nsIDOMDocument_Release(nsdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMHTMLDocument iface: %08x\n", nsres);
return;
}
if(!window->doc || window->doc->nsdoc != nshtmldoc) {
HTMLDocumentNode *doc;
HRESULT hres;
hres = create_doc_from_nsdoc(nshtmldoc, window->doc_obj, window, &doc);
if(SUCCEEDED(hres)) {
window_set_docnode(window, doc);
htmldoc_release(&doc->basedoc);
}else {
ERR("create_doc_from_nsdoc failed: %08x\n", hres);
}
}
nsIDOMHTMLDocument_Release(nshtmldoc);
}
HTMLWindow *nswindow_to_window(const nsIDOMWindow *nswindow)
{
HTMLWindow *iter;

View file

@ -391,9 +391,6 @@ static HRESULT register_server(BOOL do_register)
if(FAILED(hres))
ERR("typelib registration failed: %08x\n", hres);
if(do_register && SUCCEEDED(hres))
load_gecko(TRUE);
return hres;
}
@ -405,7 +402,13 @@ static HRESULT register_server(BOOL do_register)
*/
HRESULT WINAPI DllRegisterServer(void)
{
return register_server(TRUE);
HRESULT hres;
hres = register_server(TRUE);
if(SUCCEEDED(hres))
load_gecko(FALSE);
return hres;
}
/***********************************************************************

View file

@ -3,7 +3,7 @@ Signature="$CHICAGO$"
[RegisterDll]
AddReg=Classes.Reg, Protocols.Reg, IE.Reg, FileAssoc.Reg
AddReg=Classes.Reg, Protocols.Reg, IE.Reg, FileAssoc.Reg, WineGecko.Reg
[UnregisterDll]
@ -270,8 +270,18 @@ HKLM,"Software\Microsoft\Internet Explorer\AboutURLs","mozilla",2,"res://mshtml.
HKLM,"Software\Microsoft\Internet Explorer\Default Behaviors","VML",, "CLSID:10072CEC-8CC1-11D1-986E-00A0C955B42E"
HKLM,"Software\Microsoft\Internet Explorer\Default Behaviors","TIME",, "CLSID:476C391C-3E0D-11D2-B948-00C04FA32195"
[WineGecko.Reg]
HKCU,Software\Wine\MSHTML,"GeckoUrl",,"http://source.winehq.org/winegecko.php"
[FileAssoc.Reg]
;; AVI
HKCR,"MIME\Database\Content Type\video/avi","CLSID",,"{CD3AFA88-B84F-48F0-9393-7EDC34128127}"
HKCR,"MIME\Database\Content Type\video/avi","Extension",,".avi"
HKCR,".avi","Content Type",,"video/avi"
;; BMP
HKCR,"MIME\Database\Content Type\image/bmp","Extension",,".bmp"
HKCR,"MIME\Database\Content Type\image/bmp","Image Filter CLSID",,"%CLSID_IImageDecodeFilter%"
@ -285,6 +295,14 @@ HKCR,".css","Content Type",,"text/css"
;; DIB
HKCR,".dib","Content Type",,"image/bmp"
;; DLL
HKCR,".dll","Content Type",,"application/x-msdownload"
HKCR,".dll",,,"dllfile"
;; EXE
HKCR,".exe","Content Type",,"application/x-msdownload"
HKCR,".exe",,,"exefile"
;; GIF
HKCR,"MIME\Database\Content Type\image/gif","CLSID",,"%CLSID_HTMLDocument%"
HKCR,"MIME\Database\Content Type\image/gif","Extension",,".gif"
@ -300,6 +318,10 @@ HKCR,"giffile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,,"
HKCR,"giffile\shell\open\ddeexec\Topic",,,"WWW_OpenURL"
;; HKCR,"giffile\DefaultIcon",,,"%IEXPLORE%,9"
;; GZIP
HKCR,"MIME\Database\Content Type\application/x-gzip","Extension",,".gz"
HKCR,".gz","Content Type",,"application/x-gzip"
;; HTC
HKCR,"MIME\Database\Content Type\text/x-component","CLSID",,"%CLSID_CHtmlComponentConstructor%"
HKCR,"MIME\Database\Content Type\text/x-component","Extension",,".htc"
@ -321,6 +343,10 @@ HKCR,"htmlfile\CLSID",,,"%CLSID_HTMLDocument%"
HKCR,"htmlfile_FullWindowEmbed",,,"HTML Plugin Document"
HKCR,"htmlfile_FullWindowEmbed\BrowseInPlace",,,""
HKCR,"htmlfile_FullWindowEmbed\CLSID",,,"%CLSID_HTMLPluginDocument%"
HKCR,".htm",,,"htmlfile"
HKCR,".htm","Content Type",,"text/html"
HKCR,".html",,,"htmlfile"
HKCR,".html","Content Type",,"text/html"
;; ICO
HKCR,"MIME\Database\Content Type\image/x-icon","CLSID",,"%CLSID_HTMLDocument%"
@ -375,6 +401,18 @@ HKCR,"mhtmlfile",,,"MHTML Document"
HKCR,"mhtmlfile\BrowseInPlace",,,""
HKCR,"mhtmlfile\CLSID",,,"%CLSID_MHTMLDocument%"
;; MPEG
HKCR,"MIME\Database\Content Type\audio/mpeg","CLSID",,"{CD3AFA76-B84F-48F0-9393-7EDC34128127}"
HKCR,"MIME\Database\Content Type\audio/mpeg","Extension",,".mp3"
HKCR,"MIME\Database\Content Type\audio/mpg","CLSID",,"{CD3AFA76-B84F-48F0-9393-7EDC34128127}"
HKCR,"MIME\Database\Content Type\audio/mpg","Extension",,".mp3"
HKCR,"MIME\Database\Content Type\video/mpeg","CLSID",,"{CD3AFA89-B84F-48F0-9393-7EDC34128127}"
HKCR,"MIME\Database\Content Type\video/mpeg","Extension",,".mpeg"
HKCR,".mp3","Content Type",,"audio/mpeg"
HKCR,".mpe","Content Type",,"video/mpeg"
HKCR,".mpeg","Content Type",,"video/mpeg"
HKCR,".mpg","Content Type",,"video/mpeg"
;; PJPG
HKCR,"MIME\Database\Content Type\image/pjpeg","CLSID",,"%CLSID_HTMLDocument%"
HKCR,"MIME\Database\Content Type\image/pjpeg","Extension",,".jpg"
@ -403,12 +441,37 @@ HKCR,"pngfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,,"
HKCR,"pngfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL"
;; HKCR,"pngfile\DefaultIcon",,,"%IEXPLORE%,9"
;; PS
HKCR,"MIME\Database\Content Type\application/postscript","Extension",,".ps"
HKCR,".ai","Content Type",,"application/postscript"
HKCR,".eps","Content Type",,"application/postscript"
HKCR,".ps","Content Type",,"application/postscript"
;; TAR
HKCR,"MIME\Database\Content Type\application/x-tar","Extension",,".tar"
HKCR,".tar","Content Type",,"application/x-tar"
;; TGZ
HKCR,"MIME\Database\Content Type\application/x-compressed","Extension",,".tgz"
HKCR,".tgz","Content Type",,"application/x-compressed"
;; TIFF
HKCR,"MIME\Database\Content Type\image/tiff","Extension",,".tiff"
HKCR,".tif","Content Type",,"image/tiff"
HKCR,".tiff","Content Type",,"image/tiff"
;; TXT
HKCR,"MIME\Database\Content Type\text/plain","CLSID",,"%CLSID_HTMLDocument%"
HKCR,"MIME\Database\Content Type\text/plain","Extension",,".txt"
HKCR,"MIME\Database\Content Type\text/plain","Encoding",1,07,00,00,00
HKCR,".txt",,,"txtfile"
HKCR,".txt","Content Type",,"text/plain"
;; WAV
HKCR,"MIME\Database\Content Type\audio/wav","CLSID",,"{CD3AFA7B-B84F-48F0-9393-7EDC34128127}"
HKCR,"MIME\Database\Content Type\audio/wav","Extension",,".wav"
HKCR,".wav","Content Type",,"audio/wav"
;; XBM
HKCR,"MIME\Database\Content Type\image/xbm","Extension",,".xbm"
HKCR,"MIME\Database\Content Type\image/x-xbitmap","CLSID",,"%CLSID_HTMLDocument%"
@ -420,3 +483,19 @@ HKCR,"xbmfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,,"
;; HKCR,"xbmfile\shell\open\ddeexec\Application",,,"IExplore"
HKCR,"xbmfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL"
;; HKCR,"xbmfile\DefaultIcon",,,"%IEXPLORE%,9"
;; XML
HKCR,"MIME\Database\Content Type\application/xml","CLSID",,"{48123BC4-99D9-11D1-A6B3-00C04FD91555}"
HKCR,"MIME\Database\Content Type\application/xml","Extension",,".xml"
HKCR,"MIME\Database\Content Type\application/xml","Encoding",1,08,00,00,00
HKCR,"MIME\Database\Content Type\text/xml","CLSID",,"{48123BC4-99D9-11D1-A6B3-00C04FD91555}"
HKCR,"MIME\Database\Content Type\text/xml","Extension",,".xml"
HKCR,"MIME\Database\Content Type\text/xml","Encoding",1,08,00,00,00
HKCR,".xml",,,"xmlfile"
HKCR,".xml","Content Type",,"text/xml"
HKCR,".xsl",,,"xslfile"
HKCR,".xsl","Content Type",,"text/xml"
;; ZIP
HKCR,"MIME\Database\Content Type\application/x-zip-compressed","Extension",,".zip"
HKCR,".zip","Content Type",,"application/x-zip-compressed"

View file

@ -29,6 +29,7 @@
<file>htmlelem3.c</file>
<file>htmlelemcol.c</file>
<file>htmlevent.c</file>
<file>htmlframebase.c</file>
<file>htmlgeneric.c</file>
<file>htmliframe.c</file>
<file>htmlimg.c</file>

View file

@ -101,8 +101,10 @@ typedef enum {
IHTMLElement4_tid,
IHTMLElementCollection_tid,
IHTMLEventObj_tid,
IHTMLFrameBase_tid,
IHTMLFrameBase2_tid,
IHTMLGenericElement_tid,
IHTMLImageElementFactory_tid,
IHTMLImgElement_tid,
IHTMLInputElement_tid,
IHTMLLocation_tid,
@ -155,9 +157,9 @@ void release_dispex(DispatchEx*);
BOOL dispex_query_interface(DispatchEx*,REFIID,void**);
HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**);
typedef struct HTMLWindow HTMLWindow;
typedef struct HTMLDocumentNode HTMLDocumentNode;
typedef struct HTMLDocumentObj HTMLDocumentObj;
typedef struct HTMLFrameBase HTMLFrameBase;
typedef enum {
SCRIPTMODE_GECKO,
@ -166,7 +168,13 @@ typedef enum {
typedef struct ScriptHost ScriptHost;
typedef enum {
GLOBAL_SCRIPTVAR,
GLOBAL_ELEMENTVAR
} global_prop_type_t;
typedef struct {
global_prop_type_t type;
WCHAR *name;
ScriptHost *script_host;
DISPID id;
@ -180,6 +188,15 @@ typedef struct {
HTMLWindow *window;
} HTMLOptionElementFactory;
typedef struct {
DispatchEx dispex;
const IHTMLImageElementFactoryVtbl *lpHTMLImageElementFactoryVtbl;
LONG ref;
HTMLWindow *window;
} HTMLImageElementFactory;
struct HTMLLocation {
DispatchEx dispex;
const IHTMLLocationVtbl *lpHTMLLocationVtbl;
@ -189,6 +206,11 @@ struct HTMLLocation {
HTMLWindow *window;
};
typedef struct {
HTMLWindow *window;
LONG ref;
} windowref_t;
struct HTMLWindow {
DispatchEx dispex;
const IHTMLWindow2Vtbl *lpHTMLWindow2Vtbl;
@ -197,24 +219,36 @@ struct HTMLWindow {
LONG ref;
windowref_t *window_ref;
LONG task_magic;
HTMLDocumentNode *doc;
HTMLDocumentObj *doc_obj;
nsIDOMWindow *nswindow;
HTMLWindow *parent;
HTMLFrameBase *frame_element;
READYSTATE readystate;
nsChannelBSC *bscallback;
IMoniker *mon;
LPOLESTR url;
event_target_t *event_target;
IHTMLEventObj *event;
BOOL *event_vector;
SCRIPTMODE scriptmode;
struct list script_hosts;
HTMLOptionElementFactory *option_factory;
HTMLImageElementFactory *image_factory;
HTMLLocation *location;
global_prop_t *global_props;
DWORD global_prop_cnt;
DWORD global_prop_size;
struct list children;
struct list sibling_entry;
struct list entry;
};
@ -253,6 +287,7 @@ struct HTMLDocument {
const IHTMLDocument3Vtbl *lpHTMLDocument3Vtbl;
const IHTMLDocument4Vtbl *lpHTMLDocument4Vtbl;
const IHTMLDocument5Vtbl *lpHTMLDocument5Vtbl;
const IHTMLDocument6Vtbl *lpHTMLDocument6Vtbl;
const IPersistMonikerVtbl *lpPersistMonikerVtbl;
const IPersistFileVtbl *lpPersistFileVtbl;
const IPersistHistoryVtbl *lpPersistHistoryVtbl;
@ -278,7 +313,8 @@ struct HTMLDocument {
HTMLDocumentNode *doc_node;
HTMLWindow *window;
nsIDOMHTMLDocument *nsdoc;
LONG task_magic;
ConnectionPointContainer cp_container;
ConnectionPoint cp_htmldocevents;
@ -331,30 +367,11 @@ struct HTMLDocumentObj {
BOOL focus;
USERMODE usermode;
READYSTATE readystate;
LPWSTR mime;
DWORD update;
/* FIXME: probably should be in document node object */
nsChannelBSC *bscallback;
IMoniker *mon;
LPOLESTR url;
struct list bindings;
};
typedef struct {
const nsIDOMEventListenerVtbl *lpDOMEventListenerVtbl;
NSContainer *This;
} nsEventListener;
typedef struct _mutation_queue_t {
DWORD type;
nsISupports *nsiface;
struct _mutation_queue_t *next;
} mutation_queue_t;
struct NSContainer {
const nsIWebBrowserChromeVtbl *lpWebBrowserChromeVtbl;
const nsIContextMenuListenerVtbl *lpContextMenuListenerVtbl;
@ -365,16 +382,6 @@ struct NSContainer {
const nsIWeakReferenceVtbl *lpWeakReferenceVtbl;
const nsISupportsWeakReferenceVtbl *lpSupportsWeakReferenceVtbl;
const nsIDocumentObserverVtbl *lpDocumentObserverVtbl;
const nsIRunnableVtbl *lpRunnableVtbl;
nsEventListener blur_listener;
nsEventListener focus_listener;
nsEventListener keypress_listener;
nsEventListener load_listener;
nsEventListener htmlevent_listener;
nsIWebBrowser *webbrowser;
nsIWebNavigation *navigation;
nsIBaseWindow *window;
@ -392,9 +399,6 @@ struct NSContainer {
HWND hwnd;
mutation_queue_t *mutation_queue;
mutation_queue_t *mutation_queue_tail;
nsChannelBSC *bscallback; /* hack */
HWND reset_focus; /* hack */
};
@ -425,6 +429,7 @@ typedef struct {
HRESULT (*qi)(HTMLDOMNode*,REFIID,void**);
void (*destructor)(HTMLDOMNode*);
event_target_t **(*get_event_target)(HTMLDOMNode*);
HRESULT (*call_event)(HTMLDOMNode*,DWORD,BOOL*);
HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
} NodeImplVtbl;
@ -463,18 +468,46 @@ typedef struct {
ConnectionPoint cp;
} HTMLTextContainer;
struct HTMLFrameBase {
HTMLElement element;
const IHTMLFrameBaseVtbl *lpIHTMLFrameBaseVtbl;
HTMLWindow *content_window;
};
typedef struct _mutation_queue_t {
DWORD type;
nsISupports *nsiface;
struct _mutation_queue_t *next;
} mutation_queue_t;
typedef struct nsDocumentEventListener nsDocumentEventListener;
struct HTMLDocumentNode {
HTMLDOMNode node;
HTMLDocument basedoc;
const IInternetHostSecurityManagerVtbl *lpIInternetHostSecurityManagerVtbl;
const nsIDocumentObserverVtbl *lpIDocumentObserverVtbl;
const nsIRunnableVtbl *lpIRunnableVtbl;
LONG ref;
nsIDOMHTMLDocument *nsdoc;
HTMLDOMNode *nodes;
BOOL content_ready;
IInternetSecurityManager *secmgr;
nsDocumentEventListener *nsevent_listener;
BOOL *event_vector;
mutation_queue_t *mutation_queue;
mutation_queue_t *mutation_queue_tail;
struct list bindings;
struct list selection_list;
struct list range_list;
};
@ -486,6 +519,7 @@ struct HTMLDocumentNode {
#define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
#define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
#define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
#define HTMLDOC6(x) ((IHTMLDocument6*) &(x)->lpHTMLDocument6Vtbl)
#define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
#define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
#define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
@ -518,9 +552,9 @@ struct HTMLDocumentNode {
#define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
#define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
#define NSDOCOBS(x) ((nsIDocumentObserver*) &(x)->lpDocumentObserverVtbl)
#define NSDOCOBS(x) ((nsIDocumentObserver*) &(x)->lpIDocumentObserverVtbl)
#define NSRUNNABLE(x) ((nsIRunnable*) &(x)->lpRunnableVtbl)
#define NSRUNNABLE(x) ((nsIRunnable*) &(x)->lpIRunnableVtbl)
#define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
#define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
@ -538,8 +572,10 @@ struct HTMLDocumentNode {
#define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
#define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
#define HTMLFRAMEBASE(x) ((IHTMLFrameBase*) &(x)->lpIHTMLFrameBaseVtbl)
#define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
#define HTMLIMGFACTORY(x) ((IHTMLImageElementFactory*) &(x)->lpHTMLImageElementFactoryVtbl)
#define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
#define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
@ -555,10 +591,12 @@ HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**);
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLWindow*,HTMLDocumentNode**);
HRESULT HTMLWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLWindow**);
void window_set_docnode(HTMLWindow*,HTMLDocumentNode*);
HRESULT HTMLWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLWindow*,HTMLWindow**);
void update_window_doc(HTMLWindow*);
HTMLWindow *nswindow_to_window(const nsIDOMWindow*);
nsIDOMWindow *get_nsdoc_window(nsIDOMDocument*);
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow*);
HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow*);
HRESULT HTMLLocation_Create(HTMLWindow*,HTMLLocation**);
IOmNavigator *OmNavigator_Create(void);
@ -583,9 +621,8 @@ void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
NSContainer *NSContainer_Create(HTMLDocumentObj*,NSContainer*);
void NSContainer_Release(NSContainer*);
void init_mutation(NSContainer*);
void set_mutation_observer(NSContainer*,nsIDOMHTMLDocument*);
void remove_mutation_observer(NSContainer*,nsIDOMHTMLDocument*);
void init_mutation(HTMLDocumentNode*);
void release_mutation(HTMLDocumentNode*);
void HTMLDocument_LockContainer(HTMLDocumentObj*,BOOL);
void show_context_menu(HTMLDocumentObj*,DWORD,POINT*,IDispatch*);
@ -606,7 +643,8 @@ BOOL install_wine_gecko(BOOL);
HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*);
void hlink_frame_navigate(HTMLDocument*,IHlinkFrame*,LPCWSTR,nsIInputStream*,DWORD);
HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsIInputStream*,DWORD);
HRESULT navigate_url(HTMLDocumentNode*,OLECHAR*);
void call_property_onchanged(ConnectionPoint*,DISPID);
HRESULT call_set_active_object(IOleInPlaceUIWindow*,IOleInPlaceActiveObject*);
@ -627,22 +665,26 @@ void nsAString_Finish(nsAString*);
nsICommandParams *create_nscommand_params(void);
HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*);
void get_editor_controller(NSContainer*);
void init_nsevents(NSContainer*);
void add_nsevent_listener(HTMLWindow*,LPCWSTR);
nsresult get_nsinterface(nsISupports*,REFIID,void**);
void update_nsdocument(HTMLDocumentObj*);
void set_document_bscallback(HTMLDocument*,nsChannelBSC*);
void set_current_mon(HTMLDocument*,IMoniker*);
HRESULT start_binding(HTMLDocument*,BSCallback*,IBindCtx*);
void init_nsevents(HTMLDocumentNode*);
void release_nsevents(HTMLDocumentNode*);
void add_nsevent_listener(HTMLDocumentNode*,LPCWSTR);
HRESULT bind_mon_to_buffer(HTMLDocument*,IMoniker*,void**,DWORD*);
void set_window_bscallback(HTMLWindow*,nsChannelBSC*);
void set_current_mon(HTMLWindow*,IMoniker*);
HRESULT start_binding(HTMLWindow*,HTMLDocumentNode*,BSCallback*,IBindCtx*);
void abort_document_bindings(HTMLDocumentNode*);
HRESULT bind_mon_to_buffer(HTMLDocumentNode*,IMoniker*,void**,DWORD*);
nsChannelBSC *create_channelbsc(IMoniker*);
HRESULT channelbsc_load_stream(nsChannelBSC*,IStream*);
void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*);
IMoniker *get_channelbsc_mon(nsChannelBSC*);
void set_ready_state(HTMLWindow*,READYSTATE);
HRESULT HTMLSelectionObject_Create(HTMLDocumentNode*,nsISelection*,IHTMLSelectionObject**);
HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**);
IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration*);
@ -653,28 +695,32 @@ void detach_selection(HTMLDocumentNode*);
void detach_ranges(HTMLDocumentNode*);
HRESULT get_node_text(HTMLDOMNode*,BSTR*);
HRESULT create_nselem(HTMLDocumentNode*,const WCHAR*,nsIDOMHTMLElement**);
HTMLDOMNode *HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*);
HTMLElement *HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL);
HTMLElement *HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*);
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLAnchorElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLBodyElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLFrameElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLWindow*);
HTMLElement *HTMLIFrame_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLWindow*);
HTMLElement *HTMLImgElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLInputElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLOptionElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLSelectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLTable_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLTableRow_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLTextAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLGenericElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*);
void HTMLElement_Init(HTMLElement*,dispex_static_data_t*);
void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*);
void HTMLElement2_Init(HTMLElement*);
void HTMLElement3_Init(HTMLElement*);
void HTMLTextContainer_Init(HTMLTextContainer*,dispex_static_data_t*);
void HTMLTextContainer_Init(HTMLTextContainer*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*);
void HTMLFrameBase_Init(HTMLFrameBase*,HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLWindow*,dispex_static_data_t*);
HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**);
void HTMLDOMNode_destructor(HTMLDOMNode*);
@ -682,6 +728,9 @@ void HTMLDOMNode_destructor(HTMLDOMNode*);
HRESULT HTMLElement_QI(HTMLDOMNode*,REFIID,void**);
void HTMLElement_destructor(HTMLDOMNode*);
HRESULT HTMLFrameBase_QI(HTMLFrameBase*,REFIID,void**);
void HTMLFrameBase_destructor(HTMLFrameBase*);
HTMLDOMNode *get_node(HTMLDocumentNode*,nsIDOMNode*,BOOL);
void release_nodes(HTMLDocumentNode*);
@ -728,20 +777,19 @@ void set_dirty(HTMLDocument*,VARIANT_BOOL);
extern DWORD mshtml_tls;
typedef struct task_t {
HTMLDocument *doc;
enum {
TASK_SETDOWNLOADSTATE,
TASK_PARSECOMPLETE,
TASK_SETPROGRESS,
TASK_START_BINDING
} task_id;
nsChannelBSC *bscallback;
typedef struct task_t task_t;
typedef void (*task_proc_t)(task_t*);
struct task_t {
LONG target_magic;
task_proc_t proc;
struct task_t *next;
} task_t;
};
typedef struct {
task_t header;
HTMLDocumentObj *doc;
} docobj_task_t;
typedef struct {
HWND thread_hwnd;
@ -752,8 +800,11 @@ typedef struct {
thread_data_t *get_thread_data(BOOL);
HWND get_thread_hwnd(void);
void push_task(task_t*);
void remove_doc_tasks(const HTMLDocument*);
LONG get_task_target_magic(void);
void push_task(task_t*,task_proc_t,LONG);
void remove_target_tasks(LONG);
DWORD set_task_timer(HTMLDocument*,DWORD,BOOL,IDispatch*);
HRESULT clear_task_timer(HTMLDocument*,BOOL,DWORD);
@ -855,6 +906,17 @@ static inline char *heap_strdupWtoA(LPCWSTR str)
return ret;
}
static inline void windowref_addref(windowref_t *ref)
{
InterlockedIncrement(&ref->ref);
}
static inline void windowref_release(windowref_t *ref)
{
if(!InterlockedDecrement(&ref->ref))
heap_free(ref);
}
HINSTANCE get_shdoclc(void);
extern HINSTANCE hInst;

View file

@ -27,6 +27,7 @@
#include "winuser.h"
#include "winreg.h"
#include "ole2.h"
#include "shlguid.h"
#include "mshtml_private.h"
#include "htmlevent.h"
@ -37,43 +38,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
enum {
MUTATION_COMMENT,
MUTATION_ENDLOAD,
MUTATION_FRAME,
MUTATION_IFRAME,
MUTATION_SCRIPT
};
void set_mutation_observer(NSContainer *nscontainer, nsIDOMHTMLDocument *nshtmldoc)
{
nsIDOMNSDocument *nsdoc;
nsresult nsres;
nsres = nsIDOMHTMLDocument_QueryInterface(nshtmldoc, &IID_nsIDOMNSDocument, (void**)&nsdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMNSDocument: %08x\n", nsres);
return;
}
nsIDOMNSDocument_WineAddObserver(nsdoc, NSDOCOBS(nscontainer));
nsIDOMNSDocument_Release(nsdoc);
}
void remove_mutation_observer(NSContainer *nscontainer, nsIDOMHTMLDocument *nshtmldoc)
{
nsIDOMNSDocument *nsdoc;
nsresult nsres;
nsres = nsIDOMHTMLDocument_QueryInterface(nshtmldoc, &IID_nsIDOMNSDocument, (void**)&nsdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMNSDocument: %08x\n", nsres);
return;
}
nsIDOMNSDocument_WineRemoveObserver(nsdoc, NSDOCOBS(nscontainer));
nsIDOMNSDocument_Release(nsdoc);
}
#define IE_MAJOR_VERSION 7
#define IE_MINOR_VERSION 0
static BOOL handle_insert_comment(HTMLDocument *doc, const PRUnichar *comment)
static BOOL handle_insert_comment(HTMLDocumentNode *doc, const PRUnichar *comment)
{
DWORD len;
int majorv = 0, minorv = 0;
@ -209,12 +183,12 @@ static BOOL handle_insert_comment(HTMLDocument *doc, const PRUnichar *comment)
return TRUE;
}
static void add_script_runner(NSContainer *This)
static void add_script_runner(HTMLDocumentNode *This)
{
nsIDOMNSDocument *nsdoc;
nsresult nsres;
nsres = nsIDOMHTMLDocument_QueryInterface(This->doc->basedoc.nsdoc, &IID_nsIDOMNSDocument, (void**)&nsdoc);
nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNSDocument, (void**)&nsdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMNSDocument: %08x\n", nsres);
return;
@ -224,12 +198,12 @@ static void add_script_runner(NSContainer *This)
nsIDOMNSDocument_Release(nsdoc);
}
#define NSRUNNABLE_THIS(iface) DEFINE_THIS(NSContainer, Runnable, iface)
#define NSRUNNABLE_THIS(iface) DEFINE_THIS(HTMLDocumentNode, IRunnable, iface)
static nsresult NSAPI nsRunnable_QueryInterface(nsIRunnable *iface,
nsIIDRef riid, nsQIResult result)
{
NSContainer *This = NSRUNNABLE_THIS(iface);
HTMLDocumentNode *This = NSRUNNABLE_THIS(iface);
if(IsEqualGUID(riid, &IID_nsISupports)) {
TRACE("(%p)->(IID_nsISupports %p)\n", This, result);
@ -249,34 +223,203 @@ static nsresult NSAPI nsRunnable_QueryInterface(nsIRunnable *iface,
static nsrefcnt NSAPI nsRunnable_AddRef(nsIRunnable *iface)
{
NSContainer *This = NSRUNNABLE_THIS(iface);
return nsIWebBrowserChrome_AddRef(NSWBCHROME(This));
HTMLDocumentNode *This = NSRUNNABLE_THIS(iface);
return htmldoc_addref(&This->basedoc);
}
static nsrefcnt NSAPI nsRunnable_Release(nsIRunnable *iface)
{
NSContainer *This = NSRUNNABLE_THIS(iface);
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
HTMLDocumentNode *This = NSRUNNABLE_THIS(iface);
return htmldoc_release(&This->basedoc);
}
static void pop_mutation_queue(NSContainer *nscontainer)
static void push_mutation_queue(HTMLDocumentNode *doc, DWORD type, nsISupports *nsiface)
{
mutation_queue_t *tmp = nscontainer->mutation_queue;
mutation_queue_t *elem;
elem = heap_alloc(sizeof(mutation_queue_t));
if(!elem)
return;
elem->next = NULL;
elem->type = type;
elem->nsiface = nsiface;
if(nsiface)
nsISupports_AddRef(nsiface);
if(doc->mutation_queue_tail) {
doc->mutation_queue_tail = doc->mutation_queue_tail->next = elem;
}else {
doc->mutation_queue = doc->mutation_queue_tail = elem;
add_script_runner(doc);
}
}
static void pop_mutation_queue(HTMLDocumentNode *doc)
{
mutation_queue_t *tmp = doc->mutation_queue;
if(!tmp)
return;
nscontainer->mutation_queue = tmp->next;
doc->mutation_queue = tmp->next;
if(!tmp->next)
nscontainer->mutation_queue_tail = NULL;
doc->mutation_queue_tail = NULL;
nsISupports_Release(tmp->nsiface);
if(tmp->nsiface)
nsISupports_Release(tmp->nsiface);
heap_free(tmp);
}
static nsresult init_nsdoc_window(HTMLDocumentNode *doc, nsIDOMDocument *nsdoc, HTMLWindow **ret)
{
nsIDOMWindow *nswindow;
nswindow = get_nsdoc_window(nsdoc);
if(!nswindow)
return NS_ERROR_FAILURE;
if(!nswindow_to_window(nswindow)) {
HTMLWindow *window;
HRESULT hres;
hres = HTMLWindow_Create(doc->basedoc.doc_obj, nswindow, doc->basedoc.window, &window);
if(SUCCEEDED(hres))
*ret = window;
}
nsIDOMWindow_Release(nswindow);
return NS_OK;
}
static nsresult init_iframe_window(HTMLDocumentNode *doc, nsISupports *nsunk)
{
nsIDOMHTMLIFrameElement *nsiframe;
HTMLWindow *window = NULL;
nsIDOMDocument *nsdoc;
nsresult nsres;
nsres = nsISupports_QueryInterface(nsunk, &IID_nsIDOMHTMLIFrameElement, (void**)&nsiframe);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMHTMLIFrameElement: %08x\n", nsres);
return nsres;
}
nsres = nsIDOMHTMLIFrameElement_GetContentDocument(nsiframe, &nsdoc);
nsIDOMHTMLIFrameElement_Release(nsiframe);
if(NS_FAILED(nsres) || !nsdoc) {
ERR("GetContentDocument failed: %08x\n", nsres);
return nsres;
}
nsres = init_nsdoc_window(doc, nsdoc, &window);
if(window) {
HTMLIFrame_Create(doc, (nsIDOMHTMLElement*)nsiframe, window);
IHTMLWindow2_Release(HTMLWINDOW2(window));
}
nsIDOMDocument_Release(nsdoc);
return nsres;
}
static nsresult init_frame_window(HTMLDocumentNode *doc, nsISupports *nsunk)
{
nsIDOMHTMLFrameElement *nsframe;
HTMLWindow *window = NULL;
nsIDOMDocument *nsdoc;
nsresult nsres;
nsres = nsISupports_QueryInterface(nsunk, &IID_nsIDOMHTMLFrameElement, (void**)&nsframe);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMHTMLFrameElement: %08x\n", nsres);
return nsres;
}
nsres = nsIDOMHTMLFrameElement_GetContentDocument(nsframe, &nsdoc);
nsIDOMHTMLFrameElement_Release(nsframe);
if(NS_FAILED(nsres) || !nsdoc) {
ERR("GetContentDocument failed: %08x\n", nsres);
return nsres;
}
nsres = init_nsdoc_window(doc, nsdoc, &window);
if(window) {
HTMLFrameElement_Create(doc, (nsIDOMHTMLElement*)nsframe, window);
IHTMLWindow2_Release(HTMLWINDOW2(window));
}
nsIDOMDocument_Release(nsdoc);
return nsres;
}
/* Calls undocumented 69 cmd of CGID_Explorer */
static void call_explorer_69(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd;
VARIANT var;
HRESULT hres;
if(!doc->client)
return;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(FAILED(hres))
return;
VariantInit(&var);
hres = IOleCommandTarget_Exec(olecmd, &CGID_Explorer, 69, 0, NULL, &var);
IOleCommandTarget_Release(olecmd);
if(SUCCEEDED(hres) && V_VT(&var) != VT_NULL)
FIXME("handle result\n");
}
static void parse_complete_proc(task_t *task)
{
HTMLDocumentObj *doc = ((docobj_task_t*)task)->doc;
TRACE("(%p)\n", doc);
if(doc->usermode == EDITMODE)
init_editor(&doc->basedoc);
call_explorer_69(doc);
call_property_onchanged(&doc->basedoc.cp_propnotif, 1005);
call_explorer_69(doc);
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
set_ready_state(doc->basedoc.window, READYSTATE_INTERACTIVE);
}
static void handle_end_load(HTMLDocumentNode *This)
{
docobj_task_t *task;
TRACE("\n");
if(This != This->basedoc.doc_obj->basedoc.doc_node) {
set_ready_state(This->basedoc.window, READYSTATE_INTERACTIVE);
return;
}
task = heap_alloc(sizeof(docobj_task_t));
if(!task)
return;
task->doc = This->basedoc.doc_obj;
/*
* This should be done in the worker thread that parses HTML,
* but we don't have such thread (Gecko parses HTML for us).
*/
push_task(&task->header, &parse_complete_proc, This->basedoc.doc_obj->basedoc.task_magic);
}
static nsresult NSAPI nsRunnable_Run(nsIRunnable *iface)
{
NSContainer *This = NSRUNNABLE_THIS(iface);
HTMLDocumentNode *This = NSRUNNABLE_THIS(iface);
nsresult nsres;
TRACE("(%p)\n", This);
@ -300,7 +443,7 @@ static nsresult NSAPI nsRunnable_Run(nsIRunnable *iface)
const PRUnichar *comment;
nsAString_GetData(&comment_str, &comment);
remove_comment = handle_insert_comment(&This->doc->basedoc, comment);
remove_comment = handle_insert_comment(This, comment);
}
nsAString_Finish(&comment_str);
@ -330,6 +473,18 @@ static nsresult NSAPI nsRunnable_Run(nsIRunnable *iface)
break;
}
case MUTATION_ENDLOAD:
handle_end_load(This);
break;
case MUTATION_FRAME:
init_frame_window(This, This->mutation_queue->nsiface);
break;
case MUTATION_IFRAME:
init_iframe_window(This, This->mutation_queue->nsiface);
break;
case MUTATION_SCRIPT: {
nsIDOMHTMLScriptElement *nsscript;
@ -340,7 +495,7 @@ static nsresult NSAPI nsRunnable_Run(nsIRunnable *iface)
break;
}
doc_insert_script(This->doc->basedoc.window, nsscript);
doc_insert_script(This->basedoc.window, nsscript);
nsIDOMHTMLScriptElement_Release(nsscript);
break;
}
@ -364,12 +519,12 @@ static const nsIRunnableVtbl nsRunnableVtbl = {
nsRunnable_Run
};
#define NSDOCOBS_THIS(iface) DEFINE_THIS(NSContainer, DocumentObserver, iface)
#define NSDOCOBS_THIS(iface) DEFINE_THIS(HTMLDocumentNode, IDocumentObserver, iface)
static nsresult NSAPI nsDocumentObserver_QueryInterface(nsIDocumentObserver *iface,
nsIIDRef riid, nsQIResult result)
{
NSContainer *This = NSDOCOBS_THIS(iface);
HTMLDocumentNode *This = NSDOCOBS_THIS(iface);
if(IsEqualGUID(&IID_nsISupports, riid)) {
TRACE("(%p)->(IID_nsISupports, %p)\n", This, result);
@ -386,20 +541,20 @@ static nsresult NSAPI nsDocumentObserver_QueryInterface(nsIDocumentObserver *ifa
return NS_NOINTERFACE;
}
nsIWebBrowserChrome_AddRef(NSWBCHROME(This));
htmldoc_addref(&This->basedoc);
return NS_OK;
}
static nsrefcnt NSAPI nsDocumentObserver_AddRef(nsIDocumentObserver *iface)
{
NSContainer *This = NSDOCOBS_THIS(iface);
return nsIWebBrowserChrome_AddRef(NSWBCHROME(This));
HTMLDocumentNode *This = NSDOCOBS_THIS(iface);
return htmldoc_addref(&This->basedoc);
}
static nsrefcnt NSAPI nsDocumentObserver_Release(nsIDocumentObserver *iface)
{
NSContainer *This = NSDOCOBS_THIS(iface);
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
HTMLDocumentNode *This = NSDOCOBS_THIS(iface);
return htmldoc_release(&This->basedoc);
}
static void NSAPI nsDocumentObserver_CharacterDataWillChange(nsIDocumentObserver *iface,
@ -461,22 +616,12 @@ static void NSAPI nsDocumentObserver_BeginLoad(nsIDocumentObserver *iface, nsIDo
static void NSAPI nsDocumentObserver_EndLoad(nsIDocumentObserver *iface, nsIDocument *aDocument)
{
NSContainer *This = NSDOCOBS_THIS(iface);
task_t *task;
HTMLDocumentNode *This = NSDOCOBS_THIS(iface);
TRACE("\n");
task = heap_alloc(sizeof(task_t));
task->doc = &This->doc->basedoc;
task->task_id = TASK_PARSECOMPLETE;
task->next = NULL;
/*
* This should be done in the worker thread that parses HTML,
* but we don't have such thread (Gecko parses HTML for us).
*/
push_task(task);
This->content_ready = TRUE;
push_mutation_queue(This, MUTATION_ENDLOAD, NULL);
}
static void NSAPI nsDocumentObserver_ContentStatesChanged(nsIDocumentObserver *iface, nsIDocument *aDocument,
@ -514,29 +659,12 @@ static void NSAPI nsDocumentObserver_StyleRuleRemoved(nsIDocumentObserver *iface
{
}
static void push_mutation_queue(NSContainer *nscontainer, DWORD type, nsISupports *nsiface)
{
mutation_queue_t *elem;
elem = heap_alloc(sizeof(mutation_queue_t));
if(!elem)
return;
elem->next = NULL;
elem->type = type;
elem->nsiface = nsiface;
nsISupports_AddRef(nsiface);
if(nscontainer->mutation_queue_tail)
nscontainer->mutation_queue_tail = nscontainer->mutation_queue_tail->next = elem;
else
nscontainer->mutation_queue = nscontainer->mutation_queue_tail = elem;
}
static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface, nsIDocument *aDocument,
nsIContent *aContent)
{
NSContainer *This = NSDOCOBS_THIS(iface);
HTMLDocumentNode *This = NSDOCOBS_THIS(iface);
nsIDOMHTMLIFrameElement *nsiframe;
nsIDOMHTMLFrameElement *nsframe;
nsIDOMComment *nscomment;
nsIDOMElement *nselem;
nsresult nsres;
@ -545,7 +673,7 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
nsres = nsISupports_QueryInterface(aContent, &IID_nsIDOMElement, (void**)&nselem);
if(NS_SUCCEEDED(nsres)) {
check_event_attr(This->doc->basedoc.doc_node, nselem);
check_event_attr(This, nselem);
nsIDOMElement_Release(nselem);
}
@ -555,14 +683,29 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
push_mutation_queue(This, MUTATION_COMMENT, (nsISupports*)nscomment);
nsIDOMComment_Release(nscomment);
add_script_runner(This);
}
nsres = nsISupports_QueryInterface(aContent, &IID_nsIDOMHTMLIFrameElement, (void**)&nsiframe);
if(NS_SUCCEEDED(nsres)) {
TRACE("iframe node\n");
push_mutation_queue(This, MUTATION_IFRAME, (nsISupports*)nsiframe);
nsIDOMHTMLIFrameElement_Release(nsiframe);
}
nsres = nsISupports_QueryInterface(aContent, &IID_nsIDOMHTMLFrameElement, (void**)&nsframe);
if(NS_SUCCEEDED(nsres)) {
TRACE("frame node\n");
push_mutation_queue(This, MUTATION_FRAME, (nsISupports*)nsframe);
nsIDOMHTMLFrameElement_Release(nsframe);
}
}
static void NSAPI nsDocumentObserver_DoneAddingChildren(nsIDocumentObserver *iface, nsIContent *aContent,
PRBool aHaveNotified)
{
NSContainer *This = NSDOCOBS_THIS(iface);
HTMLDocumentNode *This = NSDOCOBS_THIS(iface);
nsIDOMHTMLScriptElement *nsscript;
nsresult nsres;
@ -570,9 +713,10 @@ static void NSAPI nsDocumentObserver_DoneAddingChildren(nsIDocumentObserver *ifa
nsres = nsISupports_QueryInterface(aContent, &IID_nsIDOMHTMLScriptElement, (void**)&nsscript);
if(NS_SUCCEEDED(nsres)) {
TRACE("script node\n");
push_mutation_queue(This, MUTATION_SCRIPT, (nsISupports*)nsscript);
nsIDOMHTMLScriptElement_Release(nsscript);
add_script_runner(This);
}
}
@ -606,8 +750,35 @@ static const nsIDocumentObserverVtbl nsDocumentObserverVtbl = {
nsDocumentObserver_DoneAddingChildren
};
void init_mutation(NSContainer *nscontainer)
void init_mutation(HTMLDocumentNode *doc)
{
nscontainer->lpDocumentObserverVtbl = &nsDocumentObserverVtbl;
nscontainer->lpRunnableVtbl = &nsRunnableVtbl;
nsIDOMNSDocument *nsdoc;
nsresult nsres;
doc->lpIDocumentObserverVtbl = &nsDocumentObserverVtbl;
doc->lpIRunnableVtbl = &nsRunnableVtbl;
nsres = nsIDOMHTMLDocument_QueryInterface(doc->nsdoc, &IID_nsIDOMNSDocument, (void**)&nsdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMNSDocument: %08x\n", nsres);
return;
}
nsIDOMNSDocument_WineAddObserver(nsdoc, NSDOCOBS(doc));
nsIDOMNSDocument_Release(nsdoc);
}
void release_mutation(HTMLDocumentNode *doc)
{
nsIDOMNSDocument *nsdoc;
nsresult nsres;
nsres = nsIDOMHTMLDocument_QueryInterface(doc->nsdoc, &IID_nsIDOMNSDocument, (void**)&nsdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMNSDocument: %08x\n", nsres);
return;
}
nsIDOMNSDocument_WineRemoveObserver(nsdoc, NSDOCOBS(doc));
nsIDOMNSDocument_Release(nsdoc);
}

View file

@ -41,6 +41,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define CONTENT_LENGTH "Content-Length"
#define UTF16_STR "utf-16"
static WCHAR emptyW[] = {0};
typedef struct {
const nsIInputStreamVtbl *lpInputStreamVtbl;
@ -82,7 +84,7 @@ struct BSCallback {
IMoniker *mon;
IBinding *binding;
HTMLDocument *doc;
HTMLDocumentNode *doc;
struct list entry;
};
@ -313,7 +315,7 @@ static HRESULT WINAPI BindStatusCallback_OnStartBinding(IBindStatusCallback *ifa
This->binding = pbind;
if(This->doc)
list_add_head(&This->doc->doc_obj->bindings, &This->entry);
list_add_head(&This->doc->bindings, &This->entry);
return This->vtbl->start_binding(This);
}
@ -705,7 +707,7 @@ static void parse_post_data(nsIInputStream *post_data_stream, LPWSTR *headers_re
*post_data_len_ret = post_data_len;
}
HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback, IBindCtx *bctx)
HRESULT start_binding(HTMLWindow *window, HTMLDocumentNode *doc, BSCallback *bscallback, IBindCtx *bctx)
{
IStream *str = NULL;
HRESULT hres;
@ -714,7 +716,8 @@ HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback, IBindCtx *bctx)
/* NOTE: IE7 calls IsSystemMoniker here*/
call_docview_84(doc->doc_obj);
if(window)
call_docview_84(window->doc_obj);
if(bctx) {
RegisterBindStatusCallback(bctx, STATUSCLB(bscallback), NULL, 0);
@ -846,14 +849,14 @@ static BufferBSC *create_bufferbsc(IMoniker *mon)
return ret;
}
HRESULT bind_mon_to_buffer(HTMLDocument *doc, IMoniker *mon, void **buf, DWORD *size)
HRESULT bind_mon_to_buffer(HTMLDocumentNode *doc, IMoniker *mon, void **buf, DWORD *size)
{
BufferBSC *bsc = create_bufferbsc(mon);
HRESULT hres;
*buf = NULL;
hres = start_binding(doc, &bsc->bsc, NULL);
hres = start_binding(NULL, doc, &bsc->bsc, NULL);
if(SUCCEEDED(hres)) {
hres = bsc->hres;
if(SUCCEEDED(hres)) {
@ -872,6 +875,8 @@ HRESULT bind_mon_to_buffer(HTMLDocument *doc, IMoniker *mon, void **buf, DWORD *
struct nsChannelBSC {
BSCallback bsc;
HTMLWindow *window;
nsChannel *nschannel;
nsIStreamListener *nslistener;
nsISupports *nscontext;
@ -948,11 +953,8 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
on_start_nsrequest(This);
/* events are reset when a new document URI is loaded, so re-initialise them here */
if(This->bsc.doc && This->bsc.doc->doc_obj->bscallback == This && This->bsc.doc->doc_obj->nscontainer) {
update_nsdocument(This->bsc.doc->doc_obj);
init_nsevents(This->bsc.doc->doc_obj->nscontainer);
}
if(This->window)
update_window_doc(This->window);
}
This->bsc.readed += This->nsstream->buf_size;
@ -1105,41 +1107,52 @@ IMoniker *get_channelbsc_mon(nsChannelBSC *This)
return This->bsc.mon;
}
void set_document_bscallback(HTMLDocument *doc, nsChannelBSC *callback)
void set_window_bscallback(HTMLWindow *window, nsChannelBSC *callback)
{
if(window->bscallback) {
if(window->bscallback->bsc.binding)
IBinding_Abort(window->bscallback->bsc.binding);
window->bscallback->bsc.doc = NULL;
window->bscallback->window = NULL;
IBindStatusCallback_Release(STATUSCLB(&window->bscallback->bsc));
}
window->bscallback = callback;
if(callback) {
callback->window = window;
IBindStatusCallback_AddRef(STATUSCLB(&callback->bsc));
callback->bsc.doc = window->doc;
}
}
void abort_document_bindings(HTMLDocumentNode *doc)
{
BSCallback *iter;
if(doc->doc_obj->bscallback) {
if(doc->doc_obj->bscallback->bsc.binding)
IBinding_Abort(doc->doc_obj->bscallback->bsc.binding);
doc->doc_obj->bscallback->bsc.doc = NULL;
IBindStatusCallback_Release(STATUSCLB(&doc->doc_obj->bscallback->bsc));
}
LIST_FOR_EACH_ENTRY(iter, &doc->doc_obj->bindings, BSCallback, entry) {
LIST_FOR_EACH_ENTRY(iter, &doc->bindings, BSCallback, entry) {
if(iter->binding)
IBinding_Abort(iter->binding);
iter->doc = NULL;
list_remove(&iter->entry);
}
doc->doc_obj->bscallback = callback;
if(callback) {
IBindStatusCallback_AddRef(STATUSCLB(&callback->bsc));
callback->bsc.doc = doc;
}
}
HRESULT channelbsc_load_stream(nsChannelBSC *bscallback, IStream *stream)
{
HRESULT hres;
const char text_html[] = "text/html";
if(!bscallback->nschannel) {
ERR("NULL nschannel\n");
return E_FAIL;
}
bscallback->nschannel->content_type = heap_strdupA("text/html");
if(!bscallback->nschannel->content_type)
return E_OUTOFMEMORY;
add_nsrequest(bscallback);
if(bscallback->nschannel)
bscallback->nschannel->content_type = heap_strdupA(text_html);
hres = read_stream_data(bscallback, stream);
IBindStatusCallback_OnStopBinding(STATUSCLB(&bscallback->bsc), hres, ERROR_SUCCESS);
@ -1160,14 +1173,27 @@ void channelbsc_set_channel(nsChannelBSC *This, nsChannel *channel, nsIStreamLis
}
}
void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame,
LPCWSTR uri, nsIInputStream *post_data_stream, DWORD hlnf)
HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url,
nsIInputStream *post_data_stream, DWORD hlnf)
{
IHlinkFrame *hlink_frame;
IServiceProvider *sp;
BSCallback *callback;
IBindCtx *bindctx;
IMoniker *mon;
IHlink *hlink;
HRESULT hr;
HRESULT hres;
hres = IOleClientSite_QueryInterface(doc->doc_obj->client, &IID_IServiceProvider,
(void**)&sp);
if(FAILED(hres))
return hres;
hres = IServiceProvider_QueryService(sp, &IID_IHlinkFrame, &IID_IHlinkFrame,
(void**)&hlink_frame);
IServiceProvider_Release(sp);
if(FAILED(hres))
return hres;
callback = &create_channelbsc(NULL)->bsc;
@ -1178,33 +1204,52 @@ void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame,
debugstr_an(callback->post_data, callback->post_data_len));
}
hr = CreateAsyncBindCtx(0, STATUSCLB(callback), NULL, &bindctx);
if (FAILED(hr)) {
IBindStatusCallback_Release(STATUSCLB(callback));
return;
}
hres = CreateAsyncBindCtx(0, STATUSCLB(callback), NULL, &bindctx);
if(SUCCEEDED(hres))
hres = CoCreateInstance(&CLSID_StdHlink, NULL, CLSCTX_INPROC_SERVER,
&IID_IHlink, (LPVOID*)&hlink);
hr = CoCreateInstance(&CLSID_StdHlink, NULL, CLSCTX_INPROC_SERVER, &IID_IHlink, (LPVOID*)&hlink);
if (FAILED(hr)) {
IBindCtx_Release(bindctx);
IBindStatusCallback_Release(STATUSCLB(callback));
return;
}
if(SUCCEEDED(hres))
hres = CreateURLMoniker(NULL, url, &mon);
hr = CreateURLMoniker(NULL, uri, &mon);
if (SUCCEEDED(hr)) {
IHlink_SetMonikerReference(hlink, 0, mon, NULL);
if(SUCCEEDED(hres)) {
IHlink_SetMonikerReference(hlink, HLINKSETF_TARGET, mon, NULL);
if(hlnf & HLNF_OPENINNEWWINDOW) {
static const WCHAR wszBlank[] = {'_','b','l','a','n','k',0};
IHlink_SetTargetFrameName(hlink, wszBlank); /* FIXME */
}
IHlinkFrame_Navigate(hlink_frame, hlnf, bindctx, STATUSCLB(callback), hlink);
hres = IHlinkFrame_Navigate(hlink_frame, hlnf, bindctx, STATUSCLB(callback), hlink);
IMoniker_Release(mon);
}
IHlinkFrame_Release(hlink_frame);
IBindCtx_Release(bindctx);
IBindStatusCallback_Release(STATUSCLB(callback));
return hres;
}
HRESULT navigate_url(HTMLDocumentNode *doc, OLECHAR *url)
{
OLECHAR *translated_url = NULL;
HRESULT hres;
if(!url)
url = emptyW;
if(doc->basedoc.doc_obj->hostui) {
hres = IDocHostUIHandler_TranslateUrl(doc->basedoc.doc_obj->hostui, 0, url,
&translated_url);
if(hres == S_OK)
url = translated_url;
}
hres = hlink_frame_navigate(&doc->basedoc, url, NULL, 0);
if(FAILED(hres))
FIXME("hlink_frame_navigate failed: %08x\n", hres);
CoTaskMemFree(translated_url);
return hres;
}

View file

@ -807,63 +807,6 @@ void set_ns_editmode(NSContainer *This)
nsIWebBrowser_SetParentURIContentListener(This->webbrowser, NSURICL(This));
}
void update_nsdocument(HTMLDocumentObj *doc)
{
HTMLDocumentNode *doc_node;
nsIDOMHTMLDocument *nsdoc;
nsIDOMDocument *nsdomdoc;
nsresult nsres;
HRESULT hres;
if(!doc->nscontainer || !doc->nscontainer->navigation)
return;
nsres = nsIWebNavigation_GetDocument(doc->nscontainer->navigation, &nsdomdoc);
if(NS_FAILED(nsres) || !nsdomdoc) {
ERR("GetDocument failed: %08x\n", nsres);
return;
}
nsres = nsIDOMDocument_QueryInterface(nsdomdoc, &IID_nsIDOMHTMLDocument, (void**)&nsdoc);
nsIDOMDocument_Release(nsdomdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMHTMLDocument iface: %08x\n", nsres);
return;
}
if(nsdoc == doc->basedoc.nsdoc) {
nsIDOMHTMLDocument_Release(nsdoc);
return;
}
if(doc->basedoc.nsdoc) {
remove_mutation_observer(doc->nscontainer, doc->basedoc.nsdoc);
nsIDOMHTMLDocument_Release(doc->basedoc.nsdoc);
doc_node = doc->basedoc.doc_node;
doc_node->basedoc.doc_obj = NULL;
IHTMLDocument2_Release(HTMLDOC(&doc_node->basedoc));
doc->basedoc.doc_node = NULL;
}
doc->basedoc.nsdoc = nsdoc;
if(!nsdoc) {
window_set_docnode(doc->basedoc.window, NULL);
return;
}
set_mutation_observer(doc->nscontainer, nsdoc);
hres = create_doc_from_nsdoc(nsdoc, doc, doc->basedoc.window, &doc_node);
if(FAILED(hres)) {
ERR("Could not create document: %08x\n", hres);
return;
}
doc->basedoc.doc_node = doc_node;
window_set_docnode(doc->basedoc.window, doc_node);
}
void close_gecko(void)
{
TRACE("()\n");
@ -963,13 +906,7 @@ static nsresult NSAPI nsWebBrowserChrome_SetStatus(nsIWebBrowserChrome *iface,
PRUint32 statusType, const PRUnichar *status)
{
NSContainer *This = NSWBCHROME_THIS(iface);
TRACE("(%p)->(%d %s)\n", This, statusType, debugstr_w(status));
/* FIXME: This hack should be removed when we'll load all pages by URLMoniker */
if(This->doc)
update_nsdocument(This->doc);
return NS_OK;
}
@ -1678,7 +1615,7 @@ NSContainer *NSContainer_Create(HTMLDocumentObj *doc, NSContainer *parent)
NSContainer *ret;
nsresult nsres;
if(!load_gecko(FALSE))
if(!load_gecko(TRUE))
return NULL;
ret = heap_alloc_zero(sizeof(NSContainer));
@ -1694,7 +1631,6 @@ NSContainer *NSContainer_Create(HTMLDocumentObj *doc, NSContainer *parent)
ret->doc = doc;
ret->ref = 1;
init_mutation(ret);
nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr, NS_WEBBROWSER_CONTRACTID,
NULL, &IID_nsIWebBrowser, (void**)&ret->webbrowser);
@ -1761,8 +1697,6 @@ NSContainer *NSContainer_Create(HTMLDocumentObj *doc, NSContainer *parent)
if(NS_FAILED(nsres))
ERR("SetParentURIContentListener failed: %08x\n", nsres);
init_nsevents(ret);
nsres = nsIWebBrowser_QueryInterface(ret->webbrowser, &IID_nsIScrollable, (void**)&scrollable);
if(NS_SUCCEEDED(nsres)) {
nsres = nsIScrollable_SetDefaultScrollbarPreferences(scrollable,

View file

@ -26,6 +26,8 @@
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "mshtmcid.h"
#include "shlguid.h"
#include "wine/debug.h"
#include "wine/unicode.h"
@ -35,6 +37,35 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
typedef struct {
const nsIDOMEventListenerVtbl *lpDOMEventListenerVtbl;
nsDocumentEventListener *This;
} nsEventListener;
struct nsDocumentEventListener {
nsEventListener blur_listener;
nsEventListener focus_listener;
nsEventListener keypress_listener;
nsEventListener load_listener;
nsEventListener htmlevent_listener;
LONG ref;
HTMLDocumentNode *doc;
};
static LONG release_listener(nsDocumentEventListener *This)
{
LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
if(!ref)
heap_free(This);
return ref;
}
#define NSEVENTLIST_THIS(iface) DEFINE_THIS(nsEventListener, DOMEventListener, iface)
static nsresult NSAPI nsDOMEventListener_QueryInterface(nsIDOMEventListener *iface,
@ -63,37 +94,44 @@ static nsresult NSAPI nsDOMEventListener_QueryInterface(nsIDOMEventListener *ifa
static nsrefcnt NSAPI nsDOMEventListener_AddRef(nsIDOMEventListener *iface)
{
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
return nsIWebBrowserChrome_AddRef(NSWBCHROME(This));
nsDocumentEventListener *This = NSEVENTLIST_THIS(iface)->This;
LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
return ref;
}
static nsrefcnt NSAPI nsDOMEventListener_Release(nsIDOMEventListener *iface)
{
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
nsDocumentEventListener *This = NSEVENTLIST_THIS(iface)->This;
return release_listener(This);
}
static BOOL is_doc_child_focus(NSContainer *This)
static BOOL is_doc_child_focus(HTMLDocumentObj *doc)
{
HWND hwnd;
if(!This->doc)
return FALSE;
for(hwnd = GetFocus(); hwnd && hwnd != This->doc->basedoc.doc_obj->hwnd; hwnd = GetParent(hwnd));
for(hwnd = GetFocus(); hwnd && hwnd != doc->hwnd; hwnd = GetParent(hwnd));
return hwnd != NULL;
}
static nsresult NSAPI handle_blur(nsIDOMEventListener *iface, nsIDOMEvent *event)
{
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
HTMLDocumentNode *doc = NSEVENTLIST_THIS(iface)->This->doc;
HTMLDocumentObj *doc_obj;
TRACE("(%p)\n", This);
TRACE("(%p)\n", doc);
if(!This->reset_focus && This->doc && This->doc->basedoc.doc_obj->focus && !is_doc_child_focus(This)) {
This->doc->basedoc.doc_obj->focus = FALSE;
notif_focus(This->doc);
if(!doc || !doc->basedoc.doc_obj)
return NS_ERROR_FAILURE;
doc_obj = doc->basedoc.doc_obj;
if(!doc_obj->nscontainer->reset_focus && doc_obj->focus && !is_doc_child_focus(doc_obj)) {
doc_obj->focus = FALSE;
notif_focus(doc_obj);
}
return NS_OK;
@ -101,13 +139,18 @@ static nsresult NSAPI handle_blur(nsIDOMEventListener *iface, nsIDOMEvent *event
static nsresult NSAPI handle_focus(nsIDOMEventListener *iface, nsIDOMEvent *event)
{
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
HTMLDocumentNode *doc = NSEVENTLIST_THIS(iface)->This->doc;
HTMLDocumentObj *doc_obj;
TRACE("(%p)\n", This);
TRACE("(%p)\n", doc);
if(!This->reset_focus && This->doc && !This->doc->focus) {
This->doc->focus = TRUE;
notif_focus(This->doc);
if(!doc)
return NS_ERROR_FAILURE;
doc_obj = doc->basedoc.doc_obj;
if(!doc_obj->nscontainer->reset_focus && !doc_obj->focus) {
doc_obj->focus = TRUE;
notif_focus(doc_obj);
}
return NS_OK;
@ -116,46 +159,96 @@ static nsresult NSAPI handle_focus(nsIDOMEventListener *iface, nsIDOMEvent *even
static nsresult NSAPI handle_keypress(nsIDOMEventListener *iface,
nsIDOMEvent *event)
{
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
HTMLDocumentNode *doc = NSEVENTLIST_THIS(iface)->This->doc;
HTMLDocumentObj *doc_obj;
TRACE("(%p)->(%p)\n", This, event);
if(!doc)
return NS_ERROR_FAILURE;
doc_obj = doc->basedoc.doc_obj;
update_doc(&This->doc->basedoc, UPDATE_UI);
if(This->doc->usermode == EDITMODE)
handle_edit_event(&This->doc->basedoc, event);
TRACE("(%p)->(%p)\n", doc, event);
update_doc(&doc_obj->basedoc, UPDATE_UI);
if(doc_obj->usermode == EDITMODE)
handle_edit_event(&doc_obj->basedoc, event);
return NS_OK;
}
static void handle_docobj_load(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd = NULL;
HRESULT hres;
if(!doc->client)
return;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
VARIANT state, progress;
V_VT(&progress) = VT_I4;
V_I4(&progress) = 0;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS, OLECMDEXECOPT_DONTPROMPTUSER,
&progress, NULL);
V_VT(&state) = VT_I4;
V_I4(&state) = 0;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE, OLECMDEXECOPT_DONTPROMPTUSER,
&state, NULL);
IOleCommandTarget_Exec(olecmd, &CGID_ShellDocView, 103, 0, NULL, NULL);
IOleCommandTarget_Exec(olecmd, &CGID_MSHTML, IDM_PARSECOMPLETE, 0, NULL, NULL);
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_HTTPEQUIV_DONE, 0, NULL, NULL);
IOleCommandTarget_Release(olecmd);
}
}
static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event)
{
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
HTMLDocumentNode *doc = NSEVENTLIST_THIS(iface)->This->doc;
HTMLDocumentObj *doc_obj;
nsIDOMHTMLElement *nsbody = NULL;
TRACE("(%p)\n", This);
TRACE("(%p)\n", doc);
if(!This->doc)
return NS_OK;
if(!doc)
return NS_ERROR_FAILURE;
doc_obj = doc->basedoc.doc_obj;
update_nsdocument(This->doc);
connect_scripts(This->doc->basedoc.window);
connect_scripts(doc->basedoc.window);
if(This->editor_controller) {
nsIController_Release(This->editor_controller);
This->editor_controller = NULL;
if(doc_obj->nscontainer->editor_controller) {
nsIController_Release(doc_obj->nscontainer->editor_controller);
doc_obj->nscontainer->editor_controller = NULL;
}
if(This->doc->usermode == EDITMODE)
handle_edit_load(&This->doc->basedoc);
if(doc_obj->usermode == EDITMODE)
handle_edit_load(&doc_obj->basedoc);
if(!This->doc->basedoc.nsdoc) {
if(doc == doc_obj->basedoc.doc_node)
handle_docobj_load(doc_obj);
set_ready_state(doc->basedoc.window, READYSTATE_COMPLETE);
if(doc == doc_obj->basedoc.doc_node) {
if(doc_obj->frame) {
static const WCHAR wszDone[] = {'D','o','n','e',0};
IOleInPlaceFrame_SetStatusText(doc_obj->frame, wszDone);
}
update_title(doc_obj);
}
if(!doc->nsdoc) {
ERR("NULL nsdoc\n");
return NS_ERROR_FAILURE;
}
nsIDOMHTMLDocument_GetBody(This->doc->basedoc.nsdoc, &nsbody);
nsIDOMHTMLDocument_GetBody(doc->nsdoc, &nsbody);
if(nsbody) {
fire_event(This->doc->basedoc.doc_node, EVENTID_LOAD, (nsIDOMNode*)nsbody, event);
fire_event(doc, EVENTID_LOAD, (nsIDOMNode*)nsbody, event);
nsIDOMHTMLElement_Release(nsbody);
}
@ -164,7 +257,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
static nsresult NSAPI handle_htmlevent(nsIDOMEventListener *iface, nsIDOMEvent *event)
{
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
HTMLDocumentNode *doc = NSEVENTLIST_THIS(iface)->This->doc;
const PRUnichar *type;
nsIDOMEventTarget *event_target;
nsIDOMNode *nsnode;
@ -191,7 +284,7 @@ static nsresult NSAPI handle_htmlevent(nsIDOMEventListener *iface, nsIDOMEvent *
return NS_OK;
}
fire_event(This->doc->basedoc.doc_node, eid, nsnode, event);
fire_event(doc, eid, nsnode, event);
nsIDOMNode_Release(nsnode);
@ -228,31 +321,40 @@ static void init_event(nsIDOMEventTarget *target, const PRUnichar *type,
}
static void init_listener(nsEventListener *This, NSContainer *container,
static void init_listener(nsEventListener *This, nsDocumentEventListener *listener,
const nsIDOMEventListenerVtbl *vtbl)
{
This->lpDOMEventListenerVtbl = vtbl;
This->This = container;
This->This = listener;
}
void add_nsevent_listener(HTMLWindow *window, LPCWSTR type)
void add_nsevent_listener(HTMLDocumentNode *doc, LPCWSTR type)
{
nsIDOMEventTarget *target;
nsresult nsres;
nsres = nsIDOMWindow_QueryInterface(window->nswindow, &IID_nsIDOMEventTarget, (void**)&target);
nsres = nsIDOMWindow_QueryInterface(doc->basedoc.window->nswindow, &IID_nsIDOMEventTarget, (void**)&target);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMEventTarget interface: %08x\n", nsres);
return;
}
init_event(target, type, NSEVENTLIST(&window->doc_obj->nscontainer->htmlevent_listener), TRUE);
init_event(target, type, NSEVENTLIST(&doc->nsevent_listener->htmlevent_listener), TRUE);
nsIDOMEventTarget_Release(target);
}
void init_nsevents(NSContainer *This)
void release_nsevents(HTMLDocumentNode *doc)
{
nsIDOMWindow *dom_window;
if(doc->nsevent_listener) {
doc->nsevent_listener->doc = NULL;
release_listener(doc->nsevent_listener);
doc->nsevent_listener = NULL;
}
}
void init_nsevents(HTMLDocumentNode *doc)
{
nsDocumentEventListener *listener;
nsIDOMEventTarget *target;
nsresult nsres;
@ -261,29 +363,31 @@ void init_nsevents(NSContainer *This)
static const PRUnichar wsz_keypress[] = {'k','e','y','p','r','e','s','s',0};
static const PRUnichar wsz_load[] = {'l','o','a','d',0};
init_listener(&This->blur_listener, This, &blur_vtbl);
init_listener(&This->focus_listener, This, &focus_vtbl);
init_listener(&This->keypress_listener, This, &keypress_vtbl);
init_listener(&This->load_listener, This, &load_vtbl);
init_listener(&This->htmlevent_listener, This, &htmlevent_vtbl);
nsres = nsIWebBrowser_GetContentDOMWindow(This->webbrowser, &dom_window);
if(NS_FAILED(nsres)) {
ERR("GetContentDOMWindow failed: %08x\n", nsres);
listener = heap_alloc(sizeof(nsDocumentEventListener));
if(!listener)
return;
}
nsres = nsIDOMWindow_QueryInterface(dom_window, &IID_nsIDOMEventTarget, (void**)&target);
nsIDOMWindow_Release(dom_window);
listener->ref = 1;
listener->doc = doc;
init_listener(&listener->blur_listener, listener, &blur_vtbl);
init_listener(&listener->focus_listener, listener, &focus_vtbl);
init_listener(&listener->keypress_listener, listener, &keypress_vtbl);
init_listener(&listener->load_listener, listener, &load_vtbl);
init_listener(&listener->htmlevent_listener, listener, &htmlevent_vtbl);
doc->nsevent_listener = listener;
nsres = nsIDOMWindow_QueryInterface(doc->basedoc.window->nswindow, &IID_nsIDOMEventTarget, (void**)&target);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMEventTarget interface: %08x\n", nsres);
return;
}
init_event(target, wsz_blur, NSEVENTLIST(&This->blur_listener), TRUE);
init_event(target, wsz_focus, NSEVENTLIST(&This->focus_listener), TRUE);
init_event(target, wsz_keypress, NSEVENTLIST(&This->keypress_listener), FALSE);
init_event(target, wsz_load, NSEVENTLIST(&This->load_listener), TRUE);
init_event(target, wsz_blur, NSEVENTLIST(&listener->blur_listener), TRUE);
init_event(target, wsz_focus, NSEVENTLIST(&listener->focus_listener), TRUE);
init_event(target, wsz_keypress, NSEVENTLIST(&listener->keypress_listener), FALSE);
init_event(target, wsz_load, NSEVENTLIST(&listener->load_listener), TRUE);
nsIDOMEventTarget_Release(target);
}

View file

@ -89,6 +89,7 @@ interface nsIDocumentStateListener;
interface nsIDOMCSSStyleSheet;
interface nsIDOMDocumentView;
interface nsIDocumentObserver;
interface nsIDOMWindow;
interface IMoniker;
@ -109,7 +110,6 @@ typedef nsISupports nsISHistory;
typedef nsISupports nsIWidget;
typedef nsISupports nsIHttpHeaderVisitor;
typedef nsISupports nsIDOMBarProp;
typedef nsISupports nsIDOMWindowCollection;
typedef nsISupports nsIPrompt;
typedef nsISupports nsIAuthPrompt;
typedef nsISupports nsIDOMNamedNodeMap;
@ -135,7 +135,6 @@ typedef nsISupports nsIDOMHTMLTableSectionElement;
typedef nsISupports nsIDOMClientRectList;
typedef nsISupports nsIDOMClientRect;
typedef nsISupports nsIDOMLocation;
typedef nsISupports nsIBoxObject;
typedef nsISupports nsIDocument;
typedef nsISupports nsIContent;
typedef nsISupports nsINode;
@ -1011,6 +1010,18 @@ interface nsIDOMDocumentView : nsISupports
nsresult GetDefaultView(nsIDOMAbstractView **aDefaultView);
}
[
object,
uuid(46b91d66-28e2-11d4-ab1e-0010830123b4),
local
/* FROZEN */
]
interface nsIDOMDocumentEvent : nsISupports
{
cpp_quote("#undef CreateEvent")
nsresult CreateEvent(const nsAString *eventType, nsIDOMEvent **_retval);
}
[
object,
uuid(a6cf90ce-15b3-11d2-932e-00805f8add32),
@ -1106,6 +1117,19 @@ interface nsISelection : nsISupports
nsresult ToString(PRUnichar **_retval);
}
[
object,
uuid(a6cf906f-15b3-11d2-932e-00805f8add32),
local
/* FROZEN */
]
interface nsIDOMWindowCollection : nsISupports
{
nsresult GetLength(PRUint32 *aLength);
nsresult Item(PRUint32 index, nsIDOMWindow **_retval);
nsresult NamedItem(const nsAString *name, nsIDOMWindow **_retval);
}
[
object,
uuid(a6cf906b-15b3-11d2-932e-00805f8add32),
@ -1487,6 +1511,33 @@ interface nsIDOMHTMLIFrameElement : nsIDOMHTMLElement
nsresult GetContentDocument(nsIDOMDocument **aContentDocument);
}
[
object,
uuid(a6cf90b9-15b3-11d2-932e-00805f8add32),
local
/* FROZEN */
]
interface nsIDOMHTMLFrameElement : nsIDOMHTMLElement
{
nsresult GetFrameBorder(nsAString *aFrameBorder);
nsresult SetFrameBorder(const nsAString *aFrameBorder);
nsresult GetLongDesc(nsAString *aLongDesc);
nsresult SetLongDesc(const nsAString *aLongDesc);
nsresult GetMarginHeight(nsAString *aMarginHeight);
nsresult SetMarginHeight(const nsAString *aMarginHeight);
nsresult GetMarginWidth(nsAString *aMarginWidth);
nsresult SetMarginWidth(const nsAString *aMarginWidth);
nsresult GetName(nsAString *aName);
nsresult SetName(const nsAString *aName);
nsresult GetNoResize(PRBool *aNoResize);
nsresult SetNoResize(PRBool aNoResize);
nsresult GetScrolling(nsAString *aScrolling);
nsresult SetScrolling(const nsAString *aScrolling);
nsresult GetSrc(nsAString *aSrc);
nsresult SetSrc(const nsAString *aSrc);
nsresult GetContentDocument(nsIDOMDocument **aContentDocument);
}
[
object,
uuid(94928ab3-8b63-11d3-989d-001083010e9b),
@ -1613,6 +1664,20 @@ interface nsIWebNavigation : nsISupports
nsresult SetSessionHistory(nsISHistory *aSessionHistory);
}
[
object,
uuid(570f39d0-efd0-11d3-b093-00a024ffc08c),
local
/* FROZEN */
]
interface nsIWebProgress : nsISupports
{
nsresult AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask);
nsresult RemoveProgressListener(nsIWebProgressListener *aListener);
nsresult GetDOMWindow(nsIDOMWindow **aDOMWindow);
nsresult GetIsLoadingDocument(PRBool *aIsLoadingDocument);
}
[
object,
uuid(343700dd-078b-42b6-a809-b9c1d7e951d0),
@ -2619,9 +2684,12 @@ interface nsIDocumentObserver : nsIMutationObserver
interface nsIWineURI : nsIURL
{
typedef struct NSContainer NSContainer;
typedef struct HTMLWindow HTMLWindow;
nsresult GetNSContainer(NSContainer **aNSContainer);
nsresult SetNSContainer(NSContainer *aNSContainer);
nsresult GetWindow(HTMLWindow **aHTMLWindow);
nsresult SetWindow(HTMLWindow *aHTMLWindow);
nsresult GetIsDocumentURI(PRBool *aIsDocumentURI);
nsresult SetIsDocumentURI(PRBool aIsDocumentURI);
nsresult GetWineURL(LPCWSTR *aURL);

View file

@ -59,6 +59,7 @@ typedef struct {
nsIURI *uri;
nsIURL *nsurl;
NSContainer *container;
windowref_t *window_ref;
LPWSTR wine_url;
PRBool is_doc_uri;
BOOL use_wine_url;
@ -67,7 +68,7 @@ typedef struct {
#define NSURI(x) ((nsIURI*) &(x)->lpWineURIVtbl)
#define NSWINEURI(x) ((nsIWineURI*) &(x)->lpWineURIVtbl)
static nsresult create_uri(nsIURI*,NSContainer*,nsIWineURI**);
static nsresult create_uri(nsIURI*,HTMLWindow*,NSContainer*,nsIWineURI**);
static const char *debugstr_nsacstr(const nsACString *nsstr)
{
@ -128,7 +129,6 @@ static BOOL exec_shldocvw_67(HTMLDocumentObj *doc, LPCWSTR url)
static BOOL before_async_open(nsChannel *channel, NSContainer *container)
{
HTMLDocumentObj *doc = container->doc;
IServiceProvider *service_provider;
DWORD hlnf = 0;
LPCWSTR uri;
HRESULT hres;
@ -154,23 +154,8 @@ static BOOL before_async_open(nsChannel *channel, NSContainer *container)
if(!hlnf && !exec_shldocvw_67(doc, uri))
return FALSE;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IServiceProvider,
(void**)&service_provider);
if(SUCCEEDED(hres)) {
IHlinkFrame *hlink_frame;
hres = IServiceProvider_QueryService(service_provider, &IID_IHlinkFrame,
&IID_IHlinkFrame, (void**)&hlink_frame);
IServiceProvider_Release(service_provider);
if(SUCCEEDED(hres)) {
hlink_frame_navigate(&doc->basedoc, hlink_frame, uri, channel->post_data_stream, hlnf);
IHlinkFrame_Release(hlink_frame);
return FALSE;
}
}
return TRUE;
hres = hlink_frame_navigate(&doc->basedoc, uri, channel->post_data_stream, hlnf);
return hres != S_OK;
}
#define NSCHANNEL_THIS(iface) DEFINE_THIS(nsChannel, HttpChannel, iface)
@ -518,9 +503,8 @@ static nsresult NSAPI nsChannel_GetContentType(nsIHttpChannel *iface, nsACString
if(This->channel)
return nsIChannel_GetContentType(This->channel, aContentType);
TRACE("returning default text/html\n");
nsACString_SetData(aContentType, "text/html");
return NS_OK;
WARN("unknown type\n");
return NS_ERROR_FAILURE;
}
static nsresult NSAPI nsChannel_SetContentType(nsIHttpChannel *iface,
@ -647,14 +631,14 @@ static HRESULT create_mon_for_nschannel(nsChannel *channel, IMoniker **mon)
hres = CreateURLMoniker(NULL, wine_url, mon);
if(FAILED(hres))
WARN("CreateURLMonikrer failed: %08x\n", hres);
WARN("CreateURLMoniker failed: %08x\n", hres);
return hres;
}
static NSContainer *get_nscontainer_from_load_group(nsChannel *This)
static HTMLWindow *get_window_from_load_group(nsChannel *This)
{
NSContainer *container;
HTMLWindow *window;
nsIChannel *channel;
nsIRequest *req;
nsIWineURI *wine_uri;
@ -691,79 +675,117 @@ static NSContainer *get_nscontainer_from_load_group(nsChannel *This)
return NULL;
}
nsIWineURI_GetNSContainer(wine_uri, &container);
nsIWineURI_GetWindow(wine_uri, &window);
nsIWineURI_Release(wine_uri);
return container;
return window;
}
static nsresult async_open_doc_uri(nsChannel *This, NSContainer *container,
nsIStreamListener *listener, nsISupports *context, BOOL *open)
static HTMLWindow *get_channel_window(nsChannel *This)
{
IMoniker *mon;
HRESULT hres;
nsIRequestObserver *req_observer;
nsIWebProgress *web_progress;
nsIDOMWindow *nswindow;
HTMLWindow *window;
nsresult nsres;
*open = FALSE;
if(container->bscallback) {
channelbsc_set_channel(container->bscallback, This, listener, context);
if(container->doc && container->doc->mime) {
heap_free(This->content_type);
This->content_type = heap_strdupWtoA(container->doc->mime);
}
return NS_OK;
}else {
BOOL cont = before_async_open(This, container);
if(!cont) {
TRACE("canceled\n");
return NS_ERROR_UNEXPECTED;
}
if(!container->doc) {
return This->channel
? nsIChannel_AsyncOpen(This->channel, listener, context)
: NS_ERROR_UNEXPECTED;
}
hres = create_mon_for_nschannel(This, &mon);
if(FAILED(hres)) {
return NS_ERROR_UNEXPECTED;
}
set_current_mon(&container->doc->basedoc, mon);
if(!This->load_group) {
ERR("NULL load_group\n");
return NULL;
}
*open = TRUE;
return NS_OK;
nsres = nsILoadGroup_GetGroupObserver(This->load_group, &req_observer);
if(NS_FAILED(nsres) || !req_observer) {
ERR("GetGroupObserver failed: %08x\n", nsres);
return NULL;
}
nsres = nsIRequestObserver_QueryInterface(req_observer, &IID_nsIWebProgress, (void**)&web_progress);
nsIRequestObserver_Release(req_observer);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIWebProgress iface: %08x\n", nsres);
return NULL;
}
nsres = nsIWebProgress_GetDOMWindow(web_progress, &nswindow);
nsIWebProgress_Release(web_progress);
if(NS_FAILED(nsres) || !nswindow) {
ERR("GetDOMWindow failed: %08x\n", nsres);
return NULL;
}
window = nswindow_to_window(nswindow);
nsIDOMWindow_Release(nswindow);
if(window)
IHTMLWindow2_AddRef(HTMLWINDOW2(window));
else
FIXME("NULL window for %p\n", nswindow);
return window;
}
static nsresult async_open(nsChannel *This, NSContainer *container, nsIStreamListener *listener,
typedef struct {
task_t header;
HTMLDocumentNode *doc;
nsChannelBSC *bscallback;
} start_binding_task_t;
static void start_binding_proc(task_t *_task)
{
start_binding_task_t *task = (start_binding_task_t*)_task;
start_binding(NULL, task->doc, (BSCallback*)task->bscallback, NULL);
}
typedef struct {
task_t header;
HTMLWindow *window;
nsChannelBSC *bscallback;
} start_doc_binding_task_t;
static void start_doc_binding_proc(task_t *_task)
{
start_doc_binding_task_t *task = (start_doc_binding_task_t*)_task;
start_binding(task->window, NULL, (BSCallback*)task->bscallback, NULL);
IUnknown_Release((IUnknown*)task->bscallback);
}
static nsresult async_open(nsChannel *This, HTMLWindow *window, BOOL is_doc_channel, nsIStreamListener *listener,
nsISupports *context)
{
nsChannelBSC *bscallback;
IMoniker *mon = NULL;
task_t *task;
HRESULT hres;
hres = create_mon_for_nschannel(This, &mon);
if(FAILED(hres))
return NS_ERROR_UNEXPECTED;
if(is_doc_channel)
set_current_mon(window, mon);
bscallback = create_channelbsc(mon);
IMoniker_Release(mon);
channelbsc_set_channel(bscallback, This, listener, context);
task = heap_alloc(sizeof(task_t));
if(is_doc_channel) {
start_doc_binding_task_t *task;
task->doc = &container->doc->basedoc;
task->task_id = TASK_START_BINDING;
task->next = NULL;
task->bscallback = bscallback;
set_window_bscallback(window, bscallback);
push_task(task);
task = heap_alloc(sizeof(start_doc_binding_task_t));
task->window = window;
task->bscallback = bscallback;
push_task(&task->header, start_doc_binding_proc, window->task_magic);
}else {
start_binding_task_t *task = heap_alloc(sizeof(start_binding_task_t));
task->doc = window->doc;
task->bscallback = bscallback;
push_task(&task->header, start_binding_proc, window->doc->basedoc.task_magic);
}
return NS_OK;
}
@ -772,37 +794,88 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
nsISupports *aContext)
{
nsChannel *This = NSCHANNEL_THIS(iface);
NSContainer *container;
HTMLWindow *window = NULL;
PRBool is_doc_uri;
BOOL open = TRUE;
nsresult nsres = NS_OK;
TRACE("(%p)->(%p %p)\n", This, aListener, aContext);
nsIWineURI_GetNSContainer(This->uri, &container);
if(TRACE_ON(mshtml)) {
LPCWSTR url;
if(!container && This->load_group) {
container = get_nscontainer_from_load_group(This);
if(container)
nsIWineURI_SetNSContainer(This->uri, container);
nsIWineURI_GetWineURL(This->uri, &url);
TRACE("opening %s\n", debugstr_w(url));
}
if(!container) {
TRACE("container = NULL\n");
nsIWineURI_GetIsDocumentURI(This->uri, &is_doc_uri);
if(is_doc_uri) {
window = get_channel_window(This);
if(window) {
nsIWineURI_SetWindow(This->uri, window);
}else {
NSContainer *nscontainer;
nsIWineURI_GetNSContainer(This->uri, &nscontainer);
if(nscontainer) {
BOOL b;
/* nscontainer->doc should be NULL which means navigation to a new window */
if(nscontainer->doc)
FIXME("nscontainer->doc = %p\n", nscontainer->doc);
b = before_async_open(This, nscontainer);
nsIWebBrowserChrome_Release(NSWBCHROME(nscontainer));
if(b)
FIXME("Navigation not cancelled\n");
return NS_ERROR_UNEXPECTED;
}
}
}
if(!window) {
nsIWineURI_GetWindow(This->uri, &window);
if(!window && This->load_group) {
window = get_window_from_load_group(This);
if(window)
nsIWineURI_SetWindow(This->uri, window);
}
}
if(!window) {
TRACE("window = NULL\n");
return This->channel
? nsIChannel_AsyncOpen(This->channel, aListener, aContext)
: NS_ERROR_UNEXPECTED;
}
nsIWineURI_GetIsDocumentURI(This->uri, &is_doc_uri);
if(is_doc_uri && (This->load_flags & LOAD_INITIAL_DOCUMENT_URI)) {
if(window->doc_obj->nscontainer->bscallback) {
NSContainer *nscontainer = window->doc_obj->nscontainer;
if(is_doc_uri && (This->load_flags & LOAD_INITIAL_DOCUMENT_URI))
nsres = async_open_doc_uri(This, container, aListener, aContext, &open);
channelbsc_set_channel(nscontainer->bscallback, This, aListener, aContext);
if(nscontainer->doc->mime) {
heap_free(This->content_type);
This->content_type = heap_strdupWtoA(nscontainer->doc->mime);
}
open = FALSE;
}else {
open = before_async_open(This, window->doc_obj->nscontainer);
if(!open) {
TRACE("canceled\n");
nsres = NS_ERROR_UNEXPECTED;
}
}
}
if(open)
nsres = async_open(This, container, aListener, aContext);
nsres = async_open(This, window, is_doc_uri, aListener, aContext);
nsIWebBrowserChrome_Release(NSWBCHROME(container));
if(window)
IHTMLWindow2_Release(HTMLWINDOW2(window));
return nsres;
}
@ -1364,6 +1437,8 @@ static nsrefcnt NSAPI nsURI_Release(nsIWineURI *iface)
TRACE("(%p) ref=%d\n", This, ref);
if(!ref) {
if(This->window_ref)
windowref_release(This->window_ref);
if(This->container)
nsIWebBrowserChrome_Release(NSWBCHROME(This->container));
if(This->nsurl)
@ -1679,7 +1754,7 @@ static nsresult NSAPI nsURI_Equals(nsIWineURI *iface, nsIURI *other, PRBool *_re
}
nsIWineURI_GetWineURL(wine_uri, &other_url);
*_retval = !UrlCompareW(This->wine_url, other_url, TRUE);
*_retval = other_url && !UrlCompareW(This->wine_url, other_url, TRUE);
nsIWineURI_Release(wine_uri);
return NS_OK;
@ -1725,7 +1800,7 @@ static nsresult NSAPI nsURI_Clone(nsIWineURI *iface, nsIURI **_retval)
}
}
nsres = create_uri(nsuri, This->container, &wine_uri);
nsres = create_uri(nsuri, This->window_ref ? This->window_ref->window : NULL, This->container, &wine_uri);
if(NS_FAILED(nsres)) {
WARN("create_uri failed: %08x\n", nsres);
return nsres;
@ -1925,12 +2000,17 @@ static nsresult NSAPI nsURL_GetRef(nsIWineURI *iface, nsACString *aRef)
static nsresult NSAPI nsURL_SetRef(nsIWineURI *iface, const nsACString *aRef)
{
nsURI *This = NSURI_THIS(iface);
const char *refa;
TRACE("(%p)->(%s)\n", This, debugstr_nsacstr(aRef));
if(This->nsurl)
return nsIURL_SetRef(This->nsurl, aRef);
nsACString_GetData(aRef, &refa);
if(!*refa)
return NS_OK;
FIXME("default action not implemented\n");
return NS_ERROR_NOT_IMPLEMENTED;
}
@ -2098,6 +2178,48 @@ static nsresult NSAPI nsURI_SetNSContainer(nsIWineURI *iface, NSContainer *aCont
return NS_OK;
}
static nsresult NSAPI nsURI_GetWindow(nsIWineURI *iface, HTMLWindow **aHTMLWindow)
{
nsURI *This = NSURI_THIS(iface);
TRACE("(%p)->(%p)\n", This, aHTMLWindow);
if(This->window_ref && This->window_ref->window) {
IHTMLWindow2_AddRef(HTMLWINDOW2(This->window_ref->window));
*aHTMLWindow = This->window_ref->window;
}else {
*aHTMLWindow = NULL;
}
return NS_OK;
}
static nsresult NSAPI nsURI_SetWindow(nsIWineURI *iface, HTMLWindow *aHTMLWindow)
{
nsURI *This = NSURI_THIS(iface);
TRACE("(%p)->(%p)\n", This, aHTMLWindow);
if(This->window_ref) {
if(This->window_ref->window == aHTMLWindow)
return NS_OK;
TRACE("Changing %p -> %p\n", This->window_ref->window, aHTMLWindow);
windowref_release(This->window_ref);
}
if(aHTMLWindow) {
windowref_addref(aHTMLWindow->window_ref);
This->window_ref = aHTMLWindow->window_ref;
if(aHTMLWindow->doc_obj)
nsIWineURI_SetNSContainer(NSWINEURI(This), aHTMLWindow->doc_obj->nscontainer);
}else {
This->window_ref = NULL;
}
return NS_OK;
}
static nsresult NSAPI nsURI_GetIsDocumentURI(nsIWineURI *iface, PRBool *aIsDocumentURI)
{
nsURI *This = NSURI_THIS(iface);
@ -2210,26 +2332,24 @@ static const nsIWineURIVtbl nsWineURIVtbl = {
nsURL_GetRelativeSpec,
nsURI_GetNSContainer,
nsURI_SetNSContainer,
nsURI_GetWindow,
nsURI_SetWindow,
nsURI_GetIsDocumentURI,
nsURI_SetIsDocumentURI,
nsURI_GetWineURL,
nsURI_SetWineURL
};
static nsresult create_uri(nsIURI *uri, NSContainer *container, nsIWineURI **_retval)
static nsresult create_uri(nsIURI *uri, HTMLWindow *window, NSContainer *container, nsIWineURI **_retval)
{
nsURI *ret = heap_alloc(sizeof(nsURI));
nsURI *ret = heap_alloc_zero(sizeof(nsURI));
ret->lpWineURIVtbl = &nsWineURIVtbl;
ret->ref = 1;
ret->uri = uri;
ret->container = container;
ret->wine_url = NULL;
ret->is_doc_uri = FALSE;
ret->use_wine_url = FALSE;
if(container)
nsIWebBrowserChrome_AddRef(NSWBCHROME(container));
nsIWineURI_SetNSContainer(NSWINEURI(ret), container);
nsIWineURI_SetWindow(NSWINEURI(ret), window);
if(uri)
nsIURI_QueryInterface(uri, &IID_nsIURL, (void**)&ret->nsurl);
@ -2466,7 +2586,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval)
{
const char *spec = NULL;
NSContainer *nscontainer = NULL;
HTMLWindow *window = NULL;
nsIURI *uri = NULL;
LPCWSTR base_wine_url = NULL;
nsIWineURI *base_wine_uri = NULL, *wine_uri;
@ -2510,20 +2630,20 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
if(aBaseURI) {
nsres = nsIURI_QueryInterface(aBaseURI, &IID_nsIWineURI, (void**)&base_wine_uri);
if(NS_SUCCEEDED(nsres)) {
nsIWineURI_GetNSContainer(base_wine_uri, &nscontainer);
nsIWineURI_GetWindow(base_wine_uri, &window);
nsIWineURI_GetWineURL(base_wine_uri, &base_wine_url);
}else {
TRACE("Could not get base nsIWineURI: %08x\n", nsres);
}
}
TRACE("nscontainer = %p\n", nscontainer);
TRACE("window = %p\n", window);
nsres = create_uri(uri, nscontainer, &wine_uri);
nsres = create_uri(uri, window, NULL, &wine_uri);
*_retval = (nsIURI*)wine_uri;
if(nscontainer)
nsIWebBrowserChrome_Release(NSWBCHROME(nscontainer));
if(window)
IHTMLWindow2_Release(HTMLWINDOW2(window));
if(base_wine_url) {
WCHAR url[INTERNET_MAX_URL_LENGTH], rel_url[INTERNET_MAX_URL_LENGTH];

View file

@ -543,9 +543,9 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
This->doc_obj->usermode = EDITMODE;
if(This->doc_obj->mon) {
if(This->window->mon) {
CLSID clsid = IID_NULL;
hres = IMoniker_GetClassID(This->doc_obj->mon, &clsid);
hres = IMoniker_GetClassID(This->window->mon, &clsid);
if(SUCCEEDED(hres)) {
/* We should use IMoniker::Save here */
FIXME("Use CLSID %s\n", debugstr_guid(&clsid));
@ -555,7 +555,7 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if(This->doc_obj->frame)
IOleInPlaceFrame_SetStatusText(This->doc_obj->frame, NULL);
This->doc_obj->readystate = READYSTATE_UNINITIALIZED;
This->window->readystate = READYSTATE_UNINITIALIZED;
if(This->doc_obj->client) {
IOleCommandTarget *cmdtrg;
@ -588,11 +588,11 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
update_doc(This, UPDATE_UI);
if(This->doc_obj->mon) {
if(This->window->mon) {
/* FIXME: We should find nicer way to do this */
remove_doc_tasks(This);
remove_target_tasks(This->task_magic);
mon = This->doc_obj->mon;
mon = This->window->mon;
IMoniker_AddRef(mon);
}else {
static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};

View file

@ -48,38 +48,115 @@ static BOOL use_gecko_script(LPCWSTR url)
&& strncmpiW(aboutW, url, sizeof(aboutW)/sizeof(WCHAR));
}
void set_current_mon(HTMLDocument *This, IMoniker *mon)
void set_current_mon(HTMLWindow *This, IMoniker *mon)
{
HRESULT hres;
if(This->doc_obj->mon) {
IMoniker_Release(This->doc_obj->mon);
This->doc_obj->mon = NULL;
if(This->mon) {
IMoniker_Release(This->mon);
This->mon = NULL;
}
if(This->doc_obj->url) {
CoTaskMemFree(This->doc_obj->url);
This->doc_obj->url = NULL;
if(This->url) {
CoTaskMemFree(This->url);
This->url = NULL;
}
if(!mon)
return;
IMoniker_AddRef(mon);
This->doc_obj->mon = mon;
This->mon = mon;
hres = IMoniker_GetDisplayName(mon, NULL, NULL, &This->doc_obj->url);
hres = IMoniker_GetDisplayName(mon, NULL, NULL, &This->url);
if(FAILED(hres))
WARN("GetDisplayName failed: %08x\n", hres);
set_script_mode(This->window, use_gecko_script(This->doc_obj->url) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
set_script_mode(This, use_gecko_script(This->url) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
}
static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BOOL *bind_complete)
static void set_progress_proc(task_t *_task)
{
docobj_task_t *task = (docobj_task_t*)_task;
IOleCommandTarget *olecmd = NULL;
HTMLDocumentObj *doc = task->doc;
HRESULT hres;
TRACE("(%p)\n", doc);
if(doc->client)
IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(olecmd) {
VARIANT progress_max, progress;
V_VT(&progress_max) = VT_I4;
V_I4(&progress_max) = 0; /* FIXME */
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSMAX, OLECMDEXECOPT_DONTPROMPTUSER,
&progress_max, NULL);
V_VT(&progress) = VT_I4;
V_I4(&progress) = 0; /* FIXME */
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS, OLECMDEXECOPT_DONTPROMPTUSER,
&progress, NULL);
}
if(doc->usermode == EDITMODE && doc->hostui) {
DOCHOSTUIINFO hostinfo;
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
hres = IDocHostUIHandler_GetHostInfo(doc->hostui, &hostinfo);
if(SUCCEEDED(hres))
/* FIXME: use hostinfo */
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
}
}
static void set_downloading_proc(task_t *_task)
{
HTMLDocumentObj *doc = ((docobj_task_t*)_task)->doc;
IOleCommandTarget *olecmd;
HRESULT hres;
TRACE("(%p)\n", doc);
if(doc->frame)
IOleInPlaceFrame_SetStatusText(doc->frame, NULL /* FIXME */);
if(!doc->client)
return;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
VARIANT var;
V_VT(&var) = VT_I4;
V_I4(&var) = 1;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE, OLECMDEXECOPT_DONTPROMPTUSER,
&var, NULL);
IOleCommandTarget_Release(olecmd);
}
if(doc->hostui) {
IDropTarget *drop_target = NULL;
hres = IDocHostUIHandler_GetDropTarget(doc->hostui, NULL /* FIXME */, &drop_target);
if(drop_target) {
FIXME("Use IDropTarget\n");
IDropTarget_Release(drop_target);
}
}
}
static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc)
{
nsChannelBSC *bscallback;
LPOLESTR url = NULL;
task_t *task;
docobj_task_t *task;
HRESULT hres;
nsresult nsres;
@ -113,8 +190,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
}
}
This->doc_obj->readystate = READYSTATE_LOADING;
call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE);
set_ready_state(This->window, READYSTATE_LOADING);
update_doc(This, UPDATE_TITLE);
HTMLDocument_LockContainer(This->doc_obj, TRUE);
@ -127,7 +203,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
TRACE("got url: %s\n", debugstr_w(url));
set_current_mon(This, mon);
set_current_mon(This->window, mon);
if(This->doc_obj->client) {
VARIANT silent, offline;
@ -166,22 +242,14 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
bscallback = create_channelbsc(mon);
if(This->doc_obj->frame) {
task = heap_alloc(sizeof(task_t));
task->doc = This;
task->task_id = TASK_SETPROGRESS;
task->next = NULL;
push_task(task);
task = heap_alloc(sizeof(docobj_task_t));
task->doc = This->doc_obj;
push_task(&task->header, set_progress_proc, This->doc_obj->basedoc.task_magic);
}
task = heap_alloc(sizeof(task_t));
task->doc = This;
task->task_id = TASK_SETDOWNLOADSTATE;
task->next = NULL;
push_task(task);
task = heap_alloc(sizeof(docobj_task_t));
task->doc = This->doc_obj;
push_task(&task->header, set_downloading_proc, This->doc_obj->basedoc.task_magic);
if(This->doc_obj->nscontainer) {
This->doc_obj->nscontainer->bscallback = bscallback;
@ -196,16 +264,21 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
}
}
set_document_bscallback(This, bscallback);
set_window_bscallback(This->window, bscallback);
IUnknown_Release((IUnknown*)bscallback);
CoTaskMemFree(url);
if(bind_complete)
*bind_complete = FALSE;
return S_OK;
}
static HRESULT get_doc_string(HTMLDocument *This, char **str)
void set_ready_state(HTMLWindow *window, READYSTATE readystate)
{
window->readystate = readystate;
if(window->doc_obj->basedoc.window == window)
call_property_onchanged(&window->doc_obj->basedoc.cp_propnotif, DISPID_READYSTATE);
}
static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
{
nsIDOMNode *nsnode;
LPCWSTR strw;
@ -282,19 +355,15 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
IMoniker *pimkName, LPBC pibc, DWORD grfMode)
{
HTMLDocument *This = PERSISTMON_THIS(iface);
BOOL bind_complete = FALSE;
HRESULT hres;
TRACE("(%p)->(%x %p %p %08x)\n", This, fFullyAvailable, pimkName, pibc, grfMode);
hres = set_moniker(This, pimkName, pibc, &bind_complete);
hres = set_moniker(This, pimkName, pibc);
if(FAILED(hres))
return hres;
if(!bind_complete)
return start_binding(This, (BSCallback*)This->doc_obj->bscallback, pibc);
return S_OK;
return start_binding(This->window, NULL, (BSCallback*)This->window->bscallback, pibc);
}
static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName,
@ -318,11 +387,11 @@ static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoni
TRACE("(%p)->(%p)\n", This, ppimkName);
if(!This->doc_obj->mon)
if(!This->window || !This->window->mon)
return E_UNEXPECTED;
IMoniker_AddRef(This->doc_obj->mon);
*ppimkName = This->doc_obj->mon;
IMoniker_AddRef(This->window->mon);
*ppimkName = This->window->mon;
return S_OK;
}
@ -462,7 +531,7 @@ static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileNam
return E_FAIL;
}
hres = get_doc_string(This, &str);
hres = get_doc_string(This->doc_node, &str);
if(SUCCEEDED(hres))
WriteFile(file, str, strlen(str), &written, NULL);
@ -551,12 +620,12 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM
return hres;
}
hres = set_moniker(This, mon, NULL, NULL);
hres = set_moniker(This, mon, NULL);
IMoniker_Release(mon);
if(FAILED(hres))
return hres;
return channelbsc_load_stream(This->doc_obj->bscallback, pStm);
return channelbsc_load_stream(This->window->bscallback, pStm);
}
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,
@ -569,7 +638,7 @@ static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM
TRACE("(%p)->(%p %x)\n", This, pStm, fClearDirty);
hres = get_doc_string(This, &str);
hres = get_doc_string(This->doc_node, &str);
if(FAILED(hres))
return hres;

View file

@ -620,11 +620,14 @@ static void parse_text(ScriptHost *script_host, LPCWSTR text)
VariantInit(&var);
memset(&excepinfo, 0, sizeof(excepinfo));
TRACE(">>>\n");
hres = IActiveScriptParse64_ParseScriptText(script_host->parse, text, windowW, NULL, script_endW,
0, 0, SCRIPTTEXT_ISVISIBLE|SCRIPTTEXT_HOSTMANAGESSOURCE,
&var, &excepinfo);
if(FAILED(hres))
WARN("ParseScriptText failed: %08x\n", hres);
if(SUCCEEDED(hres))
TRACE("<<<\n");
else
WARN("<<< %08x\n", hres);
}
@ -645,7 +648,7 @@ static void parse_extern_script(ScriptHost *script_host, LPCWSTR src)
if(FAILED(hres))
return;
hres = bind_mon_to_buffer(&script_host->window->doc_obj->basedoc, mon, (void**)&buf, &size);
hres = bind_mon_to_buffer(script_host->window->doc, mon, (void**)&buf, &size);
IMoniker_Release(mon);
if(FAILED(hres))
return;

View file

@ -76,9 +76,9 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
HTMLDocumentNode *This = HOSTSECMGR_THIS(iface);
const WCHAR *url;
TRACE("%p)->(%d %p %d %p %d %x %x)\n", This, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
TRACE("(%p)->(%d %p %d %p %d %x %x)\n", This, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
url = This->basedoc.doc_obj->url ? This->basedoc.doc_obj->url : about_blankW;
url = This->basedoc.window->url ? This->basedoc.window->url : about_blankW;
return IInternetSecurityManager_ProcessUrlAction(This->secmgr, url, dwAction, pPolicy, cbPolicy,
pContext, cbContext, dwFlags, dwReserved);
@ -124,7 +124,7 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos
TRACE("(%p)->(%s %p %p %p %d %x)\n", This, debugstr_guid(guidKey), ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
url = This->basedoc.doc_obj->url ? This->basedoc.doc_obj->url : about_blankW;
url = This->basedoc.window->url ? This->basedoc.window->url : about_blankW;
hres = IInternetSecurityManager_QueryCustomPolicy(This->secmgr, url, guidKey, ppPolicy, pcbPolicy,
pContext, cbContext, dwReserved);

View file

@ -156,12 +156,12 @@ static HRESULT WINAPI HTMLSelectionObject_createRange(IHTMLSelectionObject *ifac
TRACE("nsrange_cnt = 0\n");
if(!This->doc->basedoc.nsdoc) {
if(!This->doc->nsdoc) {
WARN("nsdoc is NULL\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetBody(This->doc->basedoc.nsdoc, &nsbody);
nsres = nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nsbody);
if(NS_FAILED(nsres) || !nsbody) {
ERR("Could not get body: %08x\n", nsres);
return E_FAIL;

View file

@ -27,8 +27,6 @@
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "mshtmcid.h"
#include "shlguid.h"
#include "wine/debug.h"
@ -49,10 +47,14 @@ typedef struct {
struct list entry;
} task_timer_t;
void push_task(task_t *task)
void push_task(task_t *task, task_proc_t proc, LONG magic)
{
thread_data_t *thread_data = get_thread_data(TRUE);
task->target_magic = magic;
task->proc = proc;
task->next = NULL;
if(thread_data->task_queue_tail)
thread_data->task_queue_tail->next = task;
else
@ -87,7 +89,7 @@ static void release_task_timer(HWND thread_hwnd, task_timer_t *timer)
heap_free(timer);
}
void remove_doc_tasks(const HTMLDocument *doc)
void remove_target_tasks(LONG target)
{
thread_data_t *thread_data = get_thread_data(FALSE);
struct list *liter, *ltmp;
@ -99,7 +101,7 @@ void remove_doc_tasks(const HTMLDocument *doc)
LIST_FOR_EACH_SAFE(liter, ltmp, &thread_data->timer_list) {
timer = LIST_ENTRY(liter, task_timer_t, entry);
if(timer->doc == doc)
if(timer->doc->task_magic == target)
release_task_timer(thread_data->thread_hwnd, timer);
}
@ -109,11 +111,11 @@ void remove_doc_tasks(const HTMLDocument *doc)
}
while(thread_data->task_queue_head
&& thread_data->task_queue_head->doc == doc)
&& thread_data->task_queue_head->target_magic == target)
pop_task();
for(iter = thread_data->task_queue_head; iter; iter = iter->next) {
while(iter->next && iter->next->doc == doc) {
while(iter->next && iter->next->target_magic == target) {
tmp = iter->next;
iter->next = tmp->next;
heap_free(tmp);
@ -124,6 +126,12 @@ void remove_doc_tasks(const HTMLDocument *doc)
}
}
LONG get_task_target_magic(void)
{
static LONG magic = 0x10000000;
return InterlockedIncrement(&magic);
}
static BOOL queue_timer(thread_data_t *thread_data, task_timer_t *timer)
{
task_timer_t *iter;
@ -191,178 +199,10 @@ HRESULT clear_task_timer(HTMLDocument *doc, BOOL interval, DWORD id)
return S_OK;
}
static void set_downloading(HTMLDocumentObj *doc)
void parse_complete(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd;
HRESULT hres;
TRACE("(%p)\n", doc);
if(doc->frame)
IOleInPlaceFrame_SetStatusText(doc->frame, NULL /* FIXME */);
if(!doc->client)
return;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
VARIANT var;
V_VT(&var) = VT_I4;
V_I4(&var) = 1;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE, OLECMDEXECOPT_DONTPROMPTUSER,
&var, NULL);
IOleCommandTarget_Release(olecmd);
}
if(doc->hostui) {
IDropTarget *drop_target = NULL;
hres = IDocHostUIHandler_GetDropTarget(doc->hostui, NULL /* FIXME */, &drop_target);
if(drop_target) {
FIXME("Use IDropTarget\n");
IDropTarget_Release(drop_target);
}
}
}
/* Calls undocumented 69 cmd of CGID_Explorer */
static void call_explorer_69(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd;
VARIANT var;
HRESULT hres;
if(!doc->client)
return;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(FAILED(hres))
return;
VariantInit(&var);
hres = IOleCommandTarget_Exec(olecmd, &CGID_Explorer, 69, 0, NULL, &var);
IOleCommandTarget_Release(olecmd);
if(SUCCEEDED(hres) && V_VT(&var) != VT_NULL)
FIXME("handle result\n");
}
static void set_parsecomplete(HTMLDocument *doc)
{
IOleCommandTarget *olecmd = NULL;
TRACE("(%p)\n", doc);
if(doc->doc_obj->usermode == EDITMODE)
init_editor(doc);
call_explorer_69(doc->doc_obj);
call_property_onchanged(&doc->cp_propnotif, 1005);
call_explorer_69(doc->doc_obj);
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
doc->doc_obj->readystate = READYSTATE_INTERACTIVE;
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
if(doc->doc_obj->client)
IOleClientSite_QueryInterface(doc->doc_obj->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(olecmd) {
VARIANT state, progress;
V_VT(&progress) = VT_I4;
V_I4(&progress) = 0;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS, OLECMDEXECOPT_DONTPROMPTUSER,
&progress, NULL);
V_VT(&state) = VT_I4;
V_I4(&state) = 0;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE, OLECMDEXECOPT_DONTPROMPTUSER,
&state, NULL);
IOleCommandTarget_Exec(olecmd, &CGID_ShellDocView, 103, 0, NULL, NULL);
IOleCommandTarget_Exec(olecmd, &CGID_MSHTML, IDM_PARSECOMPLETE, 0, NULL, NULL);
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_HTTPEQUIV_DONE, 0, NULL, NULL);
IOleCommandTarget_Release(olecmd);
}
doc->doc_obj->readystate = READYSTATE_COMPLETE;
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
if(doc->doc_obj->frame) {
static const WCHAR wszDone[] = {'D','o','n','e',0};
IOleInPlaceFrame_SetStatusText(doc->doc_obj->frame, wszDone);
}
update_title(doc->doc_obj);
}
static void set_progress(HTMLDocument *doc)
{
IOleCommandTarget *olecmd = NULL;
HRESULT hres;
TRACE("(%p)\n", doc);
if(doc->doc_obj->client)
IOleClientSite_QueryInterface(doc->doc_obj->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(olecmd) {
VARIANT progress_max, progress;
V_VT(&progress_max) = VT_I4;
V_I4(&progress_max) = 0; /* FIXME */
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSMAX, OLECMDEXECOPT_DONTPROMPTUSER,
&progress_max, NULL);
V_VT(&progress) = VT_I4;
V_I4(&progress) = 0; /* FIXME */
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS, OLECMDEXECOPT_DONTPROMPTUSER,
&progress, NULL);
}
if(doc->doc_obj->usermode == EDITMODE && doc->doc_obj->hostui) {
DOCHOSTUIINFO hostinfo;
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
hres = IDocHostUIHandler_GetHostInfo(doc->doc_obj->hostui, &hostinfo);
if(SUCCEEDED(hres))
/* FIXME: use hostinfo */
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
}
}
static void task_start_binding(HTMLDocument *doc, BSCallback *bscallback)
{
if(doc)
start_binding(doc, bscallback, NULL);
IUnknown_Release((IUnknown*)bscallback);
}
static void process_task(task_t *task)
{
switch(task->task_id) {
case TASK_SETDOWNLOADSTATE:
set_downloading(task->doc->doc_obj);
break;
case TASK_PARSECOMPLETE:
set_parsecomplete(task->doc);
break;
case TASK_SETPROGRESS:
set_progress(task->doc);
break;
case TASK_START_BINDING:
task_start_binding(task->doc, (BSCallback*)task->bscallback);
break;
default:
ERR("Wrong task_id %d\n", task->task_id);
}
}
static void call_timer_disp(IDispatch *disp)
@ -433,7 +273,7 @@ static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if(!task)
break;
process_task(task);
task->proc(task);
heap_free(task);
}

View file

@ -342,7 +342,7 @@ static nsIDOMNode *prev_node(HTMLTxtRange *This, nsIDOMNode *iter)
if(!iter) {
nsIDOMHTMLElement *nselem;
nsIDOMHTMLDocument_GetBody(This->doc->basedoc.nsdoc, &nselem);
nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nselem);
nsIDOMElement_GetLastChild(nselem, &tmp);
if(!tmp)
return (nsIDOMNode*)nselem;
@ -1139,7 +1139,7 @@ static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v)
return MSHTML_E_NODOC;
nsAString_Init(&text_str, v);
nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc->basedoc.nsdoc, &text_str, &text_node);
nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc->nsdoc, &text_str, &text_node);
nsAString_Finish(&text_str);
if(NS_FAILED(nsres)) {
ERR("CreateTextNode failed: %08x\n", nsres);
@ -1348,7 +1348,7 @@ static HRESULT WINAPI HTMLTxtRange_expand(IHTMLTxtRange *iface, BSTR Unit, VARIA
nsIDOMHTMLElement *nsbody = NULL;
nsresult nsres;
nsres = nsIDOMHTMLDocument_GetBody(This->doc->basedoc.nsdoc, &nsbody);
nsres = nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nsbody);
if(NS_FAILED(nsres) || !nsbody) {
ERR("Could not get body: %08x\n", nsres);
break;
@ -1778,28 +1778,22 @@ static HRESULT WINAPI RangeCommandTarget_QueryStatus(IOleCommandTarget *iface, c
static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
{
nsIDOMHTMLElement *blockquote_elem, *p_elem;
nsIDOMDocumentFragment *fragment;
nsIDOMElement *blockquote_elem, *p_elem;
nsIDOMNode *tmp;
nsAString tag_str;
static const PRUnichar blockquoteW[] = {'B','L','O','C','K','Q','U','O','T','E',0};
static const PRUnichar pW[] = {'P',0};
TRACE("(%p)->(%p %p)\n", This, in, out);
if(!This->doc->basedoc.nsdoc) {
if(!This->doc->nsdoc) {
WARN("NULL nsdoc\n");
return E_NOTIMPL;
}
nsAString_Init(&tag_str, blockquoteW);
nsIDOMHTMLDocument_CreateElement(This->doc->basedoc.nsdoc, &tag_str, &blockquote_elem);
nsAString_Finish(&tag_str);
nsAString_Init(&tag_str, pW);
nsIDOMDocument_CreateElement(This->doc->basedoc.nsdoc, &tag_str, &p_elem);
nsAString_Finish(&tag_str);
create_nselem(This->doc, blockquoteW, &blockquote_elem);
create_nselem(This->doc, pW, &p_elem);
nsIDOMRange_ExtractContents(This->nsrange, &fragment);
nsIDOMElement_AppendChild(p_elem, (nsIDOMNode*)fragment, &tmp);

View file

@ -98,6 +98,8 @@
#define DISPID_DOMTEXTNODE DISPID_NORMAL_FIRST
#define DISPID_GENERIC DISPID_NORMAL_FIRST
#define DISPID_DOMIMPLEMENTATION DISPID_NORMAL_FIRST
#define DISPID_DOCUMENTCOMPATIBLEINFO DISPID_NORMAL_FIRST
#define DISPID_DOCUMENTCOMPATIBLEINFOCOLLECTION DISPID_NORMAL_FIRST
#define DISPID_IE8_ANCHOR DISPID_IE8_NORMAL_FIRST
#define DISPID_IE8_AREA DISPID_IE8_NORMAL_FIRST
@ -562,100 +564,9 @@
#define DISPID_EVPROP_ONBEFOREACTIVATE (DISPID_EVENTS+90)
#define DISPID_EVPROP_ONFOCUSIN (DISPID_EVENTS+91)
#define DISPID_EVPROP_ONFOCUSOUT (DISPID_EVENTS+92)
#define DISPID_EVPROPS_COUNT 93
#define DISPID_EVMETH_ONMOUSEOVER STDDISPID_XOBJ_ONMOUSEOVER
#define DISPID_EVMETH_ONMOUSEOUT STDDISPID_XOBJ_ONMOUSEOUT
#define DISPID_EVMETH_ONMOUSEDOWN DISPID_MOUSEDOWN
#define DISPID_EVMETH_ONMOUSEUP DISPID_MOUSEUP
#define DISPID_EVMETH_ONMOUSEMOVE DISPID_MOUSEMOVE
#define DISPID_EVMETH_ONKEYDOWN DISPID_KEYDOWN
#define DISPID_EVMETH_ONKEYUP DISPID_KEYUP
#define DISPID_EVMETH_ONKEYPRESS DISPID_KEYPRESS
#define DISPID_EVMETH_ONCLICK DISPID_CLICK
#define DISPID_EVMETH_ONDBLCLICK DISPID_DBLCLICK
#define DISPID_EVMETH_ONSELECT DISPID_ONSELECT
#define DISPID_EVMETH_ONSUBMIT DISPID_ONSUBMIT
#define DISPID_EVMETH_ONRESET DISPID_ONRESET
#define DISPID_EVMETH_ONHELP STDDISPID_XOBJ_ONHELP
#define DISPID_EVMETH_ONFOCUS STDDISPID_XOBJ_ONFOCUS
#define DISPID_EVMETH_ONBLUR STDDISPID_XOBJ_ONBLUR
#define DISPID_EVMETH_ONROWEXIT STDDISPID_XOBJ_ONROWEXIT
#define DISPID_EVMETH_ONROWENTER STDDISPID_XOBJ_ONROWENTER
#define DISPID_EVMETH_ONBOUNCE DISPID_ONBOUNCE
#define DISPID_EVMETH_ONBEFOREUPDATE STDDISPID_XOBJ_BEFOREUPDATE
#define DISPID_EVMETH_ONAFTERUPDATE STDDISPID_XOBJ_AFTERUPDATE
#define DISPID_EVMETH_ONBEFOREDRAGOVER EVENTID_CommonCtrlEvent_BeforeDragOver
#define DISPID_EVMETH_ONBEFOREDROPORPASTE EVENTID_CommonCtrlEvent_BeforeDropOrPaste
#define DISPID_EVMETH_ONREADYSTATECHANGE DISPID_READYSTATECHANGE
#define DISPID_EVMETH_ONFINISH DISPID_ONFINISH
#define DISPID_EVMETH_ONSTART DISPID_ONSTART
#define DISPID_EVMETH_ONABORT DISPID_ONABORT
#define DISPID_EVMETH_ONERROR DISPID_ONERROR
#define DISPID_EVMETH_ONCHANGE DISPID_ONCHANGE
#define DISPID_EVMETH_ONSCROLL DISPID_ONSCROLL
#define DISPID_EVMETH_ONLOAD DISPID_ONLOAD
#define DISPID_EVMETH_ONUNLOAD DISPID_ONUNLOAD
#define DISPID_EVMETH_ONLAYOUT DISPID_ONLAYOUT
#define DISPID_EVMETH_ONDRAGSTART STDDISPID_XOBJ_ONDRAGSTART
#define DISPID_EVMETH_ONRESIZE DISPID_ONRESIZE
#define DISPID_EVMETH_ONSELECTSTART STDDISPID_XOBJ_ONSELECTSTART
#define DISPID_EVMETH_ONERRORUPDATE STDDISPID_XOBJ_ERRORUPDATE
#define DISPID_EVMETH_ONBEFOREUNLOAD DISPID_ONBEFOREUNLOAD
#define DISPID_EVMETH_ONDATASETCHANGED STDDISPID_XOBJ_ONDATASETCHANGED
#define DISPID_EVMETH_ONDATAAVAILABLE STDDISPID_XOBJ_ONDATAAVAILABLE
#define DISPID_EVMETH_ONDATASETCOMPLETE STDDISPID_XOBJ_ONDATASETCOMPLETE
#define DISPID_EVMETH_ONFILTER STDDISPID_XOBJ_ONFILTER
#define DISPID_EVMETH_ONCHANGEFOCUS DISPID_ONCHANGEFOCUS
#define DISPID_EVMETH_ONCHANGEBLUR DISPID_ONCHANGEBLUR
#define DISPID_EVMETH_ONLOSECAPTURE STDDISPID_XOBJ_ONLOSECAPTURE
#define DISPID_EVMETH_ONPROPERTYCHANGE STDDISPID_XOBJ_ONPROPERTYCHANGE
#define DISPID_EVMETH_ONPERSISTSAVE DISPID_ONPERSISTSAVE
#define DISPID_EVMETH_ONDRAG STDDISPID_XOBJ_ONDRAG
#define DISPID_EVMETH_ONDRAGEND STDDISPID_XOBJ_ONDRAGEND
#define DISPID_EVMETH_ONDRAGENTER STDDISPID_XOBJ_ONDRAGENTER
#define DISPID_EVMETH_ONDRAGOVER STDDISPID_XOBJ_ONDRAGOVER
#define DISPID_EVMETH_ONDRAGLEAVE STDDISPID_XOBJ_ONDRAGLEAVE
#define DISPID_EVMETH_ONDROP STDDISPID_XOBJ_ONDROP
#define DISPID_EVMETH_ONCUT STDDISPID_XOBJ_ONCUT
#define DISPID_EVMETH_ONCOPY STDDISPID_XOBJ_ONCOPY
#define DISPID_EVMETH_ONPASTE STDDISPID_XOBJ_ONPASTE
#define DISPID_EVMETH_ONBEFORECUT STDDISPID_XOBJ_ONBEFORECUT
#define DISPID_EVMETH_ONBEFORECOPY STDDISPID_XOBJ_ONBEFORECOPY
#define DISPID_EVMETH_ONBEFOREPASTE STDDISPID_XOBJ_ONBEFOREPASTE
#define DISPID_EVMETH_ONPERSISTLOAD DISPID_ONPERSISTLOAD
#define DISPID_EVMETH_ONROWSDELETE STDDISPID_XOBJ_ONROWSDELETE
#define DISPID_EVMETH_ONROWSINSERTED STDDISPID_XOBJ_ONROWSINSERTED
#define DISPID_EVMETH_ONCELLCHANGE STDDISPID_XOBJ_ONCELLCHANGE
#define DISPID_EVMETH_ONCONTEXTMENU DISPID_ONCONTEXTMENU
#define DISPID_EVMETH_ONBEFOREPRINT DISPID_ONBEFOREPRINT
#define DISPID_EVMETH_ONAFTERPRINT DISPID_ONAFTERPRINT
#define DISPID_EVMETH_ONSTOP DISPID_ONSTOP
#define DISPID_EVMETH_ONBEFOREEDITFOCUS DISPID_ONBEFOREEDITFOCUS
#define DISPID_EVMETH_ONMOUSEHOVER DISPID_ONMOUSEHOVER
#define DISPID_EVMETH_ONCONTENTREADY DISPID_ONCONTENTREADY
#define DISPID_EVMETH_ONLAYOUTCOMPLETE DISPID_ONLAYOUTCOMPLETE
#define DISPID_EVMETH_ONPAGE DISPID_ONPAGE
#define DISPID_EVMETH_ONLINKEDOVERFLOW DISPID_ONLINKEDOVERFLOW
#define DISPID_EVMETH_ONMOUSEWHEEL DISPID_ONMOUSEWHEEL
#define DISPID_EVMETH_ONBEFOREDEACTIVAT DISPID_ONBEFOREDEACTIVATE
#define DISPID_EVMETH_ONMOVE DISPID_ONMOVE
#define DISPID_EVMETH_ONCONTROLSELECT DISPID_ONCONTROLSELECT
#define DISPID_EVMETH_ONSELECTIONCHANGE DISPID_ONSELECTIONCHANGE
#define DISPID_EVMETH_ONMOVESTART DISPID_ONMOVESTART
#define DISPID_EVMETH_ONMOVEEND DISPID_ONMOVEEND
#define DISPID_EVMETH_ONRESIZESTART DISPID_ONRESIZESTART
#define DISPID_EVMETH_ONRESIZEEND DISPID_ONRESIZEEND
#define DISPID_EVMETH_ONMOUSEENTER DISPID_ONMOUSEENTER
#define DISPID_EVMETH_ONMOUSELEAVE DISPID_ONMOUSELEAVE
#define DISPID_EVMETH_ONACTIVATE DISPID_ONACTIVATE
#define DISPID_EVMETH_ONDEACTIVATE DISPID_ONDEACTIVATE
#define DISPID_EVMETH_ONMULTILAYOUTCLEANUP DISPID_ONMULTILAYOUTCLEANUP
#define DISPID_EVMETH_ONBEFOREACTIVATE DISPID_ONBEFOREACTIVATE
#define DISPID_EVMETH_ONFOCUSIN DISPID_ONFOCUSIN
#define DISPID_EVMETH_ONFOCUSOUT DISPID_ONFOCUSOUT
#define DISPID_EVPROPS_COUNT 93
#define DISPID_EVPROP_ONSTORAGE (DISPID_EVENTS+93)
#define DISPID_EVPROP_ONSTORAGECOMMIT (DISPID_EVENTS+94)
#define DISPID_EVPROPS_COUNT 95
#define DISPID_EVMETH_ONMOUSEOVER STDDISPID_XOBJ_ONMOUSEOVER
#define DISPID_EVMETH_ONMOUSEOUT STDDISPID_XOBJ_ONMOUSEOUT
@ -747,6 +658,8 @@
#define DISPID_EVMETH_ONBEFOREACTIVATE DISPID_ONBEFOREACTIVATE
#define DISPID_EVMETH_ONFOCUSIN DISPID_ONFOCUSIN
#define DISPID_EVMETH_ONFOCUSOUT DISPID_ONFOCUSOUT
#define DISPID_EVMETH_ONSTORAGE DISPID_ONSTORAGE
#define DISPID_EVMETH_ONSTORAGECOMMIT DISPID_ONSTORAGECOMMIT
#define DISPID_ONABORT (DISPID_NORMAL_FIRST)
#define DISPID_ONCHANGE (DISPID_NORMAL_FIRST+1)
@ -795,6 +708,8 @@
#define DISPID_ONBEFOREACTIVATE (DISPID_NORMAL_FIRST+47)
#define DISPID_ONFOCUSIN (DISPID_NORMAL_FIRST+48)
#define DISPID_ONFOCUSOUT (DISPID_NORMAL_FIRST+49)
#define DISPID_ONSTORAGE (DISPID_NORMAL_FIRST+50)
#define DISPID_ONSTORAGECOMMIT (DISPID_NORMAL_FIRST+51)
/* HTMLDocumentEvents */
#define DISPID_HTMLDOCUMENTEVENTS_ONHELP DISPID_EVMETH_ONHELP
@ -1014,6 +929,13 @@
#define DISPID_IHTMLDOCUMENT5_ONBEFOREDEACTIVATE DISPID_EVPROP_ONBEFOREDEACTIVATE
#define DISPID_IHTMLDOCUMENT5_COMPATMODE DISPID_OMDOCUMENT+102
/* IHTMLDocument6 */
#define DISPID_IHTMLDOCUMENT6_COMPATIBLE DISPID_OMDOCUMENT+103
#define DISPID_IHTMLDOCUMENT6_DOCUMENTMODE DISPID_OMDOCUMENT+104
#define DISPID_IHTMLDOCUMENT6_ONSTORAGE DISPID_EVPROP_ONSTORAGE
#define DISPID_IHTMLDOCUMENT6_ONSTORAGECOMMIT DISPID_EVPROP_ONSTORAGECOMMIT
#define DISPID_IHTMLDOCUMENT6_IE8_GETELEMENTBYID DISPID_OMDOCUMENT+105
#define DISPID_IHTMLDOCUMENT6_UPDATESETTINGS DISPID_OMDOCUMENT+106
/* IHTMLElementCollection */
#define DISPID_IHTMLELEMENTCOLLECTION_LENGTH DISPID_COLLECTION
@ -2095,6 +2017,14 @@
#define DISPID_IHTMLDOMATTRIBUTE2_HASCHILDNODES DISPID_DOMATTRIBUTE+19
#define DISPID_IHTMLDOMATTRIBUTE2_CLONENODE DISPID_DOMATTRIBUTE+20
/* IHTMLDocumentCompatibleInfo */
#define DISPID_IHTMLDOCUMENTCOMPATIBLEINFO_USERAGENT DISPID_DOCUMENTCOMPATIBLEINFO
#define DISPID_IHTMLDOCUMENTCOMPATIBLEINFO_VERSION DISPID_DOCUMENTCOMPATIBLEINFO+1
/* IHTMLDocumentCompatibleInfoCollection */
#define DISPID_IHTMLDOCUMENTCOMPATIBLEINFOCOLLECTION_ITEM DISPID_DOCUMENTCOMPATIBLEINFOCOLLECTION
#define DISPID_IHTMLDOCUMENTCOMPATIBLEINFOCOLLECTION_LENGTH DISPID_DOCUMENTCOMPATIBLEINFOCOLLECTION+1
/* IHTMLBodyElement */
#define DISPID_IHTMLBODYELEMENT_BACKGROUND DISPID_A_BACKGROUNDIMAGE
#define DISPID_IHTMLBODYELEMENT_BGPROPERTIES DISPID_A_BACKGROUNDATTACHMENT

View file

@ -3685,6 +3685,42 @@ interface IHTMLDOMImplementation : IDispatch
[retval, out] VARIANT_BOOL *pfHasFeature);
}
/*****************************************************************************
* IHTMLDocumentCompatibleInfo interface
*/
[
odl,
oleautomation,
dual,
uuid(3051041a-98b5-11cf-bb82-00aa00bdce0b)
]
interface IHTMLDocumentCompatibleInfo : IDispatch
{
[propget, id(DISPID_IHTMLDOCUMENTCOMPATIBLEINFO_USERAGENT)]
HRESULT userAgent([retval, out] BSTR *p);
[propget, id(DISPID_IHTMLDOCUMENTCOMPATIBLEINFO_VERSION)]
HRESULT version([retval, out] BSTR *p);
}
/*****************************************************************************
* IHTMLDocumentCompatibleInfoCollection interface
*/
[
odl,
oleautomation,
dual,
uuid(30510418-98b5-11cf-bb82-00aa00bdce0b)
]
interface IHTMLDocumentCompatibleInfoCollection : IDispatch
{
[propget, id(DISPID_IHTMLDOCUMENTCOMPATIBLEINFOCOLLECTION_LENGTH)]
HRESULT length([retval, out] long *p);
[id(DISPID_IHTMLDOCUMENTCOMPATIBLEINFOCOLLECTION_ITEM)]
HRESULT item([in] long i, [retval, out]IHTMLDocumentCompatibleInfo **p);
}
/*****************************************************************************
* DispHTMLDOMTextNode dispinterface
*/
@ -6586,7 +6622,7 @@ interface IHTMLImgElement : IDispatch
odl,
oleautomation,
dual,
uuid(3050F38E-98B5-11CF-BB82-00AAA0BDCE0B)
uuid(3050F38E-98B5-11CF-BB82-00AA00BDCE0B)
]
interface IHTMLImageElementFactory : IDispatch
{
@ -11740,6 +11776,44 @@ interface IHTMLDocument5 : IDispatch
HRESULT compatMode([retval, out] BSTR *p);
}
/*****************************************************************************
* IHTMLDocument6 interface
*/
[
odl,
oleautomation,
dual,
uuid(30510417-98b5-11cf-bb82-00aa00bdce0b)
]
interface IHTMLDocument6 : IDispatch
{
[propget, id(DISPID_IHTMLDOCUMENT6_COMPATIBLE)]
HRESULT compatible([retval, out] IHTMLDocumentCompatibleInfoCollection **p);
[propget, id(DISPID_IHTMLDOCUMENT6_DOCUMENTMODE)]
HRESULT documentMode([retval, out] VARIANT *p);
[propput, id(DISPID_IHTMLDOCUMENT6_ONSTORAGE), displaybind, bindable]
HRESULT onstorage([in] VARIANT v);
[propget, id(DISPID_IHTMLDOCUMENT6_ONSTORAGE), displaybind, bindable]
HRESULT onstorage([out] VARIANT *p);
[propput, id(DISPID_IHTMLDOCUMENT6_ONSTORAGECOMMIT), displaybind, bindable]
HRESULT onstoragecommit([in] VARIANT v);
[propget, id(DISPID_IHTMLDOCUMENT6_ONSTORAGECOMMIT), displaybind, bindable]
HRESULT onstoragecommit([out] VARIANT *p);
[id(DISPID_IHTMLDOCUMENT6_IE8_GETELEMENTBYID)]
HRESULT getElementById(
[in] BSTR bstrId,
[retval, out] IHTMLElement2 **p);
[id(DISPID_IHTMLDOCUMENT6_UPDATESETTINGS)]
HRESULT updateSettings();
}
/*****************************************************************************
* DispHTMLDocument dispinterface
*/
@ -12316,6 +12390,30 @@ methods:
[propget, id(DISPID_IHTMLDOCUMENT5_COMPATMODE)]
BSTR compatMode();
[propget, id(DISPID_IHTMLDOCUMENT6_COMPATIBLE)]
IHTMLDocumentCompatibleInfoCollection *compatible();
[propget, id(DISPID_IHTMLDOCUMENT6_DOCUMENTMODE)]
VARIANT documentMode();
[propput, id(DISPID_IHTMLDOCUMENT6_ONSTORAGE), displaybind, bindable]
void onstorage(VARIANT v);
[propget, id(DISPID_IHTMLDOCUMENT6_ONSTORAGE), displaybind, bindable]
VARIANT onstorage();
[propput, id(DISPID_IHTMLDOCUMENT6_ONSTORAGECOMMIT), displaybind, bindable]
void onstoragecommit(VARIANT v);
[propget, id(DISPID_IHTMLDOCUMENT6_ONSTORAGECOMMIT), displaybind, bindable]
VARIANT onstoragecommit();
[id(DISPID_IHTMLDOCUMENT6_IE8_GETELEMENTBYID)]
IHTMLElement2 *ie8_getElementById([in] BSTR bstrId);
[id(DISPID_IHTMLDOCUMENT6_UPDATESETTINGS)]
void updateSettings();
WINE_HTMLDOMNODE_DISPINTERFACE_DECL;
}
@ -12334,6 +12432,7 @@ coclass HTMLDocument
interface IHTMLDocument3;
interface IHTMLDocument4;
interface IHTMLDocument5;
interface IHTMLDocument6;
interface IHTMLDOMNode;
interface IHTMLDOMNode2;
}