winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
5 participants
856 discussions
Start a n
N
ew thread
Alexandre Julliard : shlwapi: Get rid of CharNextW/CharPrevW. Simplify some string functions.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: ae0c24fd06294c8ba6d0294c59c3a31c4327c337 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ae0c24fd06294c8ba6d0294c5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 25 14:01:28 2007 +0200 shlwapi: Get rid of CharNextW/CharPrevW. Simplify some string functions. --- dlls/shlwapi/path.c | 48 ++++------ dlls/shlwapi/string.c | 249 ++++++++++++++++--------------------------------- 2 files changed, 99 insertions(+), 198 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ae0c24fd06294c8ba6d02…
1
0
0
0
Francois Gouget : ddraw/tests: Fix compilation on systems that don' t support nameless unions.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: 73032be74a7783b7a1d01faa9caf0cfac65ac6c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=73032be74a7783b7a1d01faa9…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Jun 25 12:09:21 2007 +0200 ddraw/tests: Fix compilation on systems that don't support nameless unions. --- dlls/ddraw/tests/d3d.c | 8 ++++---- dlls/ddraw/tests/dsurface.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 35d6192..e994097 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -93,10 +93,10 @@ static BOOL CreateDirect3D(void) ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; - ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); - ddsd.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; - ddsd.ddpfPixelFormat.dwZBufferBitDepth = 16; - ddsd.ddpfPixelFormat.dwZBitMask = 0x0000FFFF; + U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat); + U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; + U1(U4(ddsd).ddpfPixelFormat).dwZBufferBitDepth = 16; + U3(U4(ddsd).ddpfPixelFormat).dwZBitMask = 0x0000FFFF; ddsd.dwWidth = 256; ddsd.dwHeight = 256; rc = IDirectDraw7_CreateSurface(lpDD, &ddsd, &lpDDSdepth, NULL); diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index a21a76d..b0a2195 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -2259,7 +2259,7 @@ static void BltParamTest(void) /* Blt(non-fast) tests */ memset(&BltFx, 0, sizeof(BltFx)); BltFx.dwSize = sizeof(BltFx); - BltFx.dwFillColor = 0xaabbccdd; + U5(BltFx).dwFillColor = 0xaabbccdd; hr = IDirectDrawSurface_Blt(surface1, &valid, NULL, NULL, DDBLT_COLORFILL, &BltFx); ok(hr == DD_OK, "IDirectDrawSurface_Blt with a valid rectangle for color fill returned %08x\n", hr);
1
0
0
0
Jacek Caban : mshtml: Added more QueryInterface tests.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: d7e75747aa30bb941fa0c5c1864d11b06f773518 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d7e75747aa30bb941fa0c5c18…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jun 24 21:10:16 2007 +0200 mshtml: Added more QueryInterface tests. --- dlls/mshtml/tests/htmldoc.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index 8d3237a..0faa66e 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -3406,12 +3406,23 @@ static void test_StreamLoad(IUnknown *unk) static void test_QueryInterface(IUnknown *unk) { - IRunnableObject *runnable = (IRunnableObject*)0xdeadbeef; + IUnknown *qi; HRESULT hres; - hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&runnable); + qi = (void*)0xdeadbeef; + hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&qi); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(runnable == NULL, "runnable=%p, ezpected NULL\n", runnable); + ok(qi == NULL, "runnable=%p, ezpected NULL\n", qi); + + qi = (void*)0xdeadbeef; + hres = IUnknown_QueryInterface(unk, &IID_IHTMLDOMNode, (void**)&qi); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(qi == NULL, "runnable=%p, ezpected NULL\n", qi); + + qi = (void*)0xdeadbeef; + hres = IUnknown_QueryInterface(unk, &IID_IHTMLDOMNode2, (void**)&qi); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(qi == NULL, "runnable=%p, ezpected NULL\n", qi); } static void init_test(enum load_state_t ls) {
1
0
0
0
Alexandre Julliard : comctl32: Get rid of CharNextW/CharPrevW. Simplify some string functions.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: 52e5d3849ffb2eb22aba2e624ff5248ec685f2d1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=52e5d3849ffb2eb22aba2e624…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 25 13:51:00 2007 +0200 comctl32: Get rid of CharNextW/CharPrevW. Simplify some string functions. --- dlls/comctl32/string.c | 167 ++++++++++++++---------------------------------- 1 files changed, 49 insertions(+), 118 deletions(-) diff --git a/dlls/comctl32/string.c b/dlls/comctl32/string.c index 654c467..f6dbd8c 100644 --- a/dlls/comctl32/string.c +++ b/dlls/comctl32/string.c @@ -81,22 +81,6 @@ static BOOL COMCTL32_ChrCmpHelperA(WORD ch1, WORD ch2, DWORD dwFlags) } /************************************************************************* - * COMCTL32_ChrCmpHelperW - * - * Internal helper for COMCTL32_ChrCmpW/ChrCmpIW. - */ -static BOOL COMCTL32_ChrCmpHelperW(WCHAR ch1, WCHAR ch2, DWORD dwFlags) -{ - WCHAR str1[2], str2[2]; - - str1[0] = ch1; - str1[1] = '\0'; - str2[0] = ch2; - str2[1] = '\0'; - return CompareStringW(GetThreadLocale(), dwFlags, str1, 2, str2, 2) - 2; -} - -/************************************************************************* * COMCTL32_ChrCmpA (internal) * * Internal helper function. @@ -127,23 +111,13 @@ static BOOL COMCTL32_ChrCmpIA(WORD ch1, WORD ch2) } /************************************************************************* - * COMCTL32_ChrCmpW - * - * Internal helper function. - */ -static BOOL COMCTL32_ChrCmpW(WCHAR ch1, WCHAR ch2) -{ - return COMCTL32_ChrCmpHelperW(ch1, ch2, 0); -} - -/************************************************************************* * COMCTL32_ChrCmpIW * * Internal helper function. */ -static BOOL COMCTL32_ChrCmpIW(WCHAR ch1, WCHAR ch2) +static inline BOOL COMCTL32_ChrCmpIW(WCHAR ch1, WCHAR ch2) { - return COMCTL32_ChrCmpHelperW(ch1, ch2, NORM_IGNORECASE); + return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, &ch1, 1, &ch2, 1) - 2; } /************************************************************************** @@ -372,30 +346,6 @@ static LPSTR COMCTL32_StrStrHelperA(LPCSTR lpszStr, LPCSTR lpszSearch, return NULL; } -/************************************************************************* - * COMCTL32_StrStrHelperW - * - * Internal implementation of StrStrW/StrStrIW - */ -static LPWSTR COMCTL32_StrStrHelperW(LPCWSTR lpszStr, LPCWSTR lpszSearch, - INT (WINAPI *pStrCmpFn)(LPCWSTR,LPCWSTR,INT)) -{ - int iLen; - - if (!lpszStr || !lpszSearch || !*lpszSearch) - return NULL; - - iLen = strlenW(lpszSearch); - - while (*lpszStr) - { - if (!pStrCmpFn(lpszStr, lpszSearch, iLen)) - return (LPWSTR)lpszStr; - lpszStr = CharNextW(lpszStr); - } - return NULL; -} - /************************************************************************** * StrStrIA [COMCTL32.355] * @@ -439,9 +389,22 @@ INT WINAPI StrToIntA (LPCSTR lpszStr) */ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch) { + int iLen; + TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch)); - return COMCTL32_StrStrHelperW(lpszStr, lpszSearch, StrCmpNIW); + if (!lpszStr || !lpszSearch || !*lpszSearch) + return NULL; + + iLen = strlenW(lpszSearch); + + while (*lpszStr) + { + if (!StrCmpNIW(lpszStr, lpszSearch, iLen)) + return (LPWSTR)lpszStr; + lpszStr++; + } + return NULL; } /************************************************************************** @@ -602,25 +565,18 @@ LPSTR WINAPI StrRChrA(LPCSTR lpszStr, LPCSTR lpszEnd, WORD ch) * * See StrRChrA. */ -LPWSTR WINAPI StrRChrW(LPCWSTR lpszStr, LPCWSTR lpszEnd, WORD ch) +LPWSTR WINAPI StrRChrW(LPCWSTR str, LPCWSTR end, WORD ch) { - LPCWSTR lpszRet = NULL; - - TRACE("(%s,%s,%x)\n", debugstr_w(lpszStr), debugstr_w(lpszEnd), ch); - - if (lpszStr) - { - if (!lpszEnd) - lpszEnd = lpszStr + strlenW(lpszStr); + WCHAR *ret = NULL; - while (*lpszStr && lpszStr <= lpszEnd) + if (!str) return NULL; + if (!end) end = str + strlenW(str); + while (str < end) { - if (!COMCTL32_ChrCmpW(ch, *lpszStr)) - lpszRet = lpszStr; - lpszStr = CharNextW(lpszStr); + if (*str == ch) ret = (WCHAR *)str; + str++; } - } - return (LPWSTR)lpszRet; + return ret; } /************************************************************************** @@ -649,9 +605,8 @@ LPSTR WINAPI StrStrA(LPCSTR lpszStr, LPCSTR lpszSearch) */ LPWSTR WINAPI StrStrW(LPCWSTR lpszStr, LPCWSTR lpszSearch) { - TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch)); - - return COMCTL32_StrStrHelperW(lpszStr, lpszSearch, StrCmpNW); + if (!lpszStr || !lpszSearch) return NULL; + return strstrW( lpszStr, lpszSearch ); } /************************************************************************* @@ -700,7 +655,7 @@ LPWSTR WINAPI StrChrIW(LPCWSTR lpszStr, WCHAR ch) { if (toupperW(*lpszStr) == ch) return (LPWSTR)lpszStr; - lpszStr = CharNextW(lpszStr); + lpszStr++; } lpszStr = NULL; } @@ -780,38 +735,12 @@ LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch) if (!StrCmpNIW(lpszStr, lpszSearch, iLen)) lpszRet = (LPWSTR)lpszStr; } - lpszStr = CharNextW(lpszStr); + lpszStr++; } return lpszRet; } /************************************************************************* - * COMCTL32_StrSpnHelperW - * - * Internal implementation of StrSpnW/StrCSpnW/StrCSpnIW - */ -static int COMCTL32_StrSpnHelperW(LPCWSTR lpszStr, LPCWSTR lpszMatch, - LPWSTR (WINAPI *pStrChrFn)(LPCWSTR,WCHAR), - BOOL bInvert) -{ - LPCWSTR lpszRead = lpszStr; - if (lpszStr && *lpszStr && lpszMatch) - { - while (*lpszRead) - { - LPCWSTR lpszTest = pStrChrFn(lpszMatch, *lpszRead); - - if (!bInvert && !lpszTest) - break; - if (bInvert && lpszTest) - break; - lpszRead = CharNextW(lpszRead); - }; - } - return lpszRead - lpszStr; -} - -/************************************************************************* * StrCSpnIA [COMCTL32.374] * * Find the length of the start of a string that does not contain certain @@ -839,9 +768,19 @@ int WINAPI StrCSpnIA(LPCSTR lpszStr, LPCSTR lpszMatch) */ int WINAPI StrCSpnIW(LPCWSTR lpszStr, LPCWSTR lpszMatch) { + LPCWSTR lpszRead = lpszStr; + TRACE("(%s,%s)\n",debugstr_w(lpszStr), debugstr_w(lpszMatch)); - return COMCTL32_StrSpnHelperW(lpszStr, lpszMatch, StrChrIW, TRUE); + if (lpszStr && *lpszStr && lpszMatch) + { + while (*lpszRead) + { + if (StrChrIW(lpszMatch, *lpszRead)) break; + lpszRead++; + } + } + return lpszRead - lpszStr; } /************************************************************************** @@ -889,25 +828,18 @@ LPSTR WINAPI StrRChrIA(LPCSTR lpszStr, LPCSTR lpszEnd, WORD ch) * * See StrRChrIA. */ -LPWSTR WINAPI StrRChrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, WORD ch) +LPWSTR WINAPI StrRChrIW(LPCWSTR str, LPCWSTR end, WORD ch) { - LPCWSTR lpszRet = NULL; - - TRACE("(%s,%s,%x)\n", debugstr_w(lpszStr), debugstr_w(lpszEnd), ch); - - if (lpszStr) - { - if (!lpszEnd) - lpszEnd = lpszStr + strlenW(lpszStr); + WCHAR *ret = NULL; - while (*lpszStr && lpszStr <= lpszEnd) + if (!str) return NULL; + if (!end) end = str + strlenW(str); + while (str < end) { - if (ch == *lpszStr) - lpszRet = lpszStr; - lpszStr = CharNextW(lpszStr); + if (!COMCTL32_ChrCmpIW(*str, ch)) ret = (WCHAR *)str; + str++; } - } - return (LPWSTR)lpszRet; + return ret; } /************************************************************************* @@ -917,9 +849,8 @@ LPWSTR WINAPI StrRChrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, WORD ch) */ int WINAPI StrCSpnW(LPCWSTR lpszStr, LPCWSTR lpszMatch) { - TRACE("(%s,%s)\n",debugstr_w(lpszStr), debugstr_w(lpszMatch)); - - return COMCTL32_StrSpnHelperW(lpszStr, lpszMatch, StrChrW, TRUE); + if (!lpszStr || !lpszMatch) return 0; + return strcspnW( lpszStr, lpszMatch ); } /*************************************************************************
1
0
0
0
Jacek Caban : mshtml: Added beginning DOM tests.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: 1534267ba500156e7965fdc399247ca69eb7c014 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1534267ba500156e7965fdc39…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jun 24 21:09:03 2007 +0200 mshtml: Added beginning DOM tests. --- dlls/mshtml/tests/Makefile.in | 1 + dlls/mshtml/tests/dom.c | 263 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 264 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/tests/Makefile.in b/dlls/mshtml/tests/Makefile.in index 8ddcb50..0aa4645 100644 --- a/dlls/mshtml/tests/Makefile.in +++ b/dlls/mshtml/tests/Makefile.in @@ -7,6 +7,7 @@ IMPORTS = ole32 oleaut32 user32 urlmon advapi32 kernel32 EXTRALIBS = -luuid CTESTS = \ + dom.c \ htmldoc.c \ misc.c \ protocol.c diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c new file mode 100644 index 0000000..09f905a --- /dev/null +++ b/dlls/mshtml/tests/dom.c @@ -0,0 +1,263 @@ +/* + * Copyright 2007 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 + */ + +#define COBJMACROS +#define CONST_VTABLE + +#include <wine/test.h> +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#include "ole2.h" +#include "mshtml.h" +#include "docobj.h" + +static const char doc_str1[] = "<html><body>test</body></html>"; + +static const char *dbgstr_w(LPCWSTR str) +{ + static char buf[512]; + WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL); + return buf; +} + +static int strcmp_wa(LPCWSTR strw, const char *stra) +{ + WCHAR buf[512]; + MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, sizeof(buf)/sizeof(WCHAR)); + return lstrcmpW(strw, buf); +} + +static IHTMLDocument2 *create_document(void) +{ + IHTMLDocument2 *doc; + HRESULT hres; + + hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + &IID_IHTMLDocument2, (void**)&doc); + ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); + + return doc; +} + +static void test_node_name(IUnknown *unk, const char *exname) +{ + IHTMLDOMNode *node; + BSTR name; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IHTMLDOMNode, (void**)&node); + ok(hres == S_OK, "QueryInterface(IID_IHTMLNode) failed: %08x\n", hres); + + hres = IHTMLDOMNode_get_nodeName(node, &name); + IHTMLDOMNode_Release(node); + ok(hres == S_OK, "get_nodeName failed: %08x\n", hres); + ok(!strcmp_wa(name, exname), "got name: %s, expected HTML\n", dbgstr_w(name)); + + SysFreeString(name); +} + +static void test_doc_elem(IHTMLDocument2 *doc) +{ + IHTMLElement *elem; + IHTMLDocument3 *doc3; + HRESULT hres; + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument3, (void**)&doc3); + ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument3) failed: %08x\n", hres); + + hres = IHTMLDocument3_get_documentElement(doc3, &elem); + IHTMLDocument3_Release(doc3); + ok(hres == S_OK, "get_documentElement failed: %08x\n", hres); + + test_node_name((IUnknown*)elem, "HTML"); + + IHTMLElement_Release(elem); +} + +static IHTMLDocument2 *notif_doc; +static BOOL doc_complete; + +static HRESULT WINAPI PropertyNotifySink_QueryInterface(IPropertyNotifySink *iface, + REFIID riid, void**ppv) +{ + if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) { + *ppv = iface; + return S_OK; + } + + ok(0, "unexpected call\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI PropertyNotifySink_AddRef(IPropertyNotifySink *iface) +{ + return 2; +} + +static ULONG WINAPI PropertyNotifySink_Release(IPropertyNotifySink *iface) +{ + return 1; +} + +static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, DISPID dispID) +{ + if(dispID == DISPID_READYSTATE){ + BSTR state; + HRESULT hres; + + static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0}; + + hres = IHTMLDocument2_get_readyState(notif_doc, &state); + ok(hres == S_OK, "get_readyState failed: %08x\n", hres); + + if(!lstrcmpW(state, completeW)) + doc_complete = TRUE; + + SysFreeString(state); + } + + return S_OK; +} + +static HRESULT WINAPI PropertyNotifySink_OnRequestEdit(IPropertyNotifySink *iface, DISPID dispID) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static IPropertyNotifySinkVtbl PropertyNotifySinkVtbl = { + PropertyNotifySink_QueryInterface, + PropertyNotifySink_AddRef, + PropertyNotifySink_Release, + PropertyNotifySink_OnChanged, + PropertyNotifySink_OnRequestEdit +}; + +static IPropertyNotifySink PropertyNotifySink = { &PropertyNotifySinkVtbl }; + +static IHTMLDocument2 *create_doc_with_string(const char *str) +{ + IPersistStreamInit *init; + IStream *stream; + IHTMLDocument2 *doc; + HGLOBAL mem; + SIZE_T len; + + notif_doc = doc = create_document(); + if(!doc) + return NULL; + + doc_complete = FALSE; + len = strlen(str); + mem = GlobalAlloc(0, len); + memcpy(mem, str, len); + CreateStreamOnHGlobal(mem, TRUE, &stream); + + IHTMLDocument2_QueryInterface(doc, &IID_IPersistStreamInit, (void**)&init); + + IPersistStreamInit_Load(init, stream); + IPersistStreamInit_Release(init); + IStream_Release(stream); + + return doc; +} + +static void do_advise(IUnknown *unk, REFIID riid, IUnknown *unk_advise) +{ + IConnectionPointContainer *container; + IConnectionPoint *cp; + DWORD cookie; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container); + ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres); + + hres = IConnectionPointContainer_FindConnectionPoint(container, riid, &cp); + IConnectionPointContainer_Release(container); + ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres); + + hres = IConnectionPoint_Advise(cp, unk_advise, &cookie); + IConnectionPoint_Release(cp); + ok(hres == S_OK, "Advise failed: %08x\n", hres); +} + +typedef void (*domtest_t)(IHTMLDocument2*); + +static void run_domtest(const char *str, domtest_t test) +{ + IHTMLDocument2 *doc; + ULONG ref; + MSG msg; + + doc = create_doc_with_string(str); + do_advise((IUnknown*)doc, &IID_IPropertyNotifySink, (IUnknown*)&PropertyNotifySink); + + while(!doc_complete && GetMessage(&msg, NULL, 0, 0)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + test(doc); + + ref = IHTMLDocument2_Release(doc); + ok(!ref, "ref = %d\n", ref); +} + +static void gecko_installer_workaround(BOOL disable) +{ + HKEY hkey; + DWORD res; + + static BOOL has_url = FALSE; + static char url[2048]; + + if(!disable && !has_url) + return; + + res = RegOpenKey(HKEY_CURRENT_USER, "Software\\Wine\\MSHTML", &hkey); + if(res != ERROR_SUCCESS) + return; + + if(disable) { + DWORD type, size = sizeof(url); + + res = RegQueryValueEx(hkey, "GeckoUrl", NULL, &type, (PVOID)url, &size); + if(res == ERROR_SUCCESS && type == REG_SZ) + has_url = TRUE; + + RegDeleteValue(hkey, "GeckoUrl"); + }else { + RegSetValueEx(hkey, "GeckoUrl", 0, REG_SZ, (PVOID)url, lstrlenA(url)+1); + } + + RegCloseKey(hkey); +} + +START_TEST(dom) +{ + gecko_installer_workaround(TRUE); + CoInitialize(NULL); + + run_domtest(doc_str1, test_doc_elem); + + CoUninitialize(); + gecko_installer_workaround(FALSE); +}
1
0
0
0
Jacek Caban : mshtml: Added IHTMLDOMNode::get_nodeName implementation.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: 40cfcf513cff4ab9e8d5cef0c7a5e69de42deee2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=40cfcf513cff4ab9e8d5cef0c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jun 24 21:07:23 2007 +0200 mshtml: Added IHTMLDOMNode::get_nodeName implementation. --- dlls/mshtml/htmlnode.c | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index d552e1c..c226db3 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -214,8 +214,30 @@ static HRESULT WINAPI HTMLDOMNode_appendChild(IHTMLDOMNode *iface, IHTMLDOMNode static HRESULT WINAPI HTMLDOMNode_get_nodeName(IHTMLDOMNode *iface, BSTR *p) { HTMLDOMNode *This = HTMLDOMNODE_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + *p = NULL; + + if(This->nsnode) { + nsAString name_str; + const PRUnichar *name; + nsresult nsres; + + nsAString_Init(&name_str, NULL); + nsres = nsIDOMNode_GetNodeName(This->nsnode, &name_str); + + if(NS_SUCCEEDED(nsres)) { + nsAString_GetData(&name_str, &name, NULL); + *p = SysAllocString(name); + }else { + ERR("GetNodeName failed: %08x\n", nsres); + } + + nsAString_Finish(&name_str); + } + + return S_OK; } static HRESULT WINAPI HTMLDOMNode_put_nodeValue(IHTMLDOMNode *iface, VARIANT v)
1
0
0
0
Rob Shearman : mshtml: Notify the Gecko stream listener that we stopped binding, if an error occurs in start_binding.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: f6daa3485759d68754a53e39c0b17ca60ded3619 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f6daa3485759d68754a53e39c…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Sun Jun 24 09:23:10 2007 +0100 mshtml: Notify the Gecko stream listener that we stopped binding, if an error occurs in start_binding. --- dlls/mshtml/navigate.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 15a2f9c..3e05fdc 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -796,6 +796,8 @@ HRESULT start_binding(BSCallback *bscallback) hres = CreateAsyncBindCtx(0, STATUSCLB(bscallback), NULL, &bctx); if(FAILED(hres)) { WARN("CreateAsyncBindCtx failed: %08x\n", hres); + nsIStreamListener_OnStopRequest(bscallback->nslistener, (nsIRequest*)NSCHANNEL(bscallback->nschannel), + bscallback->nscontext, NS_OK); return hres; } @@ -803,6 +805,8 @@ HRESULT start_binding(BSCallback *bscallback) IBindCtx_Release(bctx); if(FAILED(hres)) { WARN("BindToStorage failed: %08x\n", hres); + nsIStreamListener_OnStopRequest(bscallback->nslistener, (nsIRequest*)NSCHANNEL(bscallback->nschannel), + bscallback->nscontext, NS_OK); return hres; }
1
0
0
0
Rob Shearman : mshtml: Fix HTMLDocument3_get_documentElement to get the right nsIDOMNode.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: 860d30eef269a4fd1b1ceec95b0f7570faf8f77c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=860d30eef269a4fd1b1ceec95…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Sun Jun 24 09:19:24 2007 +0100 mshtml: Fix HTMLDocument3_get_documentElement to get the right nsIDOMNode. --- dlls/mshtml/htmldoc3.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/dlls/mshtml/htmldoc3.c b/dlls/mshtml/htmldoc3.c index 21ee257..75c089d 100644 --- a/dlls/mshtml/htmldoc3.c +++ b/dlls/mshtml/htmldoc3.c @@ -117,6 +117,7 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I HTMLDocument *This = HTMLDOC3_THIS(iface); nsIDOMDocument *nsdoc; HTMLDOMNode *node; + nsIDOMElement *nselem = NULL; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -131,7 +132,12 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I ERR("GetDocument failed: %08x\n", nsres); if(nsdoc) { - node = get_node(This, (nsIDOMNode*)nsdoc); + nsres = nsIDOMHTMLDocument_GetDocumentElement(nsdoc, &nselem); + if(NS_FAILED(nsres)) + ERR("GetDocumentElement failed: %08x\n", nsres); + } + if(nselem) { + node = get_node(This, (nsIDOMNode *)nselem); nsIDOMDocument_Release(nsdoc); IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
1
0
0
0
Rob Shearman : mshtml: Implement HTMLElement_setAttribute.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: a9ebca282baeae17f5cb63c5b4ace1e22781ab1c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a9ebca282baeae17f5cb63c5b…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Sun Jun 24 09:18:41 2007 +0100 mshtml: Implement HTMLElement_setAttribute. --- dlls/mshtml/htmlelem.c | 36 ++++++++++++++++++++++++++++++++++-- 1 files changed, 34 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 516a0d0..ccdad8c 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -135,8 +135,40 @@ static HRESULT WINAPI HTMLElement_setAttribute(IHTMLElement *iface, BSTR strAttr VARIANT AttributeValue, LONG lFlags) { HTMLElement *This = HTMLELEM_THIS(iface); - FIXME("(%p)->(%s . %08x)\n", This, debugstr_w(strAttributeName), lFlags); - return E_NOTIMPL; + nsAString attr_str; + nsAString value_str; + nsresult nsres; + HRESULT hres; + VARIANT AttributeValueChanged; + + WARN("(%p)->(%s . %08x)\n", This, debugstr_w(strAttributeName), lFlags); + + VariantInit(&AttributeValueChanged); + + hres = VariantChangeType(&AttributeValueChanged, &AttributeValue, 0, VT_BSTR); + if (FAILED(hres)) { + WARN("couldn't convert input attribute value %d to VT_BSTR\n", V_VT(&AttributeValue)); + return hres; + } + + nsAString_Init(&attr_str, strAttributeName); + nsAString_Init(&value_str, V_BSTR(&AttributeValueChanged)); + + TRACE("setting %s to %s\n", debugstr_w(strAttributeName), + debugstr_w(V_BSTR(&AttributeValueChanged))); + + nsres = nsIDOMHTMLElement_SetAttribute(This->nselem, &attr_str, &value_str); + nsAString_Finish(&attr_str); + nsAString_Finish(&value_str); + + if(NS_SUCCEEDED(nsres)) { + hres = S_OK; + }else { + ERR("SetAttribute failed: %08x\n", nsres); + hres = E_FAIL; + } + + return hres; } static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttributeName,
1
0
0
0
Rob Shearman : mshtml: The SRC value returned from HTMLElement_getAttribute should be an absolute , not relative URL.
by Alexandre Julliard
25 Jun '07
25 Jun '07
Module: wine Branch: master Commit: 6c6e4515fc2f2aec8e313602367b8a6c8f9a9b3f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6c6e4515fc2f2aec8e3136023…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Sun Jun 24 09:17:51 2007 +0100 mshtml: The SRC value returned from HTMLElement_getAttribute should be an absolute, not relative URL. --- dlls/mshtml/htmlelem.c | 30 +++++++++++++++++++++++++++--- 1 files changed, 27 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 37abb51..516a0d0 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -26,8 +26,10 @@ #include "windef.h" #include "winbase.h" #include "winuser.h" +#include "winreg.h" #include "winnls.h" #include "ole2.h" +#include "shlwapi.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -149,6 +151,8 @@ static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttr WARN("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue); + VariantInit(AttributeValue); + nsAString_Init(&attr_str, strAttributeName); nsAString_Init(&value_str, NULL); @@ -156,10 +160,30 @@ static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttr nsAString_Finish(&attr_str); if(NS_SUCCEEDED(nsres)) { + static const WCHAR wszSRC[] = {'s','r','c',0}; nsAString_GetData(&value_str, &value, NULL); - V_VT(AttributeValue) = VT_BSTR; - V_BSTR(AttributeValue) = SysAllocString(value); - TRACE("attr_value=%s\n", debugstr_w(V_BSTR(AttributeValue))); + if(!strcmpiW(strAttributeName, wszSRC)) + { + WCHAR buffer[256]; + DWORD len; + BSTR bstrBaseUrl; + hres = IHTMLDocument2_get_URL(HTMLDOC(This->node->doc), &bstrBaseUrl); + if(SUCCEEDED(hres)) { + hres = CoInternetCombineUrl(bstrBaseUrl, value, + URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO, + buffer, sizeof(buffer)/sizeof(WCHAR), &len, 0); + SysFreeString(bstrBaseUrl); + if(SUCCEEDED(hres)) { + V_VT(AttributeValue) = VT_BSTR; + V_BSTR(AttributeValue) = SysAllocString(buffer); + TRACE("attr_value=%s\n", debugstr_w(V_BSTR(AttributeValue))); + } + } + }else { + V_VT(AttributeValue) = VT_BSTR; + V_BSTR(AttributeValue) = SysAllocString(value); + TRACE("attr_value=%s\n", debugstr_w(V_BSTR(AttributeValue))); + } }else { ERR("GetAttribute failed: %08x\n", nsres); hres = E_FAIL;
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
86
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Results per page:
10
25
50
100
200