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
August 2018
----- 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
2 participants
618 discussions
Start a n
N
ew thread
Józef Kucia : vkd3d: Add support for default 1D texture views.
by Alexandre Julliard
29 Aug '18
29 Aug '18
Module: vkd3d Branch: master Commit: c5e129cf67a4a670e57eba1cce31972aa1b22b07 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=c5e129cf67a4a670e57eba1…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Aug 28 12:19:48 2018 +0200 vkd3d: Add support for default 1D texture views. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/resource.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index ed2d11a..e40ccbc 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1295,15 +1295,21 @@ static bool init_default_texture_view_desc(struct vkd3d_texture_view_desc *desc, return false; } + desc->miplevel_idx = 0; + desc->miplevel_count = 1; + desc->layer_idx = 0; + desc->layer_count = VK_REMAINING_ARRAY_LAYERS; + switch (resource->desc.Dimension) { + case D3D12_RESOURCE_DIMENSION_TEXTURE1D: + desc->view_type = resource->desc.DepthOrArraySize > 1 + ? VK_IMAGE_VIEW_TYPE_1D_ARRAY : VK_IMAGE_VIEW_TYPE_1D; + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE2D: desc->view_type = resource->desc.DepthOrArraySize > 1 ? VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_2D; - desc->miplevel_idx = 0; - desc->miplevel_count = 1; - desc->layer_idx = 0; - desc->layer_count = VK_REMAINING_ARRAY_LAYERS; break; default: @@ -1324,7 +1330,7 @@ static VkResult vkd3d_create_texture_view(struct d3d12_device *device, struct VkImageViewCreateInfo view_desc; VkResult vr; - assert(resource->desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D); + assert(d3d12_resource_is_texture(resource)); view_desc.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; view_desc.pNext = NULL;
1
0
0
0
Marcus Meissner : ntdll: Fix buffer size to MultiByteToWideChar.
by Alexandre Julliard
28 Aug '18
28 Aug '18
Module: wine Branch: master Commit: 0c790adf300dd37f624029023bc6de53cb21373c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0c790adf300dd37f62402902…
Author: Marcus Meissner <meissner(a)suse.de> Date: Tue Aug 28 13:23:14 2018 +0200 ntdll: Fix buffer size to MultiByteToWideChar. Signed-off-by: Marcus Meissner <meissner(a)suse.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c index 7baf474..722ca99 100644 --- a/dlls/ntdll/tests/path.c +++ b/dlls/ntdll/tests/path.c @@ -512,7 +512,7 @@ static void test_RtlDosPathNameToNtPathName_U(void) for (i = 0; i < ARRAY_SIZE(tests); ++i) { - MultiByteToWideChar(CP_ACP, 0, tests[i].dos, -1, path, sizeof(path)); + MultiByteToWideChar(CP_ACP, 0, tests[i].dos, -1, path, ARRAY_SIZE(path)); ret = pRtlDosPathNameToNtPathName_U(path, &nameW, &file_part, NULL); if (pRtlDosPathNameToNtPathName_U_WithStatus) @@ -534,7 +534,7 @@ static void test_RtlDosPathNameToNtPathName_U(void) continue; } - MultiByteToWideChar(CP_ACP, 0, tests[i].nt, -1, path, sizeof(path)); + MultiByteToWideChar(CP_ACP, 0, tests[i].nt, -1, path, ARRAY_SIZE(path)); ok(!lstrcmpW(nameW.Buffer, path), "%s: Expected %s, got %s.\n", tests[i].dos, tests[i].nt, wine_dbgstr_w(nameW.Buffer));
1
0
0
0
Jacek Caban : mshtml/tests: Run style tests in IE9 mode.
by Alexandre Julliard
28 Aug '18
28 Aug '18
Module: wine Branch: master Commit: 59f333307ec5a92fa5c7ab81f66fd5336ff313bd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=59f333307ec5a92fa5c7ab81…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 28 12:45:49 2018 +0200 mshtml/tests: Run style tests in IE9 mode. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/tests/style.c | 350 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 300 insertions(+), 50 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=59f333307ec5a92fa5c7…
1
0
0
0
Jacek Caban : mshtml: Use generic value checks for IHTMLStyle:: put_overflow implementation.
by Alexandre Julliard
28 Aug '18
28 Aug '18
Module: wine Branch: master Commit: b79b70f808f518aabc78ca33d675ce4f02d142bc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b79b70f808f518aabc78ca33…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 28 12:45:21 2018 +0200 mshtml: Use generic value checks for IHTMLStyle::put_overflow implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlstyle.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index e647220..51e4fbe 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -207,6 +207,7 @@ static const WCHAR word_wrapW[] = static const WCHAR z_indexW[] = {'z','-','i','n','d','e','x',0}; +static const WCHAR autoW[] = {'a','u','t','o',0}; static const WCHAR blinkW[] = {'b','l','i','n','k',0}; static const WCHAR boldW[] = {'b','o','l','d',0}; static const WCHAR bolderW[] = {'b','o','l','d','e','r',0}; @@ -215,6 +216,7 @@ static const WCHAR dashedW[] = {'d','a','s','h','e','d',0}; static const WCHAR dottedW[] = {'d','o','t','t','e','d',0}; static const WCHAR doubleW[] = {'d','o','u','b','l','e',0}; static const WCHAR grooveW[] = {'g','r','o','o','v','e',0}; +static const WCHAR hiddenW[] = {'h','i','d','d','e','n',0}; static const WCHAR insetW[] = {'i','n','s','e','t',0}; static const WCHAR italicW[] = {'i','t','a','l','i','c',0}; static const WCHAR lighterW[] = {'l','i','g','h','t','e','r',0}; @@ -229,8 +231,10 @@ static const WCHAR repeatW[] = {'r','e','p','e','a','t',0}; static const WCHAR repeat_xW[] = {'r','e','p','e','a','t','-','x',0}; static const WCHAR repeat_yW[] = {'r','e','p','e','a','t','-','y',0}; static const WCHAR ridgeW[] = {'r','i','d','g','e',0}; +static const WCHAR scrollW[] = {'s','c','r','o','l','l',0}; static const WCHAR solidW[] = {'s','o','l','i','d',0}; static const WCHAR underlineW[] = {'u','n','d','e','r','l','i','n','e',0}; +static const WCHAR visibleW[] = {'v','i','s','i','b','l','e',0}; static const WCHAR style100W[] = {'1','0','0',0}; static const WCHAR style200W[] = {'2','0','0',0}; @@ -302,6 +306,14 @@ static const WCHAR *border_style_values[] = { NULL }; +static const WCHAR *overflow_values[] = { + autoW, + hiddenW, + scrollW, + visibleW, + NULL +}; + #define ATTR_FIX_PX 0x0001 #define ATTR_FIX_URL 0x0002 #define ATTR_STR_TO_INT 0x0004 @@ -379,7 +391,7 @@ static const style_tbl_entry_t style_tbl[] = { {min_heightW, DISPID_IHTMLSTYLE4_MINHEIGHT}, {min_widthW, DISPID_IHTMLSTYLE5_MINWIDTH, ATTR_FIX_PX}, {outlineW, DISPID_IHTMLSTYLE6_OUTLINE, ATTR_NO_NULL}, - {overflowW, DISPID_IHTMLSTYLE_OVERFLOW}, + {overflowW, DISPID_IHTMLSTYLE_OVERFLOW, 0, overflow_values}, {overflow_xW, DISPID_IHTMLSTYLE2_OVERFLOWX}, {overflow_yW, DISPID_IHTMLSTYLE2_OVERFLOWY}, {paddingW, DISPID_IHTMLSTYLE_PADDING}, @@ -2380,21 +2392,10 @@ static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p) static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0}; - static const WCHAR szScroll[] = {'s','c','r','o','l','l',0}; - static const WCHAR szHidden[] = {'h','i','d','d','e','n',0}; - static const WCHAR szAuto[] = {'a','u','t','o',0}; TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - /* overflow can only be one of the follow values. */ - if(!v || !*v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 || - strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0) - { - return set_style_property(This, STYLEID_OVERFLOW, v); - } - - return E_INVALIDARG; + return set_style_property(This, STYLEID_OVERFLOW, v); }
1
0
0
0
Jacek Caban : mshtml: Use generic value checks for IHTMLStyle:: put_border*Style implementation.
by Alexandre Julliard
28 Aug '18
28 Aug '18
Module: wine Branch: master Commit: 8b9d57057185513d823f292d6a8e656d5fc5ecfe URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8b9d57057185513d823f292d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 28 12:44:57 2018 +0200 mshtml: Use generic value checks for IHTMLStyle::put_border*Style implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlstyle.c | 71 +++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 41 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 4b98a6d..e647220 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -211,6 +211,11 @@ static const WCHAR blinkW[] = {'b','l','i','n','k',0}; static const WCHAR boldW[] = {'b','o','l','d',0}; static const WCHAR bolderW[] = {'b','o','l','d','e','r',0}; static const WCHAR capsW[] = {'s','m','a','l','l','-','c','a','p','s',0}; +static const WCHAR dashedW[] = {'d','a','s','h','e','d',0}; +static const WCHAR dottedW[] = {'d','o','t','t','e','d',0}; +static const WCHAR doubleW[] = {'d','o','u','b','l','e',0}; +static const WCHAR grooveW[] = {'g','r','o','o','v','e',0}; +static const WCHAR insetW[] = {'i','n','s','e','t',0}; static const WCHAR italicW[] = {'i','t','a','l','i','c',0}; static const WCHAR lighterW[] = {'l','i','g','h','t','e','r',0}; static const WCHAR line_throughW[] = {'l','i','n','e','-','t','h','r','o','u','g','h',0}; @@ -218,10 +223,13 @@ static const WCHAR no_repeatW[] = {'n','o','-','r','e','p','e','a','t',0}; static const WCHAR noneW[] = {'n','o','n','e',0}; static const WCHAR normalW[] = {'n','o','r','m','a','l',0}; static const WCHAR obliqueW[] = {'o','b','l','i','q','u','e',0}; +static const WCHAR outsetW[] = {'o','u','t','s','e','t',0}; static const WCHAR overlineW[] = {'o','v','e','r','l','i','n','e',0}; static const WCHAR repeatW[] = {'r','e','p','e','a','t',0}; static const WCHAR repeat_xW[] = {'r','e','p','e','a','t','-','x',0}; static const WCHAR repeat_yW[] = {'r','e','p','e','a','t','-','y',0}; +static const WCHAR ridgeW[] = {'r','i','d','g','e',0}; +static const WCHAR solidW[] = {'s','o','l','i','d',0}; static const WCHAR underlineW[] = {'u','n','d','e','r','l','i','n','e',0}; static const WCHAR style100W[] = {'1','0','0',0}; @@ -281,6 +289,19 @@ static const WCHAR *text_decoration_values[] = { NULL }; +static const WCHAR *border_style_values[] = { + dashedW, + dottedW, + doubleW, + grooveW, + insetW, + noneW, + outsetW, + ridgeW, + solidW, + NULL +}; + #define ATTR_FIX_PX 0x0001 #define ATTR_FIX_URL 0x0002 #define ATTR_STR_TO_INT 0x0004 @@ -309,21 +330,21 @@ static const style_tbl_entry_t style_tbl[] = { {borderW, DISPID_IHTMLSTYLE_BORDER}, {border_bottomW, DISPID_IHTMLSTYLE_BORDERBOTTOM, ATTR_FIX_PX}, {border_bottom_colorW, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR, ATTR_HEX_INT}, - {border_bottom_styleW, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE}, + {border_bottom_styleW, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE, 0, border_style_values}, {border_bottom_widthW, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH, ATTR_FIX_PX}, {border_colorW, DISPID_IHTMLSTYLE_BORDERCOLOR}, {border_leftW, DISPID_IHTMLSTYLE_BORDERLEFT, ATTR_FIX_PX}, {border_left_colorW, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR, ATTR_HEX_INT}, - {border_left_styleW, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE}, + {border_left_styleW, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE, 0, border_style_values}, {border_left_widthW, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH, ATTR_FIX_PX}, {border_rightW, DISPID_IHTMLSTYLE_BORDERRIGHT, ATTR_FIX_PX}, {border_right_colorW, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR, ATTR_HEX_INT}, - {border_right_styleW, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE}, + {border_right_styleW, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE, 0, border_style_values}, {border_right_widthW, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH, ATTR_FIX_PX}, {border_styleW, DISPID_IHTMLSTYLE_BORDERSTYLE}, {border_topW, DISPID_IHTMLSTYLE_BORDERTOP, ATTR_FIX_PX}, {border_top_colorW, DISPID_IHTMLSTYLE_BORDERTOPCOLOR, ATTR_HEX_INT}, - {border_top_styleW, DISPID_IHTMLSTYLE_BORDERTOPSTYLE}, + {border_top_styleW, DISPID_IHTMLSTYLE_BORDERTOPSTYLE, 0, border_style_values}, {border_top_widthW, DISPID_IHTMLSTYLE_BORDERTOPWIDTH}, {border_widthW, DISPID_IHTMLSTYLE_BORDERWIDTH}, {bottomW, DISPID_IHTMLSTYLE2_BOTTOM, ATTR_FIX_PX}, @@ -819,27 +840,11 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p) static BOOL is_valid_border_style(BSTR v) { - static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0}; - static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0}; - static const WCHAR styleSolid[] = {'s','o','l','i','d',0}; - static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0}; - static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0}; - static const WCHAR styleRidge[] = {'r','i','d','g','e',0}; - static const WCHAR styleInset[] = {'i','n','s','e','t',0}; - static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0}; - - TRACE("%s\n", debugstr_w(v)); - - if(!v || strcmpiW(v, noneW) == 0 || strcmpiW(v, styleDotted) == 0 || - strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 || - strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 || - strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 || - strcmpiW(v, styleOutset) == 0 ) - { - return TRUE; - } - - return FALSE; + return !v || strcmpiW(v, noneW) == 0 || strcmpiW(v, dottedW) == 0 || + strcmpiW(v, dashedW) == 0 || strcmpiW(v, solidW) == 0 || + strcmpiW(v, doubleW) == 0 || strcmpiW(v, grooveW) == 0 || + strcmpiW(v, ridgeW) == 0 || strcmpiW(v, insetW) == 0 || + strcmpiW(v, outsetW) == 0; } static inline HTMLStyle *impl_from_IHTMLStyle(IHTMLStyle *iface) @@ -2065,10 +2070,6 @@ static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - - if(!is_valid_border_style(v)) - return E_INVALIDARG; - return set_style_property(This, STYLEID_BORDER_TOP_STYLE, v); } @@ -2083,10 +2084,6 @@ static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - - if(!is_valid_border_style(v)) - return E_INVALIDARG; - return set_style_property(This, STYLEID_BORDER_RIGHT_STYLE, v); } @@ -2101,10 +2098,6 @@ static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - - if(!is_valid_border_style(v)) - return E_INVALIDARG; - return set_style_property(This, STYLEID_BORDER_BOTTOM_STYLE, v); } @@ -2119,10 +2112,6 @@ static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - - if(!is_valid_border_style(v)) - return E_INVALIDARG; - return set_style_property(This, STYLEID_BORDER_LEFT_STYLE, v); }
1
0
0
0
Jacek Caban : mshtml: Use generic value checks for IHTMLStyle:: put_textDecoration implementation.
by Alexandre Julliard
28 Aug '18
28 Aug '18
Module: wine Branch: master Commit: 9cbf3dd83d8212ba51e277d4f8219e6bacc465cf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9cbf3dd83d8212ba51e277d4…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 28 12:44:40 2018 +0200 mshtml: Use generic value checks for IHTMLStyle::put_textDecoration implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlstyle.c | 59 ++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 04fcf42..4b98a6d 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -207,17 +207,22 @@ static const WCHAR word_wrapW[] = static const WCHAR z_indexW[] = {'z','-','i','n','d','e','x',0}; +static const WCHAR blinkW[] = {'b','l','i','n','k',0}; static const WCHAR boldW[] = {'b','o','l','d',0}; static const WCHAR bolderW[] = {'b','o','l','d','e','r',0}; static const WCHAR capsW[] = {'s','m','a','l','l','-','c','a','p','s',0}; static const WCHAR italicW[] = {'i','t','a','l','i','c',0}; static const WCHAR lighterW[] = {'l','i','g','h','t','e','r',0}; +static const WCHAR line_throughW[] = {'l','i','n','e','-','t','h','r','o','u','g','h',0}; static const WCHAR no_repeatW[] = {'n','o','-','r','e','p','e','a','t',0}; +static const WCHAR noneW[] = {'n','o','n','e',0}; static const WCHAR normalW[] = {'n','o','r','m','a','l',0}; static const WCHAR obliqueW[] = {'o','b','l','i','q','u','e',0}; +static const WCHAR overlineW[] = {'o','v','e','r','l','i','n','e',0}; static const WCHAR repeatW[] = {'r','e','p','e','a','t',0}; static const WCHAR repeat_xW[] = {'r','e','p','e','a','t','-','x',0}; static const WCHAR repeat_yW[] = {'r','e','p','e','a','t','-','y',0}; +static const WCHAR underlineW[] = {'u','n','d','e','r','l','i','n','e',0}; static const WCHAR style100W[] = {'1','0','0',0}; static const WCHAR style200W[] = {'2','0','0',0}; @@ -267,6 +272,15 @@ static const WCHAR *background_repeat_values[] = { NULL }; +static const WCHAR *text_decoration_values[] = { + blinkW, + line_throughW, + noneW, + overlineW, + underlineW, + NULL +}; + #define ATTR_FIX_PX 0x0001 #define ATTR_FIX_URL 0x0002 #define ATTR_STR_TO_INT 0x0004 @@ -358,7 +372,7 @@ static const style_tbl_entry_t style_tbl[] = { {rightW, DISPID_IHTMLSTYLE2_RIGHT}, {table_layoutW, DISPID_IHTMLSTYLE2_TABLELAYOUT}, {text_alignW, DISPID_IHTMLSTYLE_TEXTALIGN}, - {text_decorationW, DISPID_IHTMLSTYLE_TEXTDECORATION}, + {text_decorationW, DISPID_IHTMLSTYLE_TEXTDECORATION, 0, text_decoration_values}, {text_indentW, DISPID_IHTMLSTYLE_TEXTINDENT, ATTR_FIX_PX}, {text_transformW, DISPID_IHTMLSTYLE_TEXTTRANSFORM}, {topW, DISPID_IHTMLSTYLE_TOP}, @@ -373,17 +387,6 @@ static const style_tbl_entry_t style_tbl[] = { C_ASSERT(ARRAY_SIZE(style_tbl) == STYLEID_MAX_VALUE); -static const WCHAR valLineThrough[] = - {'l','i','n','e','-','t','h','r','o','u','g','h',0}; -static const WCHAR valUnderline[] = - {'u','n','d','e','r','l','i','n','e',0}; -static const WCHAR styleNone[] = - {'n','o','n','e',0}; -static const WCHAR valOverline[] = - {'o','v','e','r','l','i','n','e',0}; -static const WCHAR valBlink[] = - {'b','l','i','n','k',0}; - static const WCHAR px_formatW[] = {'%','d','p','x',0}; static const WCHAR emptyW[] = {0}; @@ -827,7 +830,7 @@ static BOOL is_valid_border_style(BSTR v) TRACE("%s\n", debugstr_w(v)); - if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 || + if(!v || strcmpiW(v, noneW) == 0 || strcmpiW(v, styleDotted) == 0 || strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 || strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 || strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 || @@ -1389,15 +1392,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v) TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - /* textDecoration can only be one of the following */ - if(!v || strcmpiW(styleNone, v) == 0 || strcmpiW(valUnderline, v) == 0 || - strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 || - strcmpiW(valBlink, v) == 0) - { - return set_style_property(This, STYLEID_TEXT_DECORATION , v); - } - - return E_INVALIDARG; + return set_style_property(This, STYLEID_TEXT_DECORATION , v); } static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p) @@ -1415,7 +1410,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIAN TRACE("(%p)->(%x)\n", This, v); - return set_style_property(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW); + return set_style_property(This, STYLEID_TEXT_DECORATION, v ? noneW : emptyW); } static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1424,7 +1419,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIAN TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, noneW, p); } static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v) @@ -1433,7 +1428,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, V TRACE("(%p)->(%x)\n", This, v); - return set_style_property(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW); + return set_style_property(This, STYLEID_TEXT_DECORATION, v ? underlineW : emptyW); } static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1442,7 +1437,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, V TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, underlineW, p); } static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v) @@ -1451,7 +1446,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VA TRACE("(%p)->(%x)\n", This, v); - return set_style_property(This, STYLEID_TEXT_DECORATION, v ? valOverline : emptyW); + return set_style_property(This, STYLEID_TEXT_DECORATION, v ? overlineW : emptyW); } static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1460,7 +1455,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VA TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valOverline, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, overlineW, p); } static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v) @@ -1469,7 +1464,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, TRACE("(%p)->(%x)\n", This, v); - return set_style_property(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW); + return set_style_property(This, STYLEID_TEXT_DECORATION, v ? line_throughW : emptyW); } static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1478,7 +1473,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, line_throughW, p); } static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v) @@ -1487,7 +1482,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIA TRACE("(%p)->(%x)\n", This, v); - return set_style_property(This, STYLEID_TEXT_DECORATION, v ? valBlink : emptyW); + return set_style_property(This, STYLEID_TEXT_DECORATION, v ? blinkW : emptyW); } static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1496,7 +1491,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIA TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valBlink, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, blinkW, p); } static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1
0
0
0
Jacek Caban : mshtml: Use generic value checks for IHTMLStyle:: put_backgroundRepeat implementation.
by Alexandre Julliard
28 Aug '18
28 Aug '18
Module: wine Branch: master Commit: 56d75ce16a33105bbd993c656fb5c3924bf81da4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=56d75ce16a33105bbd993c65…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 28 12:44:29 2018 +0200 mshtml: Use generic value checks for IHTMLStyle::put_backgroundRepeat implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlstyle.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index b7aeaea..04fcf42 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -212,8 +212,12 @@ static const WCHAR bolderW[] = {'b','o','l','d','e','r',0}; static const WCHAR capsW[] = {'s','m','a','l','l','-','c','a','p','s',0}; static const WCHAR italicW[] = {'i','t','a','l','i','c',0}; static const WCHAR lighterW[] = {'l','i','g','h','t','e','r',0}; +static const WCHAR no_repeatW[] = {'n','o','-','r','e','p','e','a','t',0}; static const WCHAR normalW[] = {'n','o','r','m','a','l',0}; static const WCHAR obliqueW[] = {'o','b','l','i','q','u','e',0}; +static const WCHAR repeatW[] = {'r','e','p','e','a','t',0}; +static const WCHAR repeat_xW[] = {'r','e','p','e','a','t','-','x',0}; +static const WCHAR repeat_yW[] = {'r','e','p','e','a','t','-','y',0}; static const WCHAR style100W[] = {'1','0','0',0}; static const WCHAR style200W[] = {'2','0','0',0}; @@ -255,6 +259,14 @@ static const WCHAR *font_weight_values[] = { NULL }; +static const WCHAR *background_repeat_values[] = { + no_repeatW, + repeatW, + repeat_xW, + repeat_yW, + NULL +}; + #define ATTR_FIX_PX 0x0001 #define ATTR_FIX_URL 0x0002 #define ATTR_STR_TO_INT 0x0004 @@ -279,7 +291,7 @@ static const style_tbl_entry_t style_tbl[] = { {background_positionW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION}, {background_position_xW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX, ATTR_FIX_PX}, {background_position_yW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY, ATTR_FIX_PX}, - {background_repeatW, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT}, + {background_repeatW, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT, 0, background_repeat_values}, {borderW, DISPID_IHTMLSTYLE_BORDER}, {border_bottomW, DISPID_IHTMLSTYLE_BORDERBOTTOM, ATTR_FIX_PX}, {border_bottom_colorW, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR, ATTR_HEX_INT}, @@ -1104,21 +1116,10 @@ static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p) static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - static const WCHAR styleRepeat[] = {'r','e','p','e','a','t',0}; - static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0}; - static const WCHAR styleRepeatX[] = {'r','e','p','e','a','t','-','x',0}; - static const WCHAR styleRepeatY[] = {'r','e','p','e','a','t','-','y',0}; TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - /* fontWeight can only be one of the following */ - if(!v || strcmpiW(styleRepeat, v) == 0 || strcmpiW(styleNoRepeat, v) == 0 || - strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 ) - { - return set_style_property(This, STYLEID_BACKGROUND_REPEAT , v); - } - - return E_INVALIDARG; + return set_style_property(This, STYLEID_BACKGROUND_REPEAT , v); } static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
1
0
0
0
Jacek Caban : mshtml: Use generic value checks for IHTMLStyle:: put_fontWeight implementation.
by Alexandre Julliard
28 Aug '18
28 Aug '18
Module: wine Branch: master Commit: dd8f202e05ad56ad0ab8736a92782a44bdc8b1fa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dd8f202e05ad56ad0ab8736a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 28 12:44:16 2018 +0200 mshtml: Use generic value checks for IHTMLStyle::put_fontWeight implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlstyle.c | 53 +++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index b89ffbc..b7aeaea 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -207,11 +207,24 @@ static const WCHAR word_wrapW[] = static const WCHAR z_indexW[] = {'z','-','i','n','d','e','x',0}; +static const WCHAR boldW[] = {'b','o','l','d',0}; +static const WCHAR bolderW[] = {'b','o','l','d','e','r',0}; static const WCHAR capsW[] = {'s','m','a','l','l','-','c','a','p','s',0}; static const WCHAR italicW[] = {'i','t','a','l','i','c',0}; +static const WCHAR lighterW[] = {'l','i','g','h','t','e','r',0}; static const WCHAR normalW[] = {'n','o','r','m','a','l',0}; static const WCHAR obliqueW[] = {'o','b','l','i','q','u','e',0}; +static const WCHAR style100W[] = {'1','0','0',0}; +static const WCHAR style200W[] = {'2','0','0',0}; +static const WCHAR style300W[] = {'3','0','0',0}; +static const WCHAR style400W[] = {'4','0','0',0}; +static const WCHAR style500W[] = {'5','0','0',0}; +static const WCHAR style600W[] = {'6','0','0',0}; +static const WCHAR style700W[] = {'7','0','0',0}; +static const WCHAR style800W[] = {'8','0','0',0}; +static const WCHAR style900W[] = {'9','0','0',0}; + static const WCHAR *font_style_values[] = { italicW, normalW, @@ -225,6 +238,23 @@ static const WCHAR *font_variant_values[] = { NULL }; +static const WCHAR *font_weight_values[] = { + style100W, + style200W, + style300W, + style400W, + style500W, + style600W, + style700W, + style800W, + style900W, + boldW, + bolderW, + lighterW, + normalW, + NULL +}; + #define ATTR_FIX_PX 0x0001 #define ATTR_FIX_URL 0x0002 #define ATTR_STR_TO_INT 0x0004 @@ -284,7 +314,7 @@ static const style_tbl_entry_t style_tbl[] = { {font_sizeW, DISPID_IHTMLSTYLE_FONTSIZE, ATTR_FIX_PX}, {font_styleW, DISPID_IHTMLSTYLE_FONTSTYLE, 0, font_style_values}, {font_variantW, DISPID_IHTMLSTYLE_FONTVARIANT, 0, font_variant_values}, - {font_weightW, DISPID_IHTMLSTYLE_FONTWEIGHT, ATTR_STR_TO_INT}, + {font_weightW, DISPID_IHTMLSTYLE_FONTWEIGHT, ATTR_STR_TO_INT, font_weight_values}, {heightW, DISPID_IHTMLSTYLE_HEIGHT, ATTR_FIX_PX}, {leftW, DISPID_IHTMLSTYLE_LEFT}, {letter_spacingW, DISPID_IHTMLSTYLE_LETTERSPACING}, @@ -432,7 +462,7 @@ static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_ nsresult nsres; HRESULT hres = S_OK; - if(value) { + if(value && *value) { unsigned flags = style_tbl[sid].flags; if(flags & ATTR_FIX_PX) val = fix_px_value(value); @@ -952,28 +982,9 @@ static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p) static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - static const WCHAR styleBold[] = {'b','o','l','d',0}; - static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0}; - static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0}; - static const WCHAR style100[] = {'1','0','0',0}; - static const WCHAR style200[] = {'2','0','0',0}; - static const WCHAR style300[] = {'3','0','0',0}; - static const WCHAR style400[] = {'4','0','0',0}; - static const WCHAR style500[] = {'5','0','0',0}; - static const WCHAR style600[] = {'6','0','0',0}; - static const WCHAR style700[] = {'7','0','0',0}; - static const WCHAR style800[] = {'8','0','0',0}; - static const WCHAR style900[] = {'9','0','0',0}; TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - /* fontWeight can only be one of the following */ - if(v && *v && strcmpiW(normalW, v) && strcmpiW(styleBold, v) && strcmpiW(styleBolder, v) - && strcmpiW(styleLighter, v) && strcmpiW(style100, v) && strcmpiW(style200, v) - && strcmpiW(style300, v) && strcmpiW(style400, v) && strcmpiW(style500, v) && strcmpiW(style600, v) - && strcmpiW(style700, v) && strcmpiW(style800, v) && strcmpiW(style900, v)) - return E_INVALIDARG; - return set_style_property(This, STYLEID_FONT_WEIGHT, v); }
1
0
0
0
Jacek Caban : mshtml: Use generic value checks for IHTMLStyle:: put_fontVariant implementation.
by Alexandre Julliard
28 Aug '18
28 Aug '18
Module: wine Branch: master Commit: ab2bd77c0869517a5bbe225591df9c2fead796ec URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ab2bd77c0869517a5bbe2255…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 28 12:44:03 2018 +0200 mshtml: Use generic value checks for IHTMLStyle::put_fontVariant implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlstyle.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index a137b56..b89ffbc 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -207,6 +207,7 @@ static const WCHAR word_wrapW[] = static const WCHAR z_indexW[] = {'z','-','i','n','d','e','x',0}; +static const WCHAR capsW[] = {'s','m','a','l','l','-','c','a','p','s',0}; static const WCHAR italicW[] = {'i','t','a','l','i','c',0}; static const WCHAR normalW[] = {'n','o','r','m','a','l',0}; static const WCHAR obliqueW[] = {'o','b','l','i','q','u','e',0}; @@ -218,6 +219,12 @@ static const WCHAR *font_style_values[] = { NULL }; +static const WCHAR *font_variant_values[] = { + capsW, + normalW, + NULL +}; + #define ATTR_FIX_PX 0x0001 #define ATTR_FIX_URL 0x0002 #define ATTR_STR_TO_INT 0x0004 @@ -276,7 +283,7 @@ static const style_tbl_entry_t style_tbl[] = { {font_familyW, DISPID_IHTMLSTYLE_FONTFAMILY}, {font_sizeW, DISPID_IHTMLSTYLE_FONTSIZE, ATTR_FIX_PX}, {font_styleW, DISPID_IHTMLSTYLE_FONTSTYLE, 0, font_style_values}, - {font_variantW, DISPID_IHTMLSTYLE_FONTVARIANT}, + {font_variantW, DISPID_IHTMLSTYLE_FONTVARIANT, 0, font_variant_values}, {font_weightW, DISPID_IHTMLSTYLE_FONTWEIGHT, ATTR_STR_TO_INT}, {heightW, DISPID_IHTMLSTYLE_HEIGHT, ATTR_FIX_PX}, {leftW, DISPID_IHTMLSTYLE_LEFT}, @@ -925,17 +932,10 @@ static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p) static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0}; TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - /* fontVariant can only be one of the follow values. */ - if(!v || strcmpiW(normalW, v) == 0 || strcmpiW(szCaps, v) == 0) - { - return set_style_property(This, STYLEID_FONT_VARIANT, v); - } - - return E_INVALIDARG; + return set_style_property(This, STYLEID_FONT_VARIANT, v); } static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
1
0
0
0
Jacek Caban : mshtml: Support using array to check for allowed values and use it in IHTMLStyle: :put_fontStyle implementation.
by Alexandre Julliard
28 Aug '18
28 Aug '18
Module: wine Branch: master Commit: 4c59ce88fa7049006c86525717c22f02ccd16303 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4c59ce88fa7049006c865257…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 28 12:43:45 2018 +0200 mshtml: Support using array to check for allowed values and use it in IHTMLStyle::put_fontStyle implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlstyle.c | 57 ++++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 272b644..a137b56 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -207,6 +207,17 @@ static const WCHAR word_wrapW[] = static const WCHAR z_indexW[] = {'z','-','i','n','d','e','x',0}; +static const WCHAR italicW[] = {'i','t','a','l','i','c',0}; +static const WCHAR normalW[] = {'n','o','r','m','a','l',0}; +static const WCHAR obliqueW[] = {'o','b','l','i','q','u','e',0}; + +static const WCHAR *font_style_values[] = { + italicW, + normalW, + obliqueW, + NULL +}; + #define ATTR_FIX_PX 0x0001 #define ATTR_FIX_URL 0x0002 #define ATTR_STR_TO_INT 0x0004 @@ -220,6 +231,7 @@ typedef struct { const WCHAR *name; DISPID dispid; unsigned flags; + const WCHAR **allowed_values; } style_tbl_entry_t; static const style_tbl_entry_t style_tbl[] = { @@ -263,7 +275,7 @@ static const style_tbl_entry_t style_tbl[] = { {floatW, DISPID_IHTMLSTYLE_STYLEFLOAT}, {font_familyW, DISPID_IHTMLSTYLE_FONTFAMILY}, {font_sizeW, DISPID_IHTMLSTYLE_FONTSIZE, ATTR_FIX_PX}, - {font_styleW, DISPID_IHTMLSTYLE_FONTSTYLE}, + {font_styleW, DISPID_IHTMLSTYLE_FONTSTYLE, 0, font_style_values}, {font_variantW, DISPID_IHTMLSTYLE_FONTVARIANT}, {font_weightW, DISPID_IHTMLSTYLE_FONTWEIGHT, ATTR_STR_TO_INT}, {heightW, DISPID_IHTMLSTYLE_HEIGHT, ATTR_FIX_PX}, @@ -316,8 +328,6 @@ static const WCHAR valLineThrough[] = {'l','i','n','e','-','t','h','r','o','u','g','h',0}; static const WCHAR valUnderline[] = {'u','n','d','e','r','l','i','n','e',0}; -static const WCHAR szNormal[] = - {'n','o','r','m','a','l',0}; static const WCHAR styleNone[] = {'n','o','n','e',0}; static const WCHAR valOverline[] = @@ -408,17 +418,31 @@ static LPWSTR fix_url_value(LPCWSTR val) return ret; } -static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, const WCHAR *value, unsigned flags) +static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, const WCHAR *value) { nsAString str_name, str_value, str_empty; LPWSTR val = NULL; nsresult nsres; + HRESULT hres = S_OK; if(value) { + unsigned flags = style_tbl[sid].flags; if(flags & ATTR_FIX_PX) val = fix_px_value(value); else if(flags & ATTR_FIX_URL) val = fix_url_value(value); + + if(style_tbl[sid].allowed_values) { + const WCHAR **iter; + for(iter = style_tbl[sid].allowed_values; *iter; iter++) { + if(!strcmpiW(*iter, value)) + break; + } + if(!*iter) { + hres = E_INVALIDARG; + value = emptyW; + } + } } nsAString_InitDepend(&str_name, style_tbl[sid].name); @@ -434,7 +458,7 @@ static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_ nsAString_Finish(&str_empty); heap_free(val); - return S_OK; + return hres; } static HRESULT var_to_styleval(const VARIANT *v, styleid_t sid, WCHAR *buf, const WCHAR **ret) @@ -477,21 +501,19 @@ static HRESULT var_to_styleval(const VARIANT *v, styleid_t sid, WCHAR *buf, cons static HRESULT set_style_property_var(HTMLStyle *style, styleid_t sid, VARIANT *value) { const WCHAR *val; - unsigned flags; WCHAR buf[14]; HRESULT hres; - flags = style_tbl[sid].flags; hres = var_to_styleval(value, sid, buf, &val); if(FAILED(hres)) return hres; - return set_nsstyle_property(style->nsstyle, sid, val, flags); + return set_nsstyle_property(style->nsstyle, sid, val); } static inline HRESULT set_style_property(HTMLStyle *style, styleid_t sid, const WCHAR *value) { - return set_nsstyle_property(style->nsstyle, sid, value, style_tbl[sid].flags); + return set_nsstyle_property(style->nsstyle, sid, value); } static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value) @@ -885,19 +907,10 @@ static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p) static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - static const WCHAR szItalic[] = {'i','t','a','l','i','c',0}; - static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0}; TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - /* fontStyle can only be one of the follow values. */ - if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 || - strcmpiW(szOblique, v) == 0) - { - return set_style_property(This, STYLEID_FONT_STYLE, v); - } - - return E_INVALIDARG; + return set_style_property(This, STYLEID_FONT_STYLE, v); } static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p) @@ -917,7 +930,7 @@ static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v) TRACE("(%p)->(%s)\n", This, debugstr_w(v)); /* fontVariant can only be one of the follow values. */ - if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0) + if(!v || strcmpiW(normalW, v) == 0 || strcmpiW(szCaps, v) == 0) { return set_style_property(This, STYLEID_FONT_VARIANT, v); } @@ -955,7 +968,7 @@ static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v) TRACE("(%p)->(%s)\n", This, debugstr_w(v)); /* fontWeight can only be one of the following */ - if(v && *v && strcmpiW(szNormal, v) && strcmpiW(styleBold, v) && strcmpiW(styleBolder, v) + if(v && *v && strcmpiW(normalW, v) && strcmpiW(styleBold, v) && strcmpiW(styleBolder, v) && strcmpiW(styleLighter, v) && strcmpiW(style100, v) && strcmpiW(style200, v) && strcmpiW(style300, v) && strcmpiW(style400, v) && strcmpiW(style500, v) && strcmpiW(style600, v) && strcmpiW(style700, v) && strcmpiW(style800, v) && strcmpiW(style900, v)) @@ -4795,7 +4808,7 @@ HRESULT set_elem_style(HTMLElement *elem, styleid_t styleid, const WCHAR *val) if(FAILED(hres)) return hres; - hres = set_nsstyle_property(style, styleid, val, 0); + hres = set_nsstyle_property(style, styleid, val); nsIDOMCSSStyleDeclaration_Release(style); return hres; }
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
62
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
Results per page:
10
25
50
100
200